Skip to content

Quickstart

This runs a three-node development cluster on your machine, deploys the key-value example, and calls it. You need a Rust toolchain and a checkout of calimero-network/core.

Terminal window
# in your core checkout
cargo build -p kv-store --target wasm32-unknown-unknown --profile app-release
cargo run -p merod -- local

merod local starts three nodes on http://127.0.0.1:2501-2503/ in one process, with mock attestation and a development storage key, and keeps their state in .merod-local/ (--fresh starts over). It prints an operator token. Browser apps on http://localhost:3000 and http://localhost:5173 may call it.

  1. Install meroctl and point it at the local cluster:

    Terminal window
    cargo install --path crates/meroctl
    meroctl node add local http://127.0.0.1:2501/ --allow-mock
  2. Sign up. On a development cluster a passkey can live in a file:

    Terminal window
    meroctl login --dev-passkey ./dev-passkey.json --name ada
  3. Install the app and create an instance of it:

    Terminal window
    meroctl app install --path target/wasm32-unknown-unknown/app-release/kv_store.wasm
    meroctl context create --bundle <hash> --name kv --alias kv

    meroctl calls an app instance a context. A raw WASM bundle installs only on a development cluster; a real cluster installs signed packages (meroctl app install PACKAGE@VERSION).

  4. Call a method, read a view, and watch the instance’s events:

    Terminal window
    meroctl call --context kv set --args '{"key":"a","value":"1"}'
    meroctl call --context kv get --args '{"key":"a"}' --view
    meroctl context watch kv
import { CalimeroClient, browserPasskey } from '@calimero-network/mero-js';
const client = new CalimeroClient({ baseUrl: 'http://127.0.0.1:2501', policy: { allowMock: true } });
await client.signUp(browserPasskey(), 'ada');
const bundle = await client.uploadBundle(wasm); // a raw WASM module: development clusters only
const app = await client.createApp('kv', bundle, { initArgs: {} });
await client.call(app, 'set', { key: 'a', value: '1' });
for await (const ev of client.events(app)) console.log(ev.kind, ev.data);
from calimero_client_py import Client
client = Client("http://127.0.0.1:2501", allow_mock=True)
client.use_api_key("cal_...")
print(client.view(app_id, "get", {"key": "a"})["result"])

The apps repository’s apps/kv-store/app-cloud is a complete browser frontend for this app: passkey sign-in, a store per user and live events.