--- x-logging-defaults: &logging-defaults driver: json-file options: max-size: "512m" max-file: "2" # Usage: # # mkdir rpc && cd rpc # # git init # git remote add origin https://github.com/StakeSquid/ethereum-rpc-docker.git # git fetch origin vibe # git checkout origin/vibe # # docker run --rm alpine sh -c "printf '0x'; head -c32 /dev/urandom | xxd -p -c 64" > .jwtsecret # # env # ... # IP=$(curl ipinfo.io/ip) # DOMAIN=${IP}.traefik.me # COMPOSE_FILE=base.yml:rpc.yml:op/reth/hashkeychain-mainnet-op-reth-pruned-trace--kona.yml # # docker compose up -d # # curl -X POST https://${IP}.traefik.me/hashkeychain-mainnet-op-reth-pruned \ # -H "Content-Type: application/json" \ # --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' services: hashkeychain-mainnet-op-reth-pruned-init: image: alpine:3.21 user: root entrypoint: [/bin/sh, -c] command: - | apk add --no-cache curl wget mkdir -p /config [ -f /config/genesis.json ] || curl -fsSL -o /config/genesis.json "https://hashkeychain.s3.ap-southeast-1.amazonaws.com/mainnet/genesis.json" printf '%s\n' '["enode://5ecd6d2054a58fa00729b73396044a35e6aceeafe58373d2f26b3f50a3934175fb56f8efa538381430889771613beaabf1177805910bbd34e4b4840320914690@mainnet-bootnodes.hsk.xyz:30615", "enode://bd244da2a066e15f82d4bfb7f2732c5b5bac44cefb36cefef01a4c0e87e72b42004d012c9a294b8402ebf67491777f280ffbcc93a71157921d6d358b19ddac67@mainnet-bootnodes.hsk.xyz:30616", "enode://a5bba6459ac3a075a4a8941478a4ef8d167460191c89632004b17e4b2d7beea52cdc1a2d376f35e996ad44ccac8db25f900700aad6991d015bdc4db072832063@mainnet-bootnodes.hsk.xyz:30617"]' > /config/static-nodes.json restart: no networks: - chains volumes: - ${HASHKEYCHAIN_MAINNET_OP_RETH_PRUNED_TRACE_CONFIG:-hashkeychain-mainnet-op-reth-pruned-trace_config}:/config logging: *logging-defaults hashkeychain-mainnet-op-reth-pruned: image: ${HASHKEYCHAIN_RETH_IMAGE:-us-docker.pkg.dev/oplabs-tools-artifacts/images/op-reth}:${HASHKEYCHAIN_MAINNET_RETH_VERSION:-v2.3.3} sysctls: # TCP Performance net.ipv4.tcp_slow_start_after_idle: 0 # Disable slow start after idle net.ipv4.tcp_no_metrics_save: 1 # Disable metrics cache net.ipv4.tcp_rmem: 4096 87380 16777216 # Increase TCP read buffers net.ipv4.tcp_wmem: 4096 87380 16777216 # Increase TCP write buffers net.core.somaxconn: 32768 # Higher connection queue # Memory/Connection Management # net.core.netdev_max_backlog: 50000 # Increase network buffer net.ipv4.tcp_max_syn_backlog: 30000 # More SYN requests net.ipv4.tcp_max_tw_buckets: 2000000 # Allow more TIME_WAIT sockets ulimits: nofile: 1048576 # Max open files (for RPC/WS connections) memlock: -1 # Disable memory locking limits (for in-memory DBs like MDBX) user: root ports: - 12151:12151 - 12151:12151/udp expose: - 8545 - 9001 - 8551 entrypoint: [op-reth, node] command: - --bootnodes=enode://5ecd6d2054a58fa00729b73396044a35e6aceeafe58373d2f26b3f50a3934175fb56f8efa538381430889771613beaabf1177805910bbd34e4b4840320914690@mainnet-bootnodes.hsk.xyz:30615,enode://bd244da2a066e15f82d4bfb7f2732c5b5bac44cefb36cefef01a4c0e87e72b42004d012c9a294b8402ebf67491777f280ffbcc93a71157921d6d358b19ddac67@mainnet-bootnodes.hsk.xyz:30616,enode://a5bba6459ac3a075a4a8941478a4ef8d167460191c89632004b17e4b2d7beea52cdc1a2d376f35e996ad44ccac8db25f900700aad6991d015bdc4db072832063@mainnet-bootnodes.hsk.xyz:30617 - --chain=/config/genesis.json - --datadir=/root/.local/share/reth - --discovery.addr=0.0.0.0 - --discovery.port=12151 - --discovery.v5.addr=0.0.0.0 - --discovery.v5.port=12151 - --engine.cross-block-cache-size=${HASHKEYCHAIN_MAINNET_RETH_STATE_CACHE:-4096} - --full - --max-inbound-peers=50 - --max-outbound-peers=50 - --metrics=0.0.0.0:9001 - --nat=extip:${IP} - --port=12151 - --rollup.sequencer-http=https://mainnet.hsk.xyz - --rpc-cache.max-blocks=10000 - --rpc-cache.max-concurrent-db-requests=2048 - --rpc.gascap=600000000 - --rpc.max-blocks-per-filter=0 - --rpc.max-connections=50000 - --rpc.max-logs-per-response=0 - --rpc.max-trace-filter-blocks=10000 - --http - --http.addr=0.0.0.0 - --http.api=admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,mev - --http.corsdomain=* - --http.port=8545 - --ws - --ws.addr=0.0.0.0 - --ws.api=admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,mev - --ws.origins=* - --ws.port=8545 - --authrpc.addr=0.0.0.0 - --authrpc.jwtsecret=/jwtsecret restart: unless-stopped stop_grace_period: 5m depends_on: hashkeychain-mainnet-op-reth-pruned-init: condition: service_completed_successfully networks: - chains volumes: - ${HASHKEYCHAIN_MAINNET_OP_RETH_PRUNED_TRACE_CONFIG:-hashkeychain-mainnet-op-reth-pruned-trace_config}:/config - ${HASHKEYCHAIN_MAINNET_OP_RETH_PRUNED_TRACE_DATA:-hashkeychain-mainnet-op-reth-pruned-trace}:/root/.local/share/reth - .jwtsecret:/jwtsecret:ro - /slowdisk:/slowdisk logging: *logging-defaults labels: - prometheus-scrape.enabled=true - prometheus-scrape.port=9001 - prometheus-scrape.path=/metrics - traefik.enable=true - traefik.http.middlewares.hashkeychain-mainnet-op-reth-pruned-trace-stripprefix.stripprefix.prefixes=/hashkeychain-mainnet-op-reth-pruned - traefik.http.services.hashkeychain-mainnet-op-reth-pruned-trace.loadbalancer.server.port=8545 - ${NO_SSL:-traefik.http.routers.hashkeychain-mainnet-op-reth-pruned-trace.entrypoints=websecure} - ${NO_SSL:-traefik.http.routers.hashkeychain-mainnet-op-reth-pruned-trace.tls.certresolver=myresolver} - ${NO_SSL:-traefik.http.routers.hashkeychain-mainnet-op-reth-pruned-trace.rule=Host(`$DOMAIN`) && (Path(`/hashkeychain-mainnet-op-reth-pruned`) || Path(`/hashkeychain-mainnet-op-reth-pruned/`))} - ${NO_SSL:+traefik.http.routers.hashkeychain-mainnet-op-reth-pruned-trace.rule=Path(`/hashkeychain-mainnet-op-reth-pruned`) || Path(`/hashkeychain-mainnet-op-reth-pruned/`)} - traefik.http.routers.hashkeychain-mainnet-op-reth-pruned-trace.middlewares=hashkeychain-mainnet-op-reth-pruned-trace-stripprefix, ipallowlist shm_size: 2gb hashkeychain-mainnet-op-reth-pruned-node: image: ${HASHKEYCHAIN_KONA_IMAGE:-us-docker.pkg.dev/oplabs-tools-artifacts/images/kona-node}:${HASHKEYCHAIN_MAINNET_KONA_VERSION:-v1.6.2} ports: - 17151:17151 - 17151:17151/udp environment: - KONA_METRICS_ADDR=0.0.0.0 - KONA_NODE_L1_BEACON=${ETHEREUM_MAINNET_BEACON_REST} - KONA_NODE_L1_ETH_RPC=${HASHKEYCHAIN_MAINNET_L1_EXECUTION_RPC:-${ETHEREUM_MAINNET_EXECUTION_RPC}} - KONA_NODE_L1_TRUST_RPC=${ETHEREUM_MAINNET_EXECUTION_TRUST:-false} - KONA_NODE_L2_CHAIN_ID=177 - KONA_NODE_L2_ENGINE_AUTH=/jwtsecret - KONA_NODE_L2_ENGINE_RPC=http://hashkeychain-mainnet-op-reth-pruned:8551 - KONA_NODE_L2_ENGINE_TIMEOUT=120000 - KONA_NODE_L2_TRUST_RPC=true - KONA_NODE_METRICS_PORT=7300 - KONA_NODE_MODE=Validator - KONA_NODE_P2P_ADVERTISE_IP=${IP} - KONA_NODE_P2P_LISTEN_IP=0.0.0.0 - KONA_NODE_P2P_LISTEN_TCP_PORT=17151 - KONA_NODE_P2P_LISTEN_UDP_PORT=17151 - KONA_NODE_RPC_ADDR=0.0.0.0 - KONA_NODE_RPC_PORT=9545 - OP_NODE_SYNCMODE=execution-layer entrypoint: [kona-node, node] restart: unless-stopped depends_on: hashkeychain-mainnet-op-reth-pruned: condition: service_started restart: true networks: - chains volumes: - .jwtsecret:/jwtsecret:ro logging: *logging-defaults labels: - prometheus-scrape.enabled=true - prometheus-scrape.port=7300 - prometheus-scrape.path=/metrics - traefik.enable=true - traefik.http.middlewares.hashkeychain-mainnet-op-reth-pruned-trace-node-stripprefix.stripprefix.prefixes=/hashkeychain-mainnet-op-reth-pruned/node - traefik.http.services.hashkeychain-mainnet-op-reth-pruned-trace-node.loadbalancer.server.port=9545 - ${NO_SSL:-traefik.http.routers.hashkeychain-mainnet-op-reth-pruned-trace-node.entrypoints=websecure} - ${NO_SSL:-traefik.http.routers.hashkeychain-mainnet-op-reth-pruned-trace-node.tls.certresolver=myresolver} - ${NO_SSL:-traefik.http.routers.hashkeychain-mainnet-op-reth-pruned-trace-node.rule=Host(`$DOMAIN`) && PathPrefix(`/hashkeychain-mainnet-op-reth-pruned/node`)} - ${NO_SSL:+traefik.http.routers.hashkeychain-mainnet-op-reth-pruned-trace-node.rule=PathPrefix(`/hashkeychain-mainnet-op-reth-pruned/node`)} - traefik.http.routers.hashkeychain-mainnet-op-reth-pruned-trace-node.middlewares=hashkeychain-mainnet-op-reth-pruned-trace-node-stripprefix, ipallowlist volumes: hashkeychain-mainnet-op-reth-pruned-trace: hashkeychain-mainnet-op-reth-pruned-trace_config: x-ephemeral-volumes: - hashkeychain-mainnet-op-reth-pruned-trace_config x-upstreams: - id: $${ID} labels: provider: $${PROVIDER} connection: generic: rpc: url: $${RPC_URL} ws: frameSize: 20Mb msgSize: 50Mb url: $${WS_URL} chain: hashkey method-groups: enabled: - debug - filter - trace methods: disabled: - name: eth_maxPriorityFeePerGas enabled: - name: txpool_content # TODO: should be disabled for rollup nodes ...