@calimero-network/agent-skills 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -17
- package/SKILL.md +31 -23
- package/package.json +2 -2
- package/scripts/install.js +3 -3
- package/scripts/test.js +6 -15
- package/skills/calimero-abi-codegen/SKILL.md +121 -22
- package/skills/calimero-abi-codegen/references/abi-format.md +3 -5
- package/skills/calimero-abi-codegen/references/generated-output.md +12 -4
- package/skills/calimero-abi-codegen/rules/schema-version.md +11 -4
- package/skills/calimero-abi-codegen/rules/unique-names.md +2 -6
- package/skills/calimero-client-js/SKILL.md +127 -22
- package/skills/calimero-client-js/references/auth.md +18 -10
- package/skills/calimero-client-js/references/rpc-calls.md +15 -21
- package/skills/calimero-client-js/references/sso.md +9 -9
- package/skills/calimero-client-js/references/websocket-events.md +73 -59
- package/skills/calimero-client-js/rules/camelcase-api.md +10 -7
- package/skills/calimero-client-js/rules/token-refresh.md +59 -21
- package/skills/calimero-client-py/SKILL.md +26 -10
- package/skills/calimero-client-py/references/api.md +41 -43
- package/skills/calimero-client-py/references/auth.md +7 -7
- package/skills/calimero-client-py/rules/async-usage.md +27 -31
- package/skills/calimero-client-py/rules/stable-node-name.md +7 -7
- package/skills/calimero-core/SKILL.md +135 -0
- package/skills/calimero-core/references/architecture.md +101 -0
- package/skills/calimero-core/references/jsonrpc-protocol.md +192 -0
- package/skills/calimero-core/references/namespaces-groups.md +94 -0
- package/skills/calimero-core/references/storage-types.md +118 -0
- package/skills/calimero-core/references/websocket-events.md +142 -0
- package/skills/calimero-core/rules/context-is-not-app.md +35 -0
- package/skills/calimero-core/rules/crdt-types-only.md +55 -0
- package/skills/calimero-desktop/SKILL.md +25 -14
- package/skills/calimero-desktop/references/sso-integration.md +49 -22
- package/skills/calimero-desktop/rules/sso-fallback.md +3 -2
- package/skills/calimero-merobox/SKILL.md +255 -28
- package/skills/calimero-merobox/references/ci-integration.md +3 -2
- package/skills/calimero-merobox/references/workflow-files.md +7 -5
- package/skills/calimero-merobox/rules/docker-required.md +7 -6
- package/skills/calimero-meroctl/SKILL.md +68 -0
- package/skills/calimero-meroctl/references/commands.md +177 -0
- package/skills/calimero-meroctl/references/scripting.md +80 -0
- package/skills/calimero-meroctl/rules/call-view-flag.md +28 -0
- package/skills/calimero-meroctl/rules/register-node-once.md +34 -0
- package/skills/calimero-merod/SKILL.md +49 -0
- package/skills/calimero-merod/references/health-endpoints.md +90 -0
- package/skills/calimero-merod/references/init-flags.md +84 -0
- package/skills/calimero-merod/rules/init-before-run.md +40 -0
- package/skills/calimero-merod/rules/port-assignments.md +33 -0
- package/skills/calimero-node/SKILL.md +52 -35
- package/skills/calimero-node/references/context-lifecycle.md +34 -17
- package/skills/calimero-node/references/meroctl-commands.md +89 -99
- package/skills/calimero-node/rules/app-vs-context.md +4 -4
- package/skills/calimero-registry/SKILL.md +110 -31
- package/skills/calimero-registry/references/bundle-and-push.md +99 -34
- package/skills/calimero-registry/references/manifest-format.md +56 -35
- package/skills/calimero-registry/references/mero-sign.md +10 -9
- package/skills/calimero-registry/rules/key-security.md +3 -2
- package/skills/calimero-registry/rules/sign-before-pack.md +5 -5
- package/skills/calimero-rust-sdk/SKILL.md +154 -44
- package/skills/calimero-rust-sdk/references/blob-api.md +119 -0
- package/skills/calimero-rust-sdk/references/event-handlers.md +122 -0
- package/skills/calimero-rust-sdk/references/events.md +2 -1
- package/skills/calimero-rust-sdk/references/examples.md +81 -29
- package/skills/calimero-rust-sdk/references/migrations.md +123 -0
- package/skills/calimero-rust-sdk/references/nested-crdts.md +113 -0
- package/skills/calimero-rust-sdk/references/private-storage.md +76 -34
- package/skills/calimero-rust-sdk/references/state-collections.md +106 -21
- package/skills/calimero-rust-sdk/references/user-and-frozen-storage.md +169 -0
- package/skills/calimero-rust-sdk/rules/app-macro-placement.md +5 -2
- package/skills/calimero-rust-sdk/rules/no-std-collections.md +5 -2
- package/skills/calimero-rust-sdk/rules/state-derives.md +45 -0
- package/skills/calimero-rust-sdk/rules/wasm-constraints.md +12 -10
- package/skills/calimero-sdk-js/SKILL.md +145 -0
- package/skills/calimero-sdk-js/references/build-pipeline.md +98 -0
- package/skills/calimero-sdk-js/references/collections.md +132 -0
- package/skills/calimero-sdk-js/references/events.md +63 -0
- package/skills/calimero-sdk-js/rules/crdt-only-state.md +47 -0
- package/skills/calimero-sdk-js/rules/no-console-log.md +38 -0
- package/skills/calimero-sdk-js/rules/view-decorator.md +48 -0
|
@@ -1,54 +1,281 @@
|
|
|
1
1
|
# calimero-merobox — Agent Instructions
|
|
2
2
|
|
|
3
|
-
You are helping a developer set up a **local
|
|
3
|
+
You are helping a developer set up and test a **local Calimero network** using Merobox.
|
|
4
4
|
|
|
5
5
|
## What Merobox is
|
|
6
6
|
|
|
7
|
-
Merobox is a
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
7
|
+
Merobox is a Python CLI tool for running Calimero nodes in Docker containers. It handles:
|
|
8
|
+
|
|
9
|
+
- Starting/stopping nodes with `merobox run` / `merobox stop`
|
|
10
|
+
- App installation and method execution
|
|
11
|
+
- Identity and context management
|
|
12
|
+
- Automated multi-step test workflows via YAML (`merobox bootstrap run`)
|
|
13
|
+
- Multi-node orchestration for integration testing
|
|
12
14
|
|
|
13
15
|
## Install
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
|
-
#
|
|
18
|
+
# macOS
|
|
19
|
+
brew install merobox
|
|
20
|
+
|
|
21
|
+
# Ubuntu/Debian
|
|
22
|
+
curl -fsSL https://calimero-network.github.io/merobox/gpg.key \
|
|
23
|
+
| sudo tee /usr/share/keyrings/merobox.gpg > /dev/null
|
|
24
|
+
echo "deb [signed-by=/usr/share/keyrings/merobox.gpg] https://calimero-network.github.io/merobox stable main" \
|
|
25
|
+
| sudo tee /etc/apt/sources.list.d/merobox.list
|
|
26
|
+
sudo apt update && sudo apt install merobox
|
|
27
|
+
|
|
28
|
+
# pipx (any platform)
|
|
17
29
|
pipx install merobox
|
|
18
30
|
|
|
19
|
-
#
|
|
20
|
-
|
|
31
|
+
merobox --version # verify
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Requires Docker 20.10+ running.
|
|
35
|
+
|
|
36
|
+
## Node management
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Start a node
|
|
40
|
+
merobox run --name my-node
|
|
41
|
+
|
|
42
|
+
# Start with custom ports
|
|
43
|
+
merobox run --name my-node --server-port 2428 --swarm-port 2528
|
|
44
|
+
|
|
45
|
+
# List running nodes
|
|
46
|
+
merobox list
|
|
47
|
+
|
|
48
|
+
# Check node health
|
|
49
|
+
merobox health my-node
|
|
50
|
+
|
|
51
|
+
# View logs
|
|
52
|
+
merobox logs my-node
|
|
53
|
+
merobox logs my-node --follow # follow in real-time
|
|
21
54
|
|
|
22
|
-
#
|
|
55
|
+
# Stop a node
|
|
56
|
+
merobox stop my-node
|
|
57
|
+
|
|
58
|
+
# Delete all node data (destructive)
|
|
59
|
+
merobox nuke my-node
|
|
23
60
|
```
|
|
24
61
|
|
|
25
|
-
##
|
|
62
|
+
## App and context management
|
|
26
63
|
|
|
27
64
|
```bash
|
|
28
|
-
#
|
|
29
|
-
|
|
65
|
+
# Install a WASM app on a node
|
|
66
|
+
merobox install --node my-node --path ./app.wasm --dev
|
|
67
|
+
|
|
68
|
+
# List installed apps
|
|
69
|
+
merobox application list --node my-node
|
|
70
|
+
|
|
71
|
+
# Create a context
|
|
72
|
+
merobox context create --node my-node --application-id <app-id>
|
|
73
|
+
|
|
74
|
+
# List contexts
|
|
75
|
+
merobox context list --node my-node
|
|
76
|
+
|
|
77
|
+
# Call a method
|
|
78
|
+
merobox call my-node <context-id> <method> '{"key":"hello","value":"world"}'
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Identity management
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
merobox identity generate --node my-node
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Blob storage
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
merobox blob upload --node my-node --file ./data.txt
|
|
91
|
+
merobox blob list-blobs --node my-node
|
|
92
|
+
merobox blob download --node my-node --blob-id <id> --output ./out.txt
|
|
93
|
+
merobox blob delete --node my-node --blob-id <id> --yes
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Workflow automation (bootstrap)
|
|
97
|
+
|
|
98
|
+
Workflows are the most powerful feature — YAML files that orchestrate multi-step scenarios.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
merobox bootstrap run workflow.yml # execute
|
|
102
|
+
merobox bootstrap validate workflow.yml # validate only
|
|
103
|
+
merobox bootstrap create-sample # scaffold example
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Minimal workflow example
|
|
107
|
+
|
|
108
|
+
```yaml
|
|
109
|
+
name: KV Store Test
|
|
110
|
+
steps:
|
|
111
|
+
- type: install_application
|
|
112
|
+
node: node-1
|
|
113
|
+
path: ./kv_store.wasm
|
|
114
|
+
outputs:
|
|
115
|
+
app_id: 'application_id'
|
|
116
|
+
|
|
117
|
+
- type: create_context
|
|
118
|
+
node: node-1
|
|
119
|
+
application_id: '{{app_id}}'
|
|
120
|
+
outputs:
|
|
121
|
+
ctx_id: 'context.context_id'
|
|
122
|
+
|
|
123
|
+
- type: create_identity
|
|
124
|
+
node: node-1
|
|
125
|
+
outputs:
|
|
126
|
+
pub: 'public_key'
|
|
127
|
+
|
|
128
|
+
- type: call
|
|
129
|
+
node: node-1
|
|
130
|
+
context_id: '{{ctx_id}}'
|
|
131
|
+
method: set
|
|
132
|
+
args:
|
|
133
|
+
key: 'hello'
|
|
134
|
+
value: 'world'
|
|
135
|
+
executor_public_key: '{{pub}}'
|
|
136
|
+
outputs:
|
|
137
|
+
result: 'output'
|
|
138
|
+
|
|
139
|
+
- type: assert
|
|
140
|
+
statements:
|
|
141
|
+
- 'is_set({{result}})'
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Available step types
|
|
145
|
+
|
|
146
|
+
| Step | What it does |
|
|
147
|
+
| --------------------- | ------------------------------------------------------- |
|
|
148
|
+
| `install_application` | Install WASM app, capture `application_id` |
|
|
149
|
+
| `create_context` | Create context, capture `context_id` and `seed` |
|
|
150
|
+
| `create_identity` | Create identity, capture `private_key` and `public_key` |
|
|
151
|
+
| `join_context` | Join a node to a context (targeted invitation) |
|
|
152
|
+
| `invite_open` | Create open invitation (anyone can join) |
|
|
153
|
+
| `join_open` | Join via open invitation |
|
|
154
|
+
| `call` | Execute app method, capture output |
|
|
155
|
+
| `wait` | Sleep N seconds |
|
|
156
|
+
| `repeat` | Loop with index variable |
|
|
157
|
+
| `assert` | Validate values (`is_set`, `contains`, `==`) |
|
|
158
|
+
| `json_assert` | JSON equality/subset checks |
|
|
159
|
+
| `upload_blob` | Upload file to blob storage, capture `blob_id` |
|
|
160
|
+
| `script` | Run a shell script |
|
|
161
|
+
| `fuzzy_test` | Randomized load test (30-60+ min) |
|
|
162
|
+
|
|
163
|
+
### Multi-node example
|
|
164
|
+
|
|
165
|
+
```yaml
|
|
166
|
+
name: Two-Node Sync Test
|
|
167
|
+
steps:
|
|
168
|
+
- type: install_application
|
|
169
|
+
node: node-1
|
|
170
|
+
path: ./app.wasm
|
|
171
|
+
outputs:
|
|
172
|
+
app_id: 'application_id'
|
|
173
|
+
|
|
174
|
+
- type: create_context
|
|
175
|
+
node: node-1
|
|
176
|
+
application_id: '{{app_id}}'
|
|
177
|
+
outputs:
|
|
178
|
+
ctx: 'context.context_id'
|
|
179
|
+
|
|
180
|
+
- type: create_identity
|
|
181
|
+
node: node-1
|
|
182
|
+
outputs:
|
|
183
|
+
pub1: 'public_key'
|
|
184
|
+
|
|
185
|
+
- type: create_identity
|
|
186
|
+
node: node-2
|
|
187
|
+
outputs:
|
|
188
|
+
pub2: 'public_key'
|
|
189
|
+
|
|
190
|
+
# invite node-2 to join the context
|
|
191
|
+
- type: invite_open
|
|
192
|
+
node: node-1
|
|
193
|
+
context_id: '{{ctx}}'
|
|
194
|
+
granter_id: '{{pub1}}'
|
|
195
|
+
outputs:
|
|
196
|
+
invite: 'invitation'
|
|
197
|
+
|
|
198
|
+
- type: join_open
|
|
199
|
+
node: node-2
|
|
200
|
+
invitee_id: '{{pub2}}'
|
|
201
|
+
invitation: '{{invite}}'
|
|
202
|
+
|
|
203
|
+
- type: wait
|
|
204
|
+
seconds: 2 # allow sync
|
|
205
|
+
|
|
206
|
+
- type: call
|
|
207
|
+
node: node-1
|
|
208
|
+
context_id: '{{ctx}}'
|
|
209
|
+
method: set
|
|
210
|
+
args:
|
|
211
|
+
key: 'msg'
|
|
212
|
+
value: 'hello'
|
|
213
|
+
executor_public_key: '{{pub1}}'
|
|
214
|
+
|
|
215
|
+
- type: wait
|
|
216
|
+
seconds: 1
|
|
217
|
+
|
|
218
|
+
- type: call
|
|
219
|
+
node: node-2
|
|
220
|
+
context_id: '{{ctx}}'
|
|
221
|
+
method: get
|
|
222
|
+
args:
|
|
223
|
+
key: 'msg'
|
|
224
|
+
executor_public_key: '{{pub2}}'
|
|
225
|
+
outputs:
|
|
226
|
+
val: 'output'
|
|
227
|
+
|
|
228
|
+
- type: assert
|
|
229
|
+
statements:
|
|
230
|
+
- "contains({{val}}, 'hello')"
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Auth service (production-like setup)
|
|
234
|
+
|
|
235
|
+
```yaml
|
|
236
|
+
name: Workflow with Auth
|
|
237
|
+
auth_service: true # enables Traefik + auth middleware
|
|
238
|
+
|
|
30
239
|
nodes:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
240
|
+
count: 1
|
|
241
|
+
prefix: 'calimero-node'
|
|
242
|
+
image: 'ghcr.io/calimero-network/merod:edge'
|
|
243
|
+
|
|
244
|
+
steps:
|
|
245
|
+
- type: wait
|
|
246
|
+
seconds: 5
|
|
247
|
+
message: 'Waiting for auth service...'
|
|
248
|
+
```
|
|
36
249
|
|
|
37
|
-
|
|
38
|
-
merobox up --workflow workflow.yml
|
|
250
|
+
Node URL with auth: `http://node1.127.0.0.1.nip.io`
|
|
39
251
|
|
|
40
|
-
|
|
41
|
-
|
|
252
|
+
## Variable substitution
|
|
253
|
+
|
|
254
|
+
```yaml
|
|
255
|
+
{{variable_name}} # step output
|
|
256
|
+
{{env.MY_VAR}} # environment variable
|
|
257
|
+
{{iteration}} # loop index in repeat
|
|
258
|
+
{{random_int(1, 100)}} # random integer
|
|
259
|
+
{{random_string(8)}} # random string
|
|
260
|
+
{{uuid}} # UUID v4
|
|
261
|
+
{{timestamp}} # Unix timestamp
|
|
262
|
+
{{random_node}} # random node from list
|
|
42
263
|
```
|
|
43
264
|
|
|
44
265
|
## When to use Merobox vs meroctl
|
|
45
266
|
|
|
46
|
-
| Task
|
|
47
|
-
|
|
|
48
|
-
| Local multi-node dev and testing
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
267
|
+
| Task | Use |
|
|
268
|
+
| ---------------------------------------- | ------- |
|
|
269
|
+
| Local multi-node dev and testing | Merobox |
|
|
270
|
+
| CI pipeline with multi-step scenarios | Merobox |
|
|
271
|
+
| Quick single command against a live node | meroctl |
|
|
272
|
+
| Managing a production node | meroctl |
|
|
273
|
+
|
|
274
|
+
## Related skills
|
|
275
|
+
|
|
276
|
+
- **`calimero-merod`** — `merod` daemon setup (init, ports, health endpoint)
|
|
277
|
+
- **`calimero-meroctl`** — full `meroctl` CLI reference for scripting against a live node
|
|
278
|
+
- **`calimero-core`** — context/app model and namespace/group participation model
|
|
52
279
|
|
|
53
280
|
## References
|
|
54
281
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# CI Integration
|
|
2
2
|
|
|
3
|
-
Use Merobox in GitHub Actions or other CI systems to run integration tests against a real multi-node
|
|
3
|
+
Use Merobox in GitHub Actions or other CI systems to run integration tests against a real multi-node
|
|
4
|
+
network.
|
|
4
5
|
|
|
5
6
|
## GitHub Actions example
|
|
6
7
|
|
|
@@ -49,4 +50,4 @@ jobs:
|
|
|
49
50
|
## Reference workflow files
|
|
50
51
|
|
|
51
52
|
The Battleships repo has well-structured workflow examples:
|
|
52
|
-
https://github.com/calimero-network/battleships/tree/main/workflows
|
|
53
|
+
<https://github.com/calimero-network/battleships/tree/main/workflows>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Merobox Workflow Files
|
|
2
2
|
|
|
3
|
-
Workflow files define reusable network topologies. Commit them to your repo for repeatable local dev
|
|
3
|
+
Workflow files define reusable network topologies. Commit them to your repo for repeatable local dev
|
|
4
|
+
and CI environments.
|
|
4
5
|
|
|
5
6
|
## Minimal workflow
|
|
6
7
|
|
|
@@ -30,16 +31,16 @@ setup:
|
|
|
30
31
|
|
|
31
32
|
- step: create_context
|
|
32
33
|
node: node1
|
|
33
|
-
app_id:
|
|
34
|
+
app_id: '{{ install_app.app_id }}'
|
|
34
35
|
|
|
35
36
|
- step: invite_member
|
|
36
37
|
node: node1
|
|
37
|
-
context_id:
|
|
38
|
-
identity:
|
|
38
|
+
context_id: '{{ create_context.context_id }}'
|
|
39
|
+
identity: '{{ node2.identity }}'
|
|
39
40
|
|
|
40
41
|
- step: join_context
|
|
41
42
|
node: node2
|
|
42
|
-
invitation:
|
|
43
|
+
invitation: '{{ invite_member.invitation }}'
|
|
43
44
|
```
|
|
44
45
|
|
|
45
46
|
## Commands
|
|
@@ -64,6 +65,7 @@ merobox down --purge
|
|
|
64
65
|
## Accessing nodes after startup
|
|
65
66
|
|
|
66
67
|
Each node exposes its JSON-RPC at the configured port:
|
|
68
|
+
|
|
67
69
|
- `node1` → `http://localhost:2428`
|
|
68
70
|
- `node2` → `http://localhost:2429`
|
|
69
71
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Rule: Docker must be running before merobox commands
|
|
2
2
|
|
|
3
|
-
Merobox uses Docker to run node containers. All `merobox up`, `merobox down`, and `merobox status`
|
|
3
|
+
Merobox uses Docker to run node containers. All `merobox up`, `merobox down`, and `merobox status`
|
|
4
|
+
commands require the Docker daemon to be running.
|
|
4
5
|
|
|
5
6
|
## Check before running
|
|
6
7
|
|
|
@@ -11,11 +12,11 @@ merobox up --workflow workflow.yml
|
|
|
11
12
|
|
|
12
13
|
## Common errors and fixes
|
|
13
14
|
|
|
14
|
-
| Error
|
|
15
|
-
|
|
|
16
|
-
| `Cannot connect to the Docker daemon` | Start Docker Desktop or `sudo systemctl start docker`
|
|
17
|
-
| `port is already allocated`
|
|
18
|
-
| `image not found`
|
|
15
|
+
| Error | Fix |
|
|
16
|
+
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| `Cannot connect to the Docker daemon` | Start Docker Desktop or `sudo systemctl start docker` |
|
|
18
|
+
| `port is already allocated` | Another process (or a previous merobox run) is using that port. Run `merobox down` first or change the port in `workflow.yml` |
|
|
19
|
+
| `image not found` | First run pulls images — ensure internet access. Re-run after pull completes. |
|
|
19
20
|
|
|
20
21
|
## Minimum Docker version
|
|
21
22
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# calimero-meroctl — Agent Instructions
|
|
2
|
+
|
|
3
|
+
You are helping a developer use **`meroctl`** — the Calimero CLI for administering a running `merod`
|
|
4
|
+
node (apps, contexts, identities, calls, namespaces, groups).
|
|
5
|
+
|
|
6
|
+
## What meroctl is
|
|
7
|
+
|
|
8
|
+
`meroctl` is a standalone CLI that connects to a running `merod` node over HTTP. It does **not**
|
|
9
|
+
start or stop the node — use `merod` for that. `meroctl` is for everything you would do after the
|
|
10
|
+
node is running.
|
|
11
|
+
|
|
12
|
+
## Connecting to a node
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Register a local node once (recommended)
|
|
16
|
+
meroctl node add node1 /path/to/calimero/home
|
|
17
|
+
meroctl node use node1 # set as default
|
|
18
|
+
|
|
19
|
+
# Or use a remote node
|
|
20
|
+
meroctl node add prod http://my-node.example.com
|
|
21
|
+
meroctl node use prod
|
|
22
|
+
|
|
23
|
+
# Or pass URL directly on any command (no registration needed)
|
|
24
|
+
meroctl --api http://localhost:2428 context ls
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Once a node is registered and set as active, you can omit `--node` from every command.
|
|
28
|
+
|
|
29
|
+
## Core workflow: app → context → call
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# 1. Install app
|
|
33
|
+
meroctl app install --path myapp.wasm
|
|
34
|
+
# → prints application-id
|
|
35
|
+
|
|
36
|
+
# 2. Create context (calls init())
|
|
37
|
+
meroctl context create --application-id <application-id>
|
|
38
|
+
# → prints context-id
|
|
39
|
+
|
|
40
|
+
# 3. Call a mutation
|
|
41
|
+
meroctl call <context-id> set --args '{"key":"hello","value":"world"}'
|
|
42
|
+
|
|
43
|
+
# 4. Call a view
|
|
44
|
+
meroctl call <context-id> get --args '{"key":"hello"}' --view
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Global flags
|
|
48
|
+
|
|
49
|
+
| Flag | Purpose |
|
|
50
|
+
| --------------- | --------------------------------------------------------------- |
|
|
51
|
+
| `--node <name>` | Use a registered node by name |
|
|
52
|
+
| `--api <url>` | Connect to a node directly by URL (skips registration) |
|
|
53
|
+
| `--home <path>` | Alternate meroctl config directory (default: system config dir) |
|
|
54
|
+
|
|
55
|
+
## Key rules
|
|
56
|
+
|
|
57
|
+
- `app install` and `context create` are always two separate steps.
|
|
58
|
+
- Use `--view` on calls that only read state — it skips state persistence.
|
|
59
|
+
- Register a node with `meroctl node add` + `meroctl node use` once; after that no `--node` flag is
|
|
60
|
+
needed.
|
|
61
|
+
|
|
62
|
+
## References
|
|
63
|
+
|
|
64
|
+
See `references/` for:
|
|
65
|
+
|
|
66
|
+
- Full command reference for all subcommand groups
|
|
67
|
+
- Scripting patterns for CI and automation
|
|
68
|
+
- Multi-node setup with namespaces and groups
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# meroctl Command Reference
|
|
2
|
+
|
|
3
|
+
## Global flags
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
meroctl --node <name> <cmd> # registered node by name
|
|
7
|
+
meroctl --api <url> <cmd> # direct URL, no registration
|
|
8
|
+
meroctl --home <path> <cmd> # alternate config directory
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## node — manage node connections
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Register a local node
|
|
17
|
+
meroctl node add <name> <path-to-calimero-home>
|
|
18
|
+
|
|
19
|
+
# Register a remote node
|
|
20
|
+
meroctl node add <name> <http-url>
|
|
21
|
+
|
|
22
|
+
# Set active (default) node
|
|
23
|
+
meroctl node use <name>
|
|
24
|
+
|
|
25
|
+
# List registered nodes
|
|
26
|
+
meroctl node ls
|
|
27
|
+
|
|
28
|
+
# Remove a node connection
|
|
29
|
+
meroctl node remove <name>
|
|
30
|
+
|
|
31
|
+
# Show this node's peer identity (public key)
|
|
32
|
+
meroctl node identity
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## app — manage installed applications
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Install from local WASM file
|
|
41
|
+
meroctl app install --path path/to/app.wasm
|
|
42
|
+
|
|
43
|
+
# Install from local .mpk bundle
|
|
44
|
+
meroctl app install --path path/to/app.mpk
|
|
45
|
+
|
|
46
|
+
# Install from registry URL
|
|
47
|
+
meroctl app install --url https://apps.calimero.network/<app-id>/<version>
|
|
48
|
+
|
|
49
|
+
# List installed apps
|
|
50
|
+
meroctl app ls
|
|
51
|
+
|
|
52
|
+
# Get details of a specific app
|
|
53
|
+
meroctl app get <application-id>
|
|
54
|
+
|
|
55
|
+
# Remove an app (does not delete existing contexts)
|
|
56
|
+
meroctl app remove <application-id>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## context — manage contexts
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Create a context (instantiates app — calls init())
|
|
65
|
+
meroctl context create --application-id <application-id>
|
|
66
|
+
|
|
67
|
+
# Create in dev mode (auto-reinstall when WASM file changes)
|
|
68
|
+
meroctl context create --watch path/to/app.wasm
|
|
69
|
+
|
|
70
|
+
# List all contexts on this node
|
|
71
|
+
meroctl context ls
|
|
72
|
+
|
|
73
|
+
# Get details of a specific context
|
|
74
|
+
meroctl context get <context-id>
|
|
75
|
+
|
|
76
|
+
# Delete a context (wipes all state — irreversible)
|
|
77
|
+
meroctl context delete <context-id>
|
|
78
|
+
|
|
79
|
+
# Manually trigger state sync with peers
|
|
80
|
+
meroctl context sync <context-id>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## call — invoke app methods
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Mutation — changes shared CRDT state
|
|
89
|
+
meroctl call <context-id> <method-name> --args '{"key":"val"}'
|
|
90
|
+
|
|
91
|
+
# View — read-only, skips state persistence
|
|
92
|
+
meroctl call <context-id> <method-name> --args '{"key":"val"}' --view
|
|
93
|
+
|
|
94
|
+
# Method with no arguments
|
|
95
|
+
meroctl call <context-id> list_all --args '{}' --view
|
|
96
|
+
|
|
97
|
+
# Specify executor identity explicitly
|
|
98
|
+
meroctl call <context-id> <method> --args '{}' --as <identity-id>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The `--view` flag should be used for any method that is annotated `@View()` (JS) or takes `&self`
|
|
102
|
+
without state mutation (Rust). Omitting `--view` on a read method is not harmful but wastes a
|
|
103
|
+
storage write.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## identity — manage identities
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Create a new identity (Ed25519 keypair)
|
|
111
|
+
meroctl identity create
|
|
112
|
+
|
|
113
|
+
# List all identities
|
|
114
|
+
meroctl identity ls
|
|
115
|
+
|
|
116
|
+
# Get details of a specific identity
|
|
117
|
+
meroctl identity get <identity-id>
|
|
118
|
+
|
|
119
|
+
# Delete an identity
|
|
120
|
+
meroctl identity delete <identity-id>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## namespace — multi-node trust
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Create a namespace (this node is the trust root)
|
|
129
|
+
meroctl namespace create
|
|
130
|
+
|
|
131
|
+
# List namespaces on this node
|
|
132
|
+
meroctl namespace ls
|
|
133
|
+
|
|
134
|
+
# Generate an invite token (share with the joining node)
|
|
135
|
+
meroctl namespace invite <namespace-id>
|
|
136
|
+
|
|
137
|
+
# Join a namespace using an invite token
|
|
138
|
+
meroctl namespace join <namespace-id> '<invitation-json>'
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## group — context membership
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# List groups
|
|
147
|
+
meroctl group ls
|
|
148
|
+
|
|
149
|
+
# Join a context via group membership (after joining the namespace)
|
|
150
|
+
meroctl group join-context <context-id>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Full local dev flow (single machine)
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# 1. Start the node (in another terminal)
|
|
159
|
+
merod --node node1 init --server-port 2428 --swarm-port 2528
|
|
160
|
+
merod --node node1 run
|
|
161
|
+
|
|
162
|
+
# 2. Register the node
|
|
163
|
+
meroctl node add node1 ~/.calimero/node1
|
|
164
|
+
meroctl node use node1
|
|
165
|
+
|
|
166
|
+
# 3. Install app
|
|
167
|
+
meroctl app install --path target/wasm32-unknown-unknown/release/myapp.wasm
|
|
168
|
+
# → save application-id
|
|
169
|
+
|
|
170
|
+
# 4. Create context
|
|
171
|
+
meroctl context create --application-id <application-id>
|
|
172
|
+
# → save context-id
|
|
173
|
+
|
|
174
|
+
# 5. Develop interactively
|
|
175
|
+
meroctl call <context-id> set --args '{"key":"foo","value":"bar"}'
|
|
176
|
+
meroctl call <context-id> get --args '{"key":"foo"}' --view
|
|
177
|
+
```
|