diff --git a/.env.mainnet b/.env.mainnet index f599d5dc..edf63ada 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -1,57 +1,98 @@ +# BASE MAINNET NODE CONFIGURATION +# =========================== + +# NETWORK CONFIGURATION +# -------------------- RETH_CHAIN=base +OP_NODE_NETWORK=base-mainnet +OP_GETH_OP_NETWORK=base-mainnet + +# BASE SEQUENCER ENDPOINTS +# ----------------------- RETH_SEQUENCER_HTTP=https://mainnet-sequencer.base.org -OP_GETH_SEQUENCER_HTTP=https://mainnet-sequencer.base.org OP_SEQUENCER_HTTP=https://mainnet-sequencer.base.org +OP_GETH_SEQUENCER_HTTP=https://mainnet-sequencer.base.org +OP_RETH_SEQUENCER_HTTP=https://mainnet-sequencer.base.org -# [optional] used to enable geth stats: -# OP_GETH_ETH_STATS=nodename:secret@host:port -# OP_NETHERMIND_ETHSTATS_ENABLED=true -# OP_NETHERMIND_ETHSTATS_NODE_NAME=NethermindNode -# OP_NETHERMIND_ETHSTATS_ENDPOINT=ethstats_endpoint - -# [required] replace with your preferred L1 (Ethereum, not Base) node RPC URL: -OP_NODE_L1_ETH_RPC=https://1rpc.io/eth - -# [optional] replace this with your preferred L2 engine kind (geth, reth, etc.) -# For more info: https://docs.optimism.io/operators/node-operators/configuration/consensus-config#l2enginekind -# OP_NODE_L2_ENGINE_KIND=reth +# SYNC CONFIGURATION +# ----------------- +OP_NODE_SYNCMODE=execution-layer +OP_NODE_VERIFIER_L1_CONFS=4 +OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true -# [required] replace with your preferred L1 CL beacon endpoint: -OP_NODE_L1_BEACON=https://your.mainnet.beacon.node/endpoint-here +# [REQUIRED] L1 CONFIGURATION +# -------------------------- +# Replace these values with your L1 (Ethereum) node endpoints +OP_NODE_L1_ETH_RPC= +OP_NODE_L1_BEACON= +OP_NODE_L1_BEACON_ARCHIVER= +OP_NODE_L1_BEACON_FETCH_ALL_SIDECARS="true" +OP_NODE_L1_RPC_KIND="debug_geth" +OP_NODE_L1_TRUST_RPC="false" -# auth secret used by op-geth engine API: +# ENGINE CONFIGURATION +# ------------------- +OP_NODE_L2_ENGINE_KIND=reth +OP_NODE_L2_ENGINE_RPC=ws://execution:8551 +OP_NODE_L2_ENGINE_AUTH=/tmp/engine-auth-jwt OP_NODE_L2_ENGINE_AUTH_RAW=688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a -OP_NODE_L2_ENGINE_AUTH=/tmp/engine-auth-jwt -OP_NODE_L2_ENGINE_RPC=ws://execution:8551 -OP_NODE_LOG_LEVEL=info -OP_NODE_METRICS_ADDR=0.0.0.0 -OP_NODE_METRICS_ENABLED=true -OP_NODE_METRICS_PORT=7300 -OP_NODE_NETWORK=base-mainnet +# P2P CONFIGURATION +# --------------- OP_NODE_P2P_AGENT=base -OP_NODE_P2P_BOOTNODES=enr:-J24QNz9lbrKbN4iSmmjtnr7SjUMk4zB7f1krHZcTZx-JRKZd0kA2gjufUROD6T3sOWDVDnFJRvqBBo62zuF-hYCohOGAYiOoEyEgmlkgnY0gmlwhAPniryHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQKNVFlCxh_B-716tTs-h1vMzZkSs1FTu_OYTNjgufplG4N0Y3CCJAaDdWRwgiQG,enr:-J24QH-f1wt99sfpHy4c0QJM-NfmsIfmlLAMMcgZCUEgKG_BBYFc6FwYgaMJMQN5dsRBJApIok0jFn-9CS842lGpLmqGAYiOoDRAgmlkgnY0gmlwhLhIgb2Hb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJ9FTIv8B9myn1MWaC_2lJ-sMoeCDkusCsk4BYHjjCq04N0Y3CCJAaDdWRwgiQG,enr:-J24QDXyyxvQYsd0yfsN0cRr1lZ1N11zGTplMNlW4xNEc7LkPXh0NAJ9iSOVdRO95GPYAIc6xmyoCCG6_0JxdL3a0zaGAYiOoAjFgmlkgnY0gmlwhAPckbGHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJwoS7tzwxqXSyFL7g0JM-KWVbgvjfB8JA__T7yY_cYboN0Y3CCJAaDdWRwgiQG,enr:-J24QHmGyBwUZXIcsGYMaUqGGSl4CFdx9Tozu-vQCn5bHIQbR7On7dZbU61vYvfrJr30t0iahSqhc64J46MnUO2JvQaGAYiOoCKKgmlkgnY0gmlwhAPnCzSHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQINc4fSijfbNIiGhcgvwjsjxVFJHUstK9L1T8OTKUjgloN0Y3CCJAaDdWRwgiQG,enr:-J24QG3ypT4xSu0gjb5PABCmVxZqBjVw9ca7pvsI8jl4KATYAnxBmfkaIuEqy9sKvDHKuNCsy57WwK9wTt2aQgcaDDyGAYiOoGAXgmlkgnY0gmlwhDbGmZaHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQIeAK_--tcLEiu7HvoUlbV52MspE0uCocsx1f_rYvRenIN0Y3CCJAaDdWRwgiQG 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_INTERNAL_IP="true" +OP_NODE_P2P_BOOTNODES=enr:-J24QNz9lbrKbN4iSmmjtnr7SjUMk4zB7f1krHZcTZx-JRKZd0kA2gjufUROD6T3sOWDVDnFJRvqBBo62zuF-hYCohOGAYiOoEyEgmlkgnY0gmlwhAPniryHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQKNVFlCxh_B-716tTs-h1vMzZkSs1FTu_OYTNjgufplG4N0Y3CCJAaDdWRwgiQG,enr:-J24QH-f1wt99sfpHy4c0QJM-NfmsIfmlLAMMcgZCUEgKG_BBYFc6FwYgaMJMQN5dsRBJApIok0jFn-9CS842lGpLmqGAYiOoDRAgmlkgnY0gmlwhLhIgb2Hb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJ9FTIv8B9myn1MWaC_2lJ-sMoeCDkusCsk4BYHjjCq04N0Y3CCJAaDdWRwgiQG,enr:-J24QDXyyxvQYsd0yfsN0cRr1lZ1N11zGTplMNlW4xNEc7LkPXh0NAJ9iSOVdRO95GPYAIc6xmyoCCG6_0JxdL3a0zaGAYiOoAjFgmlkgnY0gmlwhAPckbGHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJwoS7tzwxqXSyFL7g0JM-KWVbgvjfB8JA__T7yY_cYboN0Y3CCJAaDdWRwgiQG,enr:-J24QHmGyBwUZXIcsGYMaUqGGSl4CFdx9Tozu-vQCn5bHIQbR7On7dZbU61vYvfrJr30t0iahSqhc64J46MnUO2JvQaGAYiOoCKKgmlkgnY0gmlwhAPnCzSHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQINc4fSijfbNIiGhcgvwjsjxVFJHUstK9L1T8OTKUjgloN0Y3CCJAaDdWRwgiQG,enr:-J24QG3ypT4xSu0gjb5PABCmVxZqBjVw9ca7pvsI8jl4KATYAnxBmfkaIuEqy9sKvDHKuNCsy57WwK9wTt2aQgcaDDyGAYiOoGAXgmlkgnY0gmlwhDbGmZaHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQIeAK_--tcLEiu7HvoUlbV52MspE0uCocsx1f_rYvRenIN0Y3CCJAaDdWRwgiQG + +# RETH CONFIGURATION +# ---------------- +OP_RETH_DISABLE_DISCOVERY="false" +OP_RETH_DISABLE_TX_POOL_GOSSIP="true" +OP_RETH_OP_NETWORK="base" + +# RPC CONFIGURATION +# --------------- OP_NODE_RPC_ADDR=0.0.0.0 OP_NODE_RPC_PORT=8545 + +# GETH CACHE SETTINGS +# ----------------- +GETH_CACHE="20480" # 20GB +GETH_CACHE_DATABASE="20" # 4GB +GETH_CACHE_GC="12" +GETH_CACHE_SNAPSHOT="24" +GETH_CACHE_TRIE="44" +OP_GETH_NET_RESTRICT="10.0.0.0/8" + +# LOGGING & MONITORING +# ------------------ +OP_NODE_LOG_LEVEL=info +OP_NODE_LOG_FORMAT="json" OP_NODE_SNAPSHOT_LOG=/tmp/op-node-snapshot-log -OP_NODE_VERIFIER_L1_CONFS=4 -OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true +OP_NODE_METRICS_ENABLED="true" +OP_NODE_METRICS_ADDR=0.0.0.0 +OP_NODE_METRICS_PORT="7300" +STATSD_ADDRESS="172.17.0.1" + +# OPTIONAL SETTINGS +# =============== + +# ETHSTATS MONITORING (OPTIONAL - UNCOMMENT TO ENABLE) +# OP_GETH_ETH_STATS=nodename:secret@host:port +# OP_NETHERMIND_ETHSTATS_ENABLED=true +# OP_NETHERMIND_ETHSTATS_NODE_NAME=NethermindNode +# OP_NETHERMIND_ETHSTATS_ENDPOINT=ethstats_endpoint -# OP_NODE_L1_TRUST_RPC allows for faster syncing, but should be used *only* if your L1 RPC node -# is fully trusted. It also allows op-node to work with clients such as Erigon that do not -# support storage proofs: +# TRUSTED RPC MODE (OPTIONAL - UNCOMMENT TO ENABLE) # OP_NODE_L1_TRUST_RPC=true -# SNAP SYNC -# NOTE: This feature is experimental and may lead to syncing issues, delays or difficulties as a result of inability to find peers. We recommend running a full or archive node for production purposes. -# To enable snap sync, uncomment and set the env vars below: -# OP_NODE_SYNCMODE=execution-layer +# SNAP SYNC (OPTIONAL EXPERIMENTAL FEATURE - UNCOMMENT TO ENABLE) +# NOTE: This feature is experimental and may lead to syncing issues # OP_GETH_BOOTNODES=enode://87a32fd13bd596b2ffca97020e31aef4ddcc1bbd4b95bb633d16c1329f654f34049ed240a36b449fda5e5225d70fe40bc667f53c304b71f8e68fc9d448690b51@3.231.138.188:30301,enode://ca21ea8f176adb2e229ce2d700830c844af0ea941a1d8152a9513b966fe525e809c3a6c73a2c18a12b74ed6ec4380edf91662778fe0b79f6a591236e49e176f9@184.72.129.189:30301,enode://acf4507a211ba7c1e52cdf4eef62cdc3c32e7c9c47998954f7ba024026f9a6b2150cd3f0b734d9c78e507ab70d59ba61dfe5c45e1078c7ad0775fb251d7735a2@3.220.145.177:30301,enode://8a5a5006159bf079d06a04e5eceab2a1ce6e0f721875b2a9c96905336219dbe14203d38f70f3754686a6324f786c2f9852d8c0dd3adac2d080f4db35efc678c5@3.231.11.52:30301,enode://cdadbe835308ad3557f9a1de8db411da1a260a98f8421d62da90e71da66e55e98aaa8e90aa7ce01b408a54e4bd2253d701218081ded3dbe5efbbc7b41d7cef79@54.198.153.150:30301 # OP_NETHERMIND_BOOTNODES=enode://87a32fd13bd596b2ffca97020e31aef4ddcc1bbd4b95bb633d16c1329f654f34049ed240a36b449fda5e5225d70fe40bc667f53c304b71f8e68fc9d448690b51@3.231.138.188:30301,enode://ca21ea8f176adb2e229ce2d700830c844af0ea941a1d8152a9513b966fe525e809c3a6c73a2c18a12b74ed6ec4380edf91662778fe0b79f6a591236e49e176f9@184.72.129.189:30301,enode://acf4507a211ba7c1e52cdf4eef62cdc3c32e7c9c47998954f7ba024026f9a6b2150cd3f0b734d9c78e507ab70d59ba61dfe5c45e1078c7ad0775fb251d7735a2@3.220.145.177:30301,enode://8a5a5006159bf079d06a04e5eceab2a1ce6e0f721875b2a9c96905336219dbe14203d38f70f3754686a6324f786c2f9852d8c0dd3adac2d080f4db35efc678c5@3.231.11.52:30301,enode://cdadbe835308ad3557f9a1de8db411da1a260a98f8421d62da90e71da66e55e98aaa8e90aa7ce01b408a54e4bd2253d701218081ded3dbe5efbbc7b41d7cef79@54.198.153.150:30301 # OP_GETH_SYNCMODE=snap -# For Flashblocks node -# RETH_FB_WEBSOCKET_URL=wss://mainnet.flashblocks.base.org/ws \ No newline at end of file +# FLASHBLOCKS (OPTIONAL - UNCOMMENT TO ENABLE) +# RETH_FB_WEBSOCKET_URL=wss://mainnet.flashblocks.base.org/ws diff --git a/.env.sepolia b/.env.sepolia index 22db6a69..510ef291 100644 --- a/.env.sepolia +++ b/.env.sepolia @@ -1,53 +1,98 @@ +# BASE SEPOLIA TESTNET NODE CONFIGURATION +# ================================== + +# NETWORK CONFIGURATION +# -------------------- RETH_CHAIN=base-sepolia +OP_NODE_NETWORK=base-sepolia +OP_GETH_OP_NETWORK=base-sepolia + +# BASE SEQUENCER ENDPOINTS +# ----------------------- RETH_SEQUENCER_HTTP=https://sepolia-sequencer.base.org -OP_GETH_SEQUENCER_HTTP=https://sepolia-sequencer.base.org OP_SEQUENCER_HTTP=https://sepolia-sequencer.base.org +OP_GETH_SEQUENCER_HTTP=https://sepolia-sequencer.base.org +OP_RETH_SEQUENCER_HTTP=https://sepolia-sequencer.base.org -# [optional] used to enable geth stats: -# OP_GETH_ETH_STATS=nodename:secret@host:port -# OP_NETHERMIND_ETHSTATS_ENABLED=true -# OP_NETHERMIND_ETHSTATS_NODE_NAME=NethermindNode -# OP_NETHERMIND_ETHSTATS_ENDPOINT=ethstats_endpoint - -# [required] replace with your preferred L1 (Ethereum, not Base) node RPC URL: -OP_NODE_L1_ETH_RPC=https://rpc.sepolia.org +# SYNC CONFIGURATION +# ----------------- +OP_NODE_SYNCMODE=execution-layer +OP_NODE_VERIFIER_L1_CONFS=4 +OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true -# [required] replace with your preferred L1 CL beacon endpoint: -OP_NODE_L1_BEACON=https://your.sepolia.beacon.node/endpoint-here +# [REQUIRED] L1 CONFIGURATION +# -------------------------- +# Replace these values with your L1 (Ethereum) node endpoints +OP_NODE_L1_ETH_RPC= +OP_NODE_L1_BEACON= +OP_NODE_L1_BEACON_ARCHIVER= +OP_NODE_L1_BEACON_FETCH_ALL_SIDECARS="true" +OP_NODE_L1_RPC_KIND="debug_geth" +OP_NODE_L1_TRUST_RPC="false" -# auth secret used by op-geth engine API: +# ENGINE CONFIGURATION +# ------------------- +OP_NODE_L2_ENGINE_KIND=reth +OP_NODE_L2_ENGINE_RPC=ws://execution:8551 +OP_NODE_L2_ENGINE_AUTH=/tmp/engine-auth-jwt OP_NODE_L2_ENGINE_AUTH_RAW=688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a -OP_NODE_L2_ENGINE_AUTH=/tmp/engine-auth-jwt -OP_NODE_L2_ENGINE_RPC=ws://execution:8551 -OP_NODE_LOG_LEVEL=info -OP_NODE_METRICS_ADDR=0.0.0.0 -OP_NODE_METRICS_ENABLED=true -OP_NODE_METRICS_PORT=7300 -OP_NODE_NETWORK=base-sepolia +# P2P CONFIGURATION +# --------------- OP_NODE_P2P_AGENT=base -OP_NODE_P2P_BOOTNODES=enr:-J64QBwRIWAco7lv6jImSOjPU_W266lHXzpAS5YOh7WmgTyBZkgLgOwo_mxKJq3wz2XRbsoBItbv1dCyjIoNq67mFguGAYrTxM42gmlkgnY0gmlwhBLSsHKHb3BzdGFja4S0lAUAiXNlY3AyNTZrMaEDmoWSi8hcsRpQf2eJsNUx-sqv6fH4btmo2HsAzZFAKnKDdGNwgiQGg3VkcIIkBg,enr:-J64QFa3qMsONLGphfjEkeYyF6Jkil_jCuJmm7_a42ckZeUQGLVzrzstZNb1dgBp1GGx9bzImq5VxJLP-BaptZThGiWGAYrTytOvgmlkgnY0gmlwhGsV-zeHb3BzdGFja4S0lAUAiXNlY3AyNTZrMaEDahfSECTIS_cXyZ8IyNf4leANlZnrsMEWTkEYxf4GMCmDdGNwgiQGg3VkcIIkBg 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_INTERNAL_IP="true" +OP_NODE_P2P_BOOTNODES=enr:-J24QNz9lbrKbN4iSmmjtnr7SjUMk4zB7f1krHZcTZx-JRKZd0kA2gjufUROD6T3sOWDVDnFJRvqBBo62zuF-hYCohOGAYiOoEyEgmlkgnY0gmlwhAPniryHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQKNVFlCxh_B-716tTs-h1vMzZkSs1FTu_OYTNjgufplG4N0Y3CCJAaDdWRwgiQG,enr:-J24QH-f1wt99sfpHy4c0QJM-NfmsIfmlLAMMcgZCUEgKG_BBYFc6FwYgaMJMQN5dsRBJApIok0jFn-9CS842lGpLmqGAYiOoDRAgmlkgnY0gmlwhLhIgb2Hb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJ9FTIv8B9myn1MWaC_2lJ-sMoeCDkusCsk4BYHjjCq04N0Y3CCJAaDdWRwgiQG,enr:-J24QDXyyxvQYsd0yfsN0cRr1lZ1N11zGTplMNlW4xNEc7LkPXh0NAJ9iSOVdRO95GPYAIc6xmyoCCG6_0JxdL3a0zaGAYiOoAjFgmlkgnY0gmlwhAPckbGHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJwoS7tzwxqXSyFL7g0JM-KWVbgvjfB8JA__T7yY_cYboN0Y3CCJAaDdWRwgiQG,enr:-J24QHmGyBwUZXIcsGYMaUqGGSl4CFdx9Tozu-vQCn5bHIQbR7On7dZbU61vYvfrJr30t0iahSqhc64J46MnUO2JvQaGAYiOoCKKgmlkgnY0gmlwhAPnCzSHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQINc4fSijfbNIiGhcgvwjsjxVFJHUstK9L1T8OTKUjgloN0Y3CCJAaDdWRwgiQG,enr:-J24QG3ypT4xSu0gjb5PABCmVxZqBjVw9ca7pvsI8jl4KATYAnxBmfkaIuEqy9sKvDHKuNCsy57WwK9wTt2aQgcaDDyGAYiOoGAXgmlkgnY0gmlwhDbGmZaHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQIeAK_--tcLEiu7HvoUlbV52MspE0uCocsx1f_rYvRenIN0Y3CCJAaDdWRwgiQG + +# RETH CONFIGURATION +# ---------------- +OP_RETH_DISABLE_DISCOVERY="false" +OP_RETH_DISABLE_TX_POOL_GOSSIP="true" +OP_RETH_OP_NETWORK="base" + +# RPC CONFIGURATION +# --------------- OP_NODE_RPC_ADDR=0.0.0.0 OP_NODE_RPC_PORT=8545 + +# GETH CACHE SETTINGS +# ----------------- +GETH_CACHE="20480" # 20GB +GETH_CACHE_DATABASE="20" # 4GB +GETH_CACHE_GC="12" +GETH_CACHE_SNAPSHOT="24" +GETH_CACHE_TRIE="44" +OP_GETH_NET_RESTRICT="10.0.0.0/8" + +# LOGGING & MONITORING +# ------------------ +OP_NODE_LOG_LEVEL=info +OP_NODE_LOG_FORMAT="json" OP_NODE_SNAPSHOT_LOG=/tmp/op-node-snapshot-log -OP_NODE_VERIFIER_L1_CONFS=4 -OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true +OP_NODE_METRICS_ENABLED="true" +OP_NODE_METRICS_ADDR=0.0.0.0 +OP_NODE_METRICS_PORT="7300" +STATSD_ADDRESS="172.17.0.1" + +# OPTIONAL SETTINGS +# =============== + +# ETHSTATS MONITORING (OPTIONAL - UNCOMMENT TO ENABLE) +# OP_GETH_ETH_STATS=nodename:secret@host:port +# OP_NETHERMIND_ETHSTATS_ENABLED=true +# OP_NETHERMIND_ETHSTATS_NODE_NAME=NethermindNode +# OP_NETHERMIND_ETHSTATS_ENDPOINT=ethstats_endpoint -# OP_NODE_L1_TRUST_RPC allows for faster syncing, but should be used *only* if your L1 RPC node -# is fully trusted. It also allows op-node to work with clients such as Erigon that do not -# support storage proofs: +# TRUSTED RPC MODE (OPTIONAL - UNCOMMENT TO ENABLE) # OP_NODE_L1_TRUST_RPC=true -# SNAP SYNC -# NOTE: This feature is experimental and may lead to syncing issues, delays or difficulties as a result of inability to find peers. We recommend running a full or archive node for production purposes. -# To enable snap sync, set env vars below: -# OP_NODE_SYNCMODE=execution-layer -# OP_GETH_BOOTNODES=enode://548f715f3fc388a7c917ba644a2f16270f1ede48a5d88a4d14ea287cc916068363f3092e39936f1a3e7885198bef0e5af951f1d7b1041ce8ba4010917777e71f@18.210.176.114:30301,enode://6f10052847a966a725c9f4adf6716f9141155b99a0fb487fea3f51498f4c2a2cb8d534e680ee678f9447db85b93ff7c74562762c3714783a7233ac448603b25f@107.21.251.55:30301 -# OP_NETHERMIND_BOOTNODES=enode://548f715f3fc388a7c917ba644a2f16270f1ede48a5d88a4d14ea287cc916068363f3092e39936f1a3e7885198bef0e5af951f1d7b1041ce8ba4010917777e71f@18.210.176.114:30301,enode://6f10052847a966a725c9f4adf6716f9141155b99a0fb487fea3f51498f4c2a2cb8d534e680ee678f9447db85b93ff7c74562762c3714783a7233ac448603b25f@107.21.251.55:30301 +# SNAP SYNC (OPTIONAL EXPERIMENTAL FEATURE - UNCOMMENT TO ENABLE) +# NOTE: This feature is experimental and may lead to syncing issues +# OP_GETH_BOOTNODES=enode://87a32fd13bd596b2ffca97020e31aef4ddcc1bbd4b95bb633d16c1329f654f34049ed240a36b449fda5e5225d70fe40bc667f53c304b71f8e68fc9d448690b51@3.231.138.188:30301,enode://ca21ea8f176adb2e229ce2d700830c844af0ea941a1d8152a9513b966fe525e809c3a6c73a2c18a12b74ed6ec4380edf91662778fe0b79f6a591236e49e176f9@184.72.129.189:30301,enode://acf4507a211ba7c1e52cdf4eef62cdc3c32e7c9c47998954f7ba024026f9a6b2150cd3f0b734d9c78e507ab70d59ba61dfe5c45e1078c7ad0775fb251d7735a2@3.220.145.177:30301,enode://8a5a5006159bf079d06a04e5eceab2a1ce6e0f721875b2a9c96905336219dbe14203d38f70f3754686a6324f786c2f9852d8c0dd3adac2d080f4db35efc678c5@3.231.11.52:30301,enode://cdadbe835308ad3557f9a1de8db411da1a260a98f8421d62da90e71da66e55e98aaa8e90aa7ce01b408a54e4bd2253d701218081ded3dbe5efbbc7b41d7cef79@54.198.153.150:30301 +# OP_NETHERMIND_BOOTNODES=enode://87a32fd13bd596b2ffca97020e31aef4ddcc1bbd4b95bb633d16c1329f654f34049ed240a36b449fda5e5225d70fe40bc667f53c304b71f8e68fc9d448690b51@3.231.138.188:30301,enode://ca21ea8f176adb2e229ce2d700830c844af0ea941a1d8152a9513b966fe525e809c3a6c73a2c18a12b74ed6ec4380edf91662778fe0b79f6a591236e49e176f9@184.72.129.189:30301,enode://acf4507a211ba7c1e52cdf4eef62cdc3c32e7c9c47998954f7ba024026f9a6b2150cd3f0b734d9c78e507ab70d59ba61dfe5c45e1078c7ad0775fb251d7735a2@3.220.145.177:30301,enode://8a5a5006159bf079d06a04e5eceab2a1ce6e0f721875b2a9c96905336219dbe14203d38f70f3754686a6324f786c2f9852d8c0dd3adac2d080f4db35efc678c5@3.231.11.52:30301,enode://cdadbe835308ad3557f9a1de8db411da1a260a98f8421d62da90e71da66e55e98aaa8e90aa7ce01b408a54e4bd2253d701218081ded3dbe5efbbc7b41d7cef79@54.198.153.150:30301 # OP_GETH_SYNCMODE=snap -# For Flashblocks node +# FLASHBLOCKS (OPTIONAL - UNCOMMENT TO ENABLE) # RETH_FB_WEBSOCKET_URL=wss://sepolia.flashblocks.base.org/ws diff --git a/README.md b/README.md index 5e831f04..2901c71f 100644 --- a/README.md +++ b/README.md @@ -1,130 +1,144 @@ ![Base](logo.webp) -# Base node +# Base Node -Base is a secure, low-cost, developer-friendly Ethereum L2 built to bring the next billion users onchain. It's built on Optimism's open-source [OP Stack](https://stack.optimism.io/). - -This repository contains the relevant Docker builds to run your own node on the Base network. - - - -[![GitHub contributors](https://img.shields.io/github/contributors/base/node)](https://github.com/base/node/graphs/contributors) -[![GitHub commit activity](https://img.shields.io/github/commit-activity/w/base/node)](https://github.com/base/node/graphs/commit-activity) -[![GitHub Stars](https://img.shields.io/github/stars/base/node.svg)](https://github.com/base/node/stargazers) -![GitHub repo size](https://img.shields.io/github/repo-size/base/node) -[![GitHub](https://img.shields.io/github/license/base/node?color=blue)](https://github.com/base/node/blob/main/LICENSE) - - +Base is a secure, low-cost, developer-friendly Ethereum L2 built on Optimism's [OP Stack](https://stack.optimism.io/). This repository contains Docker builds to run your own node on the Base network. [![Website base.org](https://img.shields.io/website-up-down-green-red/https/base.org.svg)](https://base.org) -[![Blog](https://img.shields.io/badge/blog-up-green)](https://base.mirror.xyz/) [![Docs](https://img.shields.io/badge/docs-up-green)](https://docs.base.org/) [![Discord](https://img.shields.io/discord/1067165013397213286?label=discord)](https://base.org/discord) [![Twitter Base](https://img.shields.io/twitter/follow/Base?style=social)](https://x.com/Base) - +## Quick Start -[![GitHub pull requests by-label](https://img.shields.io/github/issues-pr-raw/base/node)](https://github.com/base/node/pulls) -[![GitHub Issues](https://img.shields.io/github/issues-raw/base/node.svg)](https://github.com/base/node/issues) +1. Ensure you have an Ethereum L1 full node RPC available +2. Choose your network: + - For mainnet: Use `.env.mainnet` + - For testnet: Use `.env.sepolia` +3. Configure your L1 endpoints in the appropriate `.env` file: + ```bash + OP_NODE_L1_ETH_RPC= + OP_NODE_L1_BEACON= + OP_NODE_L1_BEACON_ARCHIVER= + ``` +4. Start the node: -### Hardware requirements + ```bash + # For mainnet (default): + docker compose up --build -We recommend you have this hardware configuration to run a node: + # For testnet: + NETWORK_ENV=.env.sepolia docker compose up --build -- a modern multi-core CPU with good single-core performance -- at least 16 GB RAM (32 GB recommended) -- a locally attached NVMe SSD drive -- adequate storage capacity to accommodate both the snapshot restoration process (if restoring from snapshot) and chain data, ensuring a minimum of (2 \* current_chain_size) + snapshot_size + 20%\_buffer + # To use a specific client (optional): + CLIENT=reth docker compose up --build -**Note:** If utilizing Amazon Elastic Block Store (EBS), ensure timing buffered disk reads are fast enough in order to avoid latency issues alongside the rate of new blocks added to Base during the initial synchronization process; `io2 block express` is recommended. + # For testnet with a specific client: + NETWORK_ENV=.env.sepolia CLIENT=reth docker compose up --build + ``` -### Troubleshooting +### Supported Clients -If you encounter problems with your node, please open a [GitHub issue](https://github.com/base/node/issues/new/choose) or reach out on our [Discord](https://discord.gg/buildonbase): +- `geth` (default) +- `reth` +- `nethermind` -- Once you've joined, in the Discord app go to `server menu` > `Linked Roles` > `connect GitHub` and connect your GitHub account so you can gain access to our developer channels -- Report your issue in `#πŸ›Ÿ|developer-support` or `πŸ› ο½œnode-operators` +## Requirements -### Supported networks +### Minimum Requirements -| Base Network | Status | -|-------------------| ------ | -| Testnet (Sepolia) | βœ… | -| Mainnet | βœ… | +- Modern Multicore CPU +- 32GB RAM (64GB Recommended) +- NVMe SSD drive +- Storage: (2 \* [current chain size](https://base.org/stats) + [snapshot size](https://basechaindata.vercel.app) + 20% buffer (to accomodate future growth) +- Docker and Docker Compose -### Usage +### Production Hardware Specifications -1. Ensure you have an Ethereum L1 full node RPC available (not Base), and set `OP_NODE_L1_ETH_RPC` (in the `.env.*` file if using docker-compose). If running your own L1 node, it needs to be synced before Base will be able to fully sync. -2. Set the `NETWORK_ENV` environment variable to specify your network: - ```bash - # For mainnet: - export NETWORK_ENV=.env.mainnet - # For testnet: - export NETWORK_ENV=.env.sepolia - ``` -3. Run: +The following are the hardware specifications we use in production: -``` -docker compose up --build -``` +#### Geth Full Node -> [!NOTE] -> To run the node using a supported client, you can use the following command: -> `CLIENT=supported_client docker compose up --build` -> -> Supported clients: -> - geth -> - reth (with Flashblocks support option, see [Reth Node README](./reth/README.md)) -> - nethermind +- **Instance**: AWS i4i.12xlarge +- **Storage**: RAID 0 of all local NVMe drives (`/dev/nvme*`) +- **Filesystem**: ext4 -4. You should now be able to `curl` your Base node: +#### Reth Archive Node -``` -curl -d '{"id":0,"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false]}' \ - -H "Content-Type: application/json" http://localhost:8545 -``` +- **Instance**: AWS i7ie.6xlarge +- **Storage**: RAID 0 of all local NVMe drives (`/dev/nvme*`) +- **Filesystem**: ext4 -Note: Some L1 nodes (e.g. Erigon) do not support fetching storage proofs. You can work around this by specifying `--l1.trustrpc` when starting op-node (add it in `op-node-entrypoint` and rebuild the docker image with `docker compose build`.) Do not do this unless you fully trust the L1 node provider. +[!NOTE] +To run the node using a supported client, you can use the following command: +`CLIENT=supported_client docker compose up --build` + +Supported clients: + - geth + - reth (with Flashblocks support option, see [Reth Node README](./reth/README.md)) + - nethermind -#### Persisting Data +## Configuration -By default, the data directory is stored in `${PROJECT_ROOT}/geth-data`. You can override this by modifying the value of -`GETH_HOST_DATA_DIR` variable in the [`.env`](./.env) file. +### Required Settings -To load a [snapshot](#snapshots) you can extract the snapshot into the `$GETH_HOST_DATA_DIR` folder. +- L1 Configuration: + - `OP_NODE_L1_ETH_RPC`: Your Ethereum L1 node RPC endpoint + - `OP_NODE_L1_BEACON`: Your L1 beacon node endpoint + - `OP_NODE_L1_BEACON_ARCHIVER`: Your L1 beacon archiver endpoint + - `OP_NODE_L1_RPC_KIND`: The type of RPC provider being used (default: "debug_geth"). Supported values: + - `alchemy`: Alchemy RPC provider + - `quicknode`: QuickNode RPC provider + - `infura`: Infura RPC provider + - `parity`: Parity RPC provider + - `nethermind`: Nethermind RPC provider + - `debug_geth`: Debug Geth RPC provider + - `erigon`: Erigon RPC provider + - `basic`: Basic RPC provider (standard receipt fetching only) + - `any`: Any available RPC method + - `standard`: Standard RPC methods including newer optimized methods -#### Running in single container with `supervisord` +### Network Settings -If you'd like to run the node in a single container instead of `docker-compose`, you can use the `supervisord` entrypoint. -This is useful for running the node in a Kubernetes cluster, for example. +- Mainnet: + - `RETH_CHAIN=base` + - `OP_NODE_NETWORK=base-mainnet` + - Sequencer: `https://mainnet-sequencer.base.org` -Note that you'll need to override some of the default configuration that assumes a multi-container environment (`OP_NODE_L2_ENGINE_RPC`) and any port conflicts (`OP_NODE_RPC_PORT`). -Example: +### Performance Settings -``` -docker run --env-file .env.sepolia -e OP_NODE_L2_ENGINE_RPC=ws://localhost:8551 -e OP_NODE_RPC_PORT=7545 ghcr.io/base/node:latest -``` +- Cache Settings: + - `GETH_CACHE="20480"` (20GB) + - `GETH_CACHE_DATABASE="20"` (4GB) + - `GETH_CACHE_GC="12"` + - `GETH_CACHE_SNAPSHOT="24"` + - `GETH_CACHE_TRIE="44"` -### Snapshots +### Optional Features -You can fetch the latest snapshots via the URLs provided in the [Base docs](https://docs.base.org/guides/run-a-base-node/#snapshots). +- EthStats Monitoring (uncomment to enable) +- Trusted RPC Mode (uncomment to enable) +- Snap Sync (experimental) -### Syncing +For full configuration options, see the `.env.mainnet` file. -Sync speed depends on your L1 node, as the majority of the chain is derived from data submitted to the L1. You can check your syncing status using the `optimism_syncStatus` RPC on the `op-node` container. Example: +## Snapshots -``` -command -v jq &> /dev/null || { echo "jq is not installed" 1>&2 ; } -echo Latest synced block behind by: \ -$((($( date +%s )-\ -$( curl -s -d '{"id":0,"jsonrpc":"2.0","method":"optimism_syncStatus"}' -H "Content-Type: application/json" http://localhost:7545 | - jq -r .result.unsafe_l2.timestamp))/60)) minutes -``` +Snapshots are available to help you sync your node more quickly. See [docs.base.org](https://docs.base.org/chain/run-a-base-node#snapshots) for links and more details on how to restore from a snapshot. -## Disclaimer +## Supported Networks -We're excited for you to build on Base πŸ”΅ β€” but we want to make sure that you understand the nature of the node software and smart contracts offered here. +| Network | Status | +| ------- | ------ | +| Mainnet | βœ… | +| Testnet | βœ… | + +## Troubleshooting + +For support please join our [Discord](https://discord.gg/buildonbase) post in `πŸ› ο½œnode-operators`. You can alternatively open a new GitHub issue. + +## Disclaimer -THE NODE SOFTWARE AND SMART CONTRACTS CONTAINED HEREIN ARE FURNISHED AS IS, WHERE IS, WITH ALL FAULTS AND WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE. IN PARTICULAR, THERE IS NO REPRESENTATION OR WARRANTY THAT THE NODE SOFTWARE AND SMART CONTRACTS WILL PROTECT YOUR ASSETS β€” OR THE ASSETS OF THE USERS OF YOUR APPLICATION β€” FROM THEFT, HACKING, CYBER ATTACK, OR OTHER FORM OF LOSS OR DEVALUATION. +THE NODE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. We make no guarantees about asset protection or security. Usage is subject to applicable laws and regulations. -You also understand that using the node software and smart contracts are subject to applicable law, including without limitation, any applicable anti-money laundering laws, anti-terrorism laws, export control laws, end user restrictions, privacy laws, or economic sanctions laws/regulations. +For more information, visit [docs.base.org](https://docs.base.org/). diff --git a/docker-compose.yml b/docker-compose.yml index c98fce9a..b90222b0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,32 +2,32 @@ services: execution: build: context: . - dockerfile: ${CLIENT}/Dockerfile + dockerfile: ${CLIENT:-geth}/Dockerfile ports: - - "8545:8545" # RPC - - "8546:8546" # websocket - - "7301:6060" # metrics - - "30303:30303" # P2P TCP + - "8545:8545" # RPC + - "8546:8546" # websocket + - "7301:6060" # metrics + - "30303:30303" # P2P TCP - "30303:30303/udp" # P2P UDP - command: [ "bash", "./execution-entrypoint" ] + command: ["bash", "./execution-entrypoint"] volumes: - - ${HOST_DATA_DIR}:/data + - ${HOST_DATA_DIR}:/data environment: - NODE_TYPE=${NODE_TYPE:-vanilla} env_file: - - ${NETWORK_ENV:?.env.mainnet} # Requires NETWORK_ENV to be set, defaults to mainnet + - ${NETWORK_ENV:-.env.mainnet} # Use .env.mainnet by default, override with .env.sepolia for testnet node: build: context: . - dockerfile: ${CLIENT}/Dockerfile + dockerfile: ${CLIENT:-geth}/Dockerfile depends_on: - execution ports: - - "7545:8545" # RPC - - "9222:9222" # P2P TCP + - "7545:8545" # RPC + - "9222:9222" # P2P TCP - "9222:9222/udp" # P2P UDP - - "7300:7300" # metrics - - "6060:6060" # pprof - command: [ "bash", "./op-node-entrypoint" ] + - "7300:7300" # metrics + - "6060:6060" # pprof + command: ["bash", "./op-node-entrypoint"] env_file: - - ${NETWORK_ENV:?.env.mainnet} # Requires NETWORK_ENV to be set, defaults to mainnet + - ${NETWORK_ENV:-.env.mainnet} # Use .env.mainnet by default, override with .env.sepolia for testnet diff --git a/geth/geth-entrypoint b/geth/geth-entrypoint index eb4512dd..4674c673 100755 --- a/geth/geth-entrypoint +++ b/geth/geth-entrypoint @@ -13,6 +13,17 @@ ADDITIONAL_ARGS="" OP_GETH_GCMODE="${OP_GETH_GCMODE:-full}" OP_GETH_SYNCMODE="${OP_GETH_SYNCMODE:-full}" +# Add cache and txpool optimizations with defaults +GETH_CACHE="${GETH_CACHE:-20480}" +GETH_CACHE_DATABASE="${GETH_CACHE_DATABASE:-20}" +GETH_CACHE_GC="${GETH_CACHE_GC:-12}" +GETH_CACHE_SNAPSHOT="${GETH_CACHE_SNAPSHOT:-24}" +GETH_CACHE_TRIE="${GETH_CACHE_TRIE:-44}" +GETH_TXPOOL_GLOBALQUEUE="${GETH_TXPOOL_GLOBALQUEUE:-6144}" +GETH_TXPOOL_GLOBALSLOTS="${GETH_TXPOOL_GLOBALSLOTS:-30072}" +GETH_TXPOOL_LIFETIME="${GETH_TXPOOL_LIFETIME:-10m}" +TXPOOL_PRICE_LIMIT="${TXPOOL_PRICE_LIMIT:-50}" + if [[ -z "$OP_NODE_NETWORK" ]]; then echo "expected OP_NODE_NETWORK to be set" 1>&2 exit 1 @@ -39,7 +50,7 @@ if [ "${OP_GETH_BOOTNODES+x}" = x ]; then fi if [ "${HOST_IP:+x}" = x ]; then - ADDITIONAL_ARGS="$ADDITIONAL_ARGS --nat=extip:$HOST_IP" + ADDITIONAL_ARGS="$ADDITIONAL_ARGS --nat=extip:$HOST_IP" fi exec ./geth \ @@ -71,4 +82,9 @@ exec ./geth \ --op-network="$OP_NODE_NETWORK" \ --port="$P2P_PORT" \ --rollup.disabletxpoolgossip=true \ - $ADDITIONAL_ARGS # intentionally unquoted + --cache="$GETH_CACHE" \ + --cache.database="$GETH_CACHE_DATABASE" \ + --cache.gc="$GETH_CACHE_GC" \ + --cache.snapshot="$GETH_CACHE_SNAPSHOT" \ + --cache.trie="$GETH_CACHE_TRIE" \ + $ADDITIONAL_ARGS # intentionally unquoted \ No newline at end of file diff --git a/reth/reth-entrypoint b/reth/reth-entrypoint index 27dbec56..b6c32e47 100755 --- a/reth/reth-entrypoint +++ b/reth/reth-entrypoint @@ -1,6 +1,7 @@ #!/bin/bash set -eu +IPC_PATH="/data/reth.ipc" RETH_DATA_DIR=/data RPC_PORT="${RPC_PORT:-8545}" WS_PORT="${WS_PORT:-8546}" @@ -35,7 +36,7 @@ echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH" exec $BINARY node \ -vvv \ --datadir="$RETH_DATA_DIR" \ - --log.stdout.format log-fmt \ + --log.stdout.format json \ --ws \ --ws.origins="*" \ --ws.addr=0.0.0.0 \ @@ -45,11 +46,13 @@ exec $BINARY node \ --http.corsdomain="*" \ --http.addr=0.0.0.0 \ --http.port="$RPC_PORT" \ - --http.api=debug,eth,net,txpool \ + --http.api=debug,eth,net,txpool,miner \ + --ipcpath="$IPC_PATH" \ --authrpc.addr=0.0.0.0 \ --authrpc.port="$AUTHRPC_PORT" \ --authrpc.jwtsecret="$OP_NODE_L2_ENGINE_AUTH" \ --metrics=0.0.0.0:"$METRICS_PORT" \ + --max-outbound-peers=100 \ --chain "$RETH_CHAIN" \ --rollup.sequencer-http=$RETH_SEQUENCER_HTTP \ --rollup.disable-tx-pool-gossip \