Mochi Local Sandbox
Apps & Automationmochi-local-sandboxMochi Local Sandbox is an Agent Skill for apps & automation published in the hyperledger-iroha/iroha repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Bring up and use a Mochi-managed local Iroha sandbox plus its local Torii MCP endpoint. Use when Codex needs a reliable local devnet, needs to print or verify the `codex mcp add mochi-local --url ...` command, or should consume the generated `.env.local` and `.mochi/generated/*` bootstrap files for local-only development.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/hyperledger-iroha/iroha/blob/HEAD/skills/mochi-local-sandbox/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/mochi-local-sandbox, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Mochi Local Sandbox
Use Mochi as the local Iroha devnet launcher and MCP bridge.
Quick Start
- Start the sandbox from the target workspace:
scripts/mochi_local_sandbox.sh up- Use
MOCHI_WORKSPACE_ROOT=/path/to/appwhen the current shell is not already in the app workspace. - Use
MOCHI_PROFILE=four-peer-bftwhen the user wants the four-validator rehearsal instead of the defaultsingle-peer.
- Confirm the sandbox is healthy:
scripts/mochi_local_sandbox.sh status- Healthy means
status: ready,ready: true, andmcp_ready: true. stale-sessionmeanssession.jsonexists but the detached Mochi process is gone; inspectserve.logand rerunuporreset.
- If Codex needs the local MCP endpoint, print the exact add command:
scripts/mochi_local_sandbox.sh mcp-add-command
- Use the workspace bootstrap artifacts:
.env.local.mochi/generated/typescript/connect.ts.mochi/generated/rust/connect.rs.mochi/generated/kotlin/MochiConnect.kt
Working Rules
- Prefer Mochi's curated local
iroha.*MCP tools. Do not prefer rawtorii.*tools when the local MCP surface is healthy. - Treat
.env.local,session.json, and any generatedIROHA_PRIVATE_KEYvalue as runtime-only local-dev material. Do not commit them or copy them into permanent docs. - Use
scripts/mochi_local_sandbox.sh envwhen you need copy/paste shell exports for a local app. - Use
scripts/mochi_local_sandbox.sh resetwhen the local chain must be wiped and regenerated. - Expect generated local configs to enable
[torii.mcp]with the curated writer profile and[torii.transport.norito_rpc]withenabled = true,require_mtls = false, andstage = "ga". - If
upfails, inspect:scripts/mochi_local_sandbox.sh status<workspace>/.mochi/sandbox/<profile>/serve.log<workspace>/.mochi/sandbox/<profile>/session.jsonwhen it exists<workspace>/.mochi/sandbox/<profile>/serve.pidwhenstatusreportsstale-session
- If readiness smoke fails, treat
serve.logas authoritative. The smoke path updates metadata on the existingwonderland.universaldomain and confirms commit through block/event streams plus HTTP transaction-status fallback. - If the user wants a custom non-preset profile, prefer the GUI or direct
mochi sandbox serveflow instead of stretching the helper script beyondsingle-peerandfour-peer-bft.
Response Pattern
- Bring the sandbox up if the user asked to test or use the local env and it is not already ready.
- Report the exact local MCP add command when Codex or the user needs it.
- Base app wiring advice on
.env.localand.mochi/generated/*, not on ad-hoc handwritten env snippets. - Keep local sandbox guidance clearly separated from live-network guidance such as Taira.