← 返回
未分类

Bobine Contract Caller

Use when you need to call deployed Bobine modules with typed params or perform a signed Ed25519 call through an auth module.
用于需要使用类型化参数调用已部署的 Bobine 模块,或通过认证模块执行签名的 Ed25519 调用。
ccamel ccamel 来源
未分类 clawhub v0.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 254
下载
💾 0
安装
1
版本
#latest

概述

Bobine Contract Caller

Default entrypoint: scripts/call_bobine.mjs.

Upstream references

  • Concept overview:
  • Bobine project:
  • Standard libraries for Bobine WebAssembly VM:

Scope

  • Calling a Bobine module through /api/execute
  • Preparing typed Bobine params for contract methods
  • Generating Ed25519 keys for Bobine auth sessions
  • Performing an authenticated ed25519 call with nonce handling and signature

Runtime requirements

  • Node.js 20+
  • Network access to a Bobine server

Load on demand

  • Read references/params.md only when params use packed arrays or quoted text: payloads
  • Read references/runtime.md only when spark handling, outputs, or failure modes are unclear
  • Use scripts/keygen.mjs only when the call needs ed25519 auth
  • Use scripts/call_bobine.mjs for all unsigned and signed calls

Quick workflow

  1. Use scripts/call_bobine.mjs as the default entrypoint for Bobine interactions.
  2. Read references/params.md only if params are nested, packed, or need quoted text:.
  3. Generate keys if the call needs ed25519 auth:

```bash

node ./scripts/keygen.mjs

```

  1. Call the target contract with explicit arguments:

```bash

node ./scripts/call_bobine.mjs \

--server http://localhost:8080 \

--module \

--method \

--param text:Alice

```

Inputs

  • call_bobine.mjs
  • --server: Bobine server base URL
  • --module: target module address
  • --method: target method name
  • --param: repeat once per typed param
  • --auth-module: optional deployed ed25519 auth module address
  • --sigkey: required when --auth-module is provided
  • --pubkey: required when --auth-module is provided
  • --spark-hex: optional one-off spark value for this exact call
  • --spark-effort: optional inline spark generation target

Param rules

  • Scalars:
  • null
  • blob:
  • bigint:
  • number:
  • text:
  • Arrays:
  • pack:[...]
  • array:[...]
  • Nesting is allowed
  • Quote the whole shell argument when it contains brackets, commas, or spaces
  • Quote the text: payload itself when it contains , or ], for example text:"a,b]"

Gotchas

  • --param is one top-level Bobine param per flag; nested arrays stay inside a single typed param string
  • text: values containing , or ] must quote the payload itself, for example text:"a,b]"
  • Signed calls require all of --auth-module, --sigkey, and --pubkey
  • --spark-hex is a one-off override for a specific call; prefer --spark-effort when you want a fresh spark
  • keygen.mjs prints secret material, so do not paste its output back to the user unless they explicitly ask for it

Signed call behavior

  1. Read --server, target module, target method, and typed params
  2. Build the Bobine session payload [auth_module, pubkey]
  3. Derive the session address from sha256(pack(session))
  4. Query .get_nonce(session_address)
  5. Sign [domain, module, method, params, nonce]
  6. Call .call(module, method, params, pubkey, signature)
  7. Print a JSON object with logs, returned value, spark hex, and reported sparks

Output contract

  • Scripts print a single JSON object on stdout on success
  • Usage and failure diagnostics go to stderr
  • Returned Bobine values are normalized into tagged JSON:
  • { "type": "text", "value": "hello" }
  • { "type": "bigint", "value": "42" }
  • { "type": "array", "value": [...] }
  • keygen.mjs prints { "sigkey": "...", "pubkey": "..." }

Safety

  • Do not echo private keys back to the user unless they explicitly ask for them
  • Treat sigkey as sensitive
  • Prefer a fresh inline spark by default; use --spark-hex only when you deliberately want to supply a one-off spark
  • Surface server errors and decoded logs instead of retrying blindly

Troubleshooting

  • Missing required call arguments: re-run with --server, --module, --method, and any required auth flags
  • Unknown value type: read references/params.md
  • Failed Bobine execute request: report the HTTP status and response body
  • Invalid session or Unauthorized: the auth module, nonce, keys, or target contract assumptions are wrong

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-11 05:07 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 76 📥 182,484
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,900
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 681 📥 329,528