Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions to run a Unichain Mainnet node #21

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .env.mainnet
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions .env.sepolia
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
12 changes: 8 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down