From running Optimism L2 to connecting SentinAI (local guide)
This document covers the complete procedure for running the Optimism official tutorial-based example locally and connecting SentinAI to its L2.
Base date: 2026-02-20
1. Goal
- Run OP Stack L2 locally
- Verify that L2 RPC (
http://localhost:8545) responds normally - Connect SentinAI to local L2
- Check normal metrics in SentinAI API (
/api/metrics)
2. Advance preparation
Required tools:
- Docker / Docker Compose
- Git
makejq
check:
docker --version
docker compose version
git --version
make --version
jq --version
Prepare L1 (Sepolia):
- Sepolia RPC URL
- Distribution wallet Private Key (sufficient Sepolia ETH required)
3. Optimism L2 generation
3.1 Get example code
cd /Users/theo/workspace_tokamak/SentinAI
mkdir -p external
cd external
git clone --depth 1 https://github.com/ethereum-optimism/docs.git
cd docs/create-l2-rollup-example
3.2 Environment file settings
cp .example.env .env
Modify minimal entries in .env:
L1_RPC_URLL1_BEACON_URLPRIVATE_KEY(key with 0x prefix removed)L2_CHAIN_ID(e.g. 42069)
3.3 Deployment and startup
make init
make setup
After success:
make up
4. Check latest image compatibility (important)
As of 2026-02, the following issues may occur depending on the version combination of the default docker-compose.yml.
op-nodefails to parse new fieldrollup.jsonop-gethends withinvalid eip-1559 params in extradata- The
op-nodeRPC port is9545, but services refer to8547.
If the following is reflected, it will operate stably.
4.1 Updated op-node/op-geth images
In docker-compose.yml:
op-nodeimage:.../op-node:latestop-gethimage:.../op-geth:latest
4.2 op-node RPC port matching
In docker-compose.yml:
op-nodeport mapping:8547:9545op-nodeexecution argument:--rpc.port=9545op-nodehealthcheck URL:http://localhost:9545propose/challenger--rollup-rpc=http://op-node:9545
Additionally, the file below was also modified to 8547 -> 9545:
batcher/.envOP_BATCHER_ROLLUP_RPCdispute-mon/.envROLLUP_RPC
4.3 Reflection of dispute-mon address variable
The root .env must contain the values ββbelow for dispute-mon to run without a restart loop.
ROLLUP_RPC=http://op-node:9545PROPOSER_ADDRESS=...CHALLENGER_ADDRESS=...GAME_FACTORY_ADDRESS=...
Values ββcan be found in dispute-mon/.env and deployer/.deployer/intent.toml.
4.4 Restart after volume initialization
docker-compose down -v
docker-compose up -d --wait
5. L2 execution verification
make status
make test-l1
make test-l2
Additional verification:
curl -s http://localhost:8545 \
-H 'content-type: application/json' \
--data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
curl -s http://localhost:8545 \
-H 'content-type: application/json' \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
expectation:
eth_chainId=0xa455(42069)eth_blockNumbervalue increases over time
6. SentinAI connection
The following is reflected in /Users/theo/workspace_tokamak/SentinAI/.env.local.
Core setup note:
- In Core mode, setup asks only
L2_RPC_URLand one AI key. - For OP Stack local monitoring, set the following env vars before running setup (or use Advanced mode):
CHAIN_TYPE=optimismL2_CHAIN_ID=<your-chain-id>ORCHESTRATOR_TYPE=dockerDOCKER_COMPOSE_FILE=<path-to-opstack-compose>
- If Docker mode is selected but compose file cannot be resolved, setup exits with a fail-fast error.
# L2 RPC
L2_RPC_URL=http://localhost:8545
CHAIN_TYPE=optimism
# Docker orchestrator
ORCHESTRATOR_TYPE=docker
DOCKER_COMPOSE_FILE=external/docs/create-l2-rollup-example/docker-compose.yml
DOCKER_COMPOSE_PROJECT=create-l2-rollup-example
# EOA (based on intent.toml)
BATCHER_EOA_ADDRESS=0x...
PROPOSER_EOA_ADDRESS=0x...
CHALLENGER_EOA_ADDRESS=0x...
# Recommended to disable proxyd path locally
L1_PROXYD_ENABLED=false
7. SentinAI connection verification
7.1 Running the server
cd /Users/theo/workspace_tokamak/SentinAI
npm run dev
7.2 Check Metric API
curl -s 'http://localhost:3002/api/metrics' | jq '{
status: .status,
blockHeight: .metrics.blockHeight,
errors: (.errors // [])
}'
expectation:
status: "healthy"blockHeightis not nullerrorsis empty
8. Frequently encountered problems
unknown field "minBaseFee"ordaFootprintGasScalar
- Cause:
op-nodeversion is out of date. - Action: Use
op-node:latest
invalid eip-1559 params in extradata
- Cause:
op-gethversion mismatch - Action: Use
op-geth:latestand thendown -v
op-nodeis running, butbatcher/proposerfails to connect toop-node:8547
- Cause: The latest
op-nodeinternal RPC port is9545. - Action: Unify all related
rollup-rpcvalues ββtoop-node:9545
dispute-monrestarts withinvalid address
- Cause: Address variable of root
.envnot set - action:
PROPOSER_ADDRESS,CHALLENGER_ADDRESS,GAME_FACTORY_ADDRESSμ€μ
9. Shutdown and cleanup
L2 stop:
cd /Users/theo/workspace_tokamak/SentinAI/external/docs/create-l2-rollup-example
docker-compose down
Remove up to volume:
docker-compose down -v
Exit SentinAI: Run Ctrl+C in terminal