Skip to content

Quickstart

This walks from an app’s crate to a method call on a local cluster. An app is a calimero:app component, written with the Rust SDK (calimero-sdk) and built with calimero-app-build; the tutorial is the long form, checking output at every step.

  1. Rust with the wasm32-wasip2 target (core’s rust-toolchain.toml lists it):

    Terminal window
    rustup target add wasm32-wasip2
  2. Test the app on the real engine, with no node (TestApp, in calimero-sdk’s testing module):

    Terminal window
    cargo test --manifest-path apps/kv-store/Cargo.toml
  3. Build the component:

    Terminal window
    scripts/install-mero-app-build.sh # once: puts mero-app-build on PATH
    mero-app-build apps/kv-store --out kv_store.wasm
  4. Start a development cluster and sign in (mock attestation, a passkey in a file):

    Terminal window
    cargo run -p merod -- local
    meroctl node add local http://127.0.0.1:2501/ --allow-mock
    meroctl login --dev-passkey ./dev-passkey.json --name alice
  5. Create an instance and call it:

    Terminal window
    meroctl context create --name my-kv --path kv_store.wasm --alias my-kv
    meroctl call -c my-kv set --args '{"key": "hello", "value": "world"}'
    meroctl call -c my-kv get --args '{"key": "hello"}' --view
  6. Package it for a real cluster: a signed .mpk (Packaging & signing):

    Terminal window
    python3 -I scripts/pack-component.py --wasm kv_store.wasm --package com.example.kv \
    --app-version 0.1.0 --out dist/com.example.kv-0.1.0.mpk