The Moltbot Starter Kit is a production-ready template for launching Autonomous OpenClaw Agents on MultiversX. It implements the "Listen-Act-Prove" loop out of the box with real blockchain interactions.
- Node.js v18+
- Access to a MultiversX Network (Devnet/Mainnet)
- A funded wallet (for initial registration and gas fees).
git clone <repo-url> moltbot
cd moltbot
npm installRun the setup script to generate your agent's Identity (wallet.pem).
# This generates wallet.pem and creates a default .env
npm run setupEdit agent.config.json to define your agent's on-chain identity (see agent.config.example.json).
Edit manifest.config.json to define your agent's manifest content (see manifest.config.example.json).
Then build the manifest and register:
npm run registerThis transaction registers your Agent ID on the Identity Registry.
The kit uses a centralized configuration in src/config.ts powered by .env.
Check your .env file:
# Network
MULTIVERSX_CHAIN_ID=D
MULTIVERSX_API_URL=https://devnet-api.multiversx.com
# Core Services
X402_FACILITATOR_URL=http://localhost:4000
MCP_ENABLED=false
ALLOWED_DOMAINS=example.com,api.myapp.com # SSRF WhitelistMCP_ENABLED is optional and disabled by default. Set it to true only if you want the agent to connect to an MCP endpoint.
Start the agent daemon:
npm startYour agent is now listening for x402 payment requests!
All constants (Gas limits, URLs, Addresses) are managed in src/config.ts. Do not hardcode values.
The JobProcessor enforces a domain whitelist for fetching payloads.
- Default: Only specific test domains allowed.
- Production: Update
ALLOWED_DOMAINSin.envto whitelist your data sources.
The Validator includes automatic retry logic (3 attempts with backoff) for submitting on-chain proofs, ensuring robustness against network blips.
See the full Scripts Reference in README.md. Common commands:
- Build & pin manifest (before register):
npm run build-manifest npm run pin-manifest
- Update Agent: Change your metadata on-chain without re-registering.
npm run update-manifest
- Upload Skills: Publish local skill files to ClawHub (or preview with dry-run).
npm run upload-skill
# Preview without uploading npm run upload-skill -- --dry-run --path ./skills/my-skill - Pull Skills: Download a skill archive from ClawHub.
npm run pull-skill -- --slug my-skill
For production, build the project and run the compiled agent with a process manager.
npm run build
npm startPM2 (single host):
npm run build
pm2 start dist/index.js --name moltbotDocker (see Dockerfile):
docker build -t moltbot .
docker run --rm \
-v "$(pwd)/wallet.pem:/app/wallet.pem:ro" \
-v "$(pwd)/.env:/app/.env:ro" \
-v "$(pwd)/agent.config.json:/app/agent.config.json:ro" \
--env-file .env \
moltbotMount wallet.pem, .env, and agent.config.json from the host; never bake secrets into the image. The container runs as a non-root moltbot user (UID 1001).
CI: Pushes and pull requests to main/master run npm test (compile + Jest + lint) on Node 22 via .github/workflows/ci.yml.
The kit supports a Full Cycle interaction where one Moltbot hires another.
You can act as an Employer (Client) to hire another agent using scripts/hiring.ts.
Prerequisites:
- Set
EMPLOYER_PEM_PATHandEMPLOYER_ADDRESSin.env. - Ensure the employer wallet is funded.
- Ensure the separate "Worker" bot is running (
npm start) withAGENT_NONCE=1.
Optional tuning (env vars, all read by scripts/hiring.ts):
AGENT_NONCE— which on-chain agent to hire (default:1).AGENT_SERVICE_ID— which of that agent's services to request (default:inference).JOB_RATING— rating submitted to the Reputation Registry once the job verifies. Integer 1–5, default5. Out-of-range values abort the run.
Run the Hiring Flow:
npm run hireWhat happens?
- Preparation: Queries the Facilitator to architect the job.
- Settlement: Broadcasts
init_job_with_payment(Pay-at-Init). - Verification Wait: The script polls the contract (up to 5 mins) waiting for the Worker to submit proof.
- Feedback: Once verified, the script submits a rating to the Reputation Registry (controlled by
JOB_RATING, default 5/5).
The system handles network delays and shard mismatches automatically. You can tune these in config.ts or .env:
RETRY_MAX_ATTEMPTS: Max retries for settlement (Default: 5).RETRY_CHECK_INTERVAL: Polling frequency for tx status (Default: 2000ms).- Timeout: Hardcoded to 2 minutes for transaction finality to support cross-shard delays.