Run Trusted Mode
Run Trusted Mode
Section titled “Run Trusted Mode”Trusted mode is ZEVM’s writable local dev-node runtime.
Normative sources:
docs/specs/prd.mdanddocs/specs/json-rpc-contract.md.Prerequisite: complete Installation first, including Zig package fetch and a successful source build that produces
./zig-out/bin/zevm.
1. Start The Node
Section titled “1. Start The Node”Before running startup commands, re-check Installation prerequisites: Zig, Rust/Cargo, package-manager dependency pins, and the pinned build tuple in release release-tuple.json from ZEVM release metadata. For contract source ownership and docs-first change flow, see Canonical Specs And Docs-First Process.
Default startup (trusted mode):
./zig-out/bin/zevmEquivalent explicit startup:
./zig-out/bin/zevm --mode trusted --host 127.0.0.1 --port 8545Config-file startup equivalent (mode.trusted):
./zig-out/bin/zevm --config ./zevm.config.json{ "mode": { "trusted": { "mining": { "type": "auto" } } }}See Configuration Overview for full config shape and CLI/config precedence.
2. Verify Baseline RPC
Section titled “2. Verify Baseline RPC”curl -s -X POST http://127.0.0.1:8545 \ -H 'content-type: application/json' \ --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'curl -s -X POST http://127.0.0.1:8545 \ -H 'content-type: application/json' \ --data '{"jsonrpc":"2.0","id":2,"method":"eth_blockNumber","params":[]}'curl -s -X POST http://127.0.0.1:8545 \ -H 'content-type: application/json' \ --data '{"jsonrpc":"2.0","id":3,"method":"eth_accounts","params":[]}'Default trusted-mode values:
eth_chainIdreturns0x7a69(31337)eth_accountsreturns 10 managed dev accounts in index ordereth_coinbaseis the managed account atcoinbaseIndex(default0)- exact wallet contract (mnemonic, derivation path, addresses, private keys, and signing constraints): Managed Dev Wallet (Trusted Mode)
Warning: managed dev-account keys are deterministic/public test keys. Use them only for local development; never use them in production or with real funds.
3. Send A Local Transaction
Section titled “3. Send A Local Transaction”This sends 1 ETH from managed account 0 to managed account 1:
curl -s -X POST http://127.0.0.1:8545 \ -H 'content-type: application/json' \ --data '{ "jsonrpc":"2.0", "id":4, "method":"eth_sendTransaction", "params":[{ "from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "to":"0x70997970C51812dc3A010C7d01b50e0d17dc79C8", "value":"0xde0b6b3a7640000" }] }'Set TX_HASH to the result returned by eth_sendTransaction, then fetch the receipt:
TX_HASH=0x... # use the tx hash returned by the previous call
curl -s -X POST http://127.0.0.1:8545 \ -H 'content-type: application/json' \ --data '{"jsonrpc":"2.0","id":5,"method":"eth_getTransactionReceipt","params":["'"$TX_HASH"'"]}'4. Manual Mining Flow (Optional)
Section titled “4. Manual Mining Flow (Optional)”Start with manual mining:
./zig-out/bin/zevm --mode trusted --mining manualMine one block on demand:
curl -s -X POST http://127.0.0.1:8545 \ -H 'content-type: application/json' \ --data '{"jsonrpc":"2.0","id":6,"method":"zevm_mine","params":[]}'Mine multiple blocks:
curl -s -X POST http://127.0.0.1:8545 \ -H 'content-type: application/json' \ --data '{"jsonrpc":"2.0","id":7,"method":"zevm_mine","params":["0x3"]}'Validation Rules You Will Hit Most Often
Section titled “Validation Rules You Will Hit Most Often”--block-timeis valid only with--mining interval.--mining intervalrequires--block-time <seconds>.coinbaseIndexmust be in0..9.