From 11b1469983ed550bda95a4b67a943f1a34b34ad2 Mon Sep 17 00:00:00 2001 From: Joshua Gutow Date: Tue, 11 Feb 2025 09:02:58 -0500 Subject: [PATCH] Add instructions to run a Unichain Mainnet node --- .env.mainnet | 58 ++++++++++++++++++++++++++++++++++++++++++++++ .env.sepolia | 4 ++-- README.md | 10 ++++---- docker-compose.yml | 12 ++++++---- 4 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 .env.mainnet diff --git a/.env.mainnet b/.env.mainnet new file mode 100644 index 000000000..9881dfec9 --- /dev/null +++ b/.env.mainnet @@ -0,0 +1,58 @@ +# op-node configuration + +# [required] replace with your preferred L1 (Ethereum, not Unichain) node RPC URL: +OP_NODE_L1_ETH_RPC=https://ethereum-rpc.publicnode.com + +# [required] replace with your preferred L1 CL beacon endpoint: +OP_NODE_L1_BEACON=https://ethereum-beacon-api.publicnode.com + +OP_NODE_NETWORK=unichain-mainnet +OP_NODE_L2_ENGINE_AUTH=/shared/jwt.hex +OP_NODE_L2_ENGINE_RPC=ws://execution-client:8551 +OP_NODE_LOG_LEVEL=info +OP_NODE_LOG_FORMAT=logfmt +OP_NODE_METRICS_ADDR=0.0.0.0 +OP_NODE_METRICS_ENABLED=true +OP_NODE_METRICS_PORT=7300 +OP_NODE_P2P_LISTEN_IP=0.0.0.0 +OP_NODE_P2P_LISTEN_TCP_PORT=9222 +OP_NODE_P2P_LISTEN_UDP_PORT=9222 +OP_NODE_RPC_ADDR=0.0.0.0 +OP_NODE_RPC_PORT=9545 +OP_NODE_VERIFIER_L1_CONFS=4 +#OP_NODE_P2P_NAT=true +OP_NODE_P2P_DISCOVERY_PATH=/data/opnode_discovery_db +OP_NODE_P2P_PEERSTORE_PATH=/data/opnode_peerstore_db +OP_NODE_P2P_PRIV_PATH=/data/opnode_p2p_priv.txt + +# Execution Layer Sync +# op-node can drive the Execution Client to sync from the EL layer. This enables Snap Sync in op-geth or staged sync in op-reth. +# This requires the EL Client to be peered. +# By default, OP geth uses snap sync, but can use full sync (executes every block) while OP_NODE_SYNCMODE=execution-layer as well. +OP_NODE_SYNCMODE=execution-layer +GETH_SYNCMODE=snap + + +# op-geth configuration + +GETH_OP_NETWORK=unichain-mainnet +GETH_ROLLUP_SEQUENCERHTTP=https://mainnet-sequencer.unichain.org +GETH_LOG_FORMAT=logfmt +GETH_VERBOSITY=3 +GETH_DATADIR=/data +GETH_HTTP=true +GETH_HTTP_ADDR=0.0.0.0 +GETH_HTTP_VHOSTS="*" +GETH_HTTP_CORSDOMAIN="*" +GETH_HTTP_API=web3,debug,eth,txpool,net,admin,rpc +GETH_WS=true +GETH_WS_ADDR=0.0.0.0 +GETH_WS_API=web3,debug,eth,txpool,net,admin,rpc +GETH_AUTHRPC_JWTSECRET=/shared/jwt.hex +GETH_AUTHRPC_PORT=8551 +GETH_AUTHRPC_VHOSTS="*" +GETH_AUTHRPC_ADDR=0.0.0.0 +GETH_METRICS=true +GETH_METRICS_ADDR=0.0.0.0 +GETH_ROLLUP_DISABLETXPOOLGOSSIP=true +GETH_TXPOOL_NOLOCALS=true diff --git a/.env.sepolia b/.env.sepolia index b0405b825..7bb5e7686 100644 --- a/.env.sepolia +++ b/.env.sepolia @@ -1,10 +1,10 @@ # op-node configuration # [required] replace with your preferred L1 (Ethereum, not Unichain) node RPC URL: -OP_NODE_L1_ETH_RPC=https://rpc.sepolia.org +OP_NODE_L1_ETH_RPC=https://ethereum-sepolia-beacon-api.publicnode.com # [required] replace with your preferred L1 CL beacon endpoint: -OP_NODE_L1_BEACON=https://your.sepolia.beacon.node/endpoint-here +OP_NODE_L1_BEACON=https://ethereum-sepolia-rpc.publicnode.com OP_NODE_NETWORK=unichain-sepolia OP_NODE_L2_ENGINE_AUTH=/shared/jwt.hex diff --git a/README.md b/README.md index 6f85731d1..e48cc6d18 100644 --- a/README.md +++ b/README.md @@ -12,26 +12,28 @@ If you encounter problems with your node, please open a [GitHub issue](https://g | Network | Status | |-------------------| ------ | +| Mainnet | ✅ | | Testnet (Sepolia) | ✅ | ### Usage -1. Ensure you have an Ethereum L1 full node RPC available, and set `OP_NODE_L1_ETH_RPC` & `OP_NODE_L1_BEACON` (in the `.env.sepolia` file). If running your own L1 node, it needs to be synced before Unichain will be able to fully sync. -2. Run: +1. Ensure you have an Ethereum L1 full node RPC available, and set `OP_NODE_L1_ETH_RPC` & `OP_NODE_L1_BEACON` (in the `.env.mainnet` file). If running your own L1 node, it needs to be synced before Unichain will be able to fully sync. +2. Select your network in the docker compose file by uncommenting .env.sepolia or .env.mainnet in both op-node and the execution client. +3. Run: ``` docker compose up -d ``` -3. You should now be able to `curl` your Unichain node: +4. You should now be able to `curl` your Unichain node: ``` curl -d '{"id":1,"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false]}' \ -H "Content-Type: application/json" http://localhost:8545 ``` -4. To stop your node, run: +5. To stop your node, run: ``` docker compose down ``` diff --git a/docker-compose.yml b/docker-compose.yml index f99aabd56..0c259b02b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,10 +3,12 @@ volumes: services: execution-client: - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101411.3 + image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101500.0-rc.3 env_file: - .env - - .env.sepolia + # select your network here: +# - .env.sepolia +# - .env.mainnet ports: - 30303:30303/udp - 30303:30303/tcp @@ -25,10 +27,12 @@ services: entrypoint: /entrypoint.sh op-node: - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.10.1 + image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.11.0-rc.2 env_file: - .env - - .env.sepolia + # select your network here: +# - .env.sepolia +# - .env.mainnet ports: - 9222:9222/udp - 9222:9222/tcp