--- 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:gravity/reth/gravity-alpha-sepolia-reth-pruned-trace.yml # # docker compose up -d # # curl -X POST https://${IP}.traefik.me/gravity-alpha-sepolia \ # -H "Content-Type: application/json" \ # --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' services: gravity-alpha-sepolia: image: ${GRAVITY_RETH_IMAGE:-ghcr.io/galxe/gravity-reth}:${GRAVITY_ALPHA_SEPOLIA_RETH_VERSION:-v0.2.0} 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: 0:0 ports: - 11338:11338 - 11338:11338/udp expose: - 8545 - 9001 - 8551 entrypoint: [reth, node] command: - --chain=gravity-alpha-sepolia - --datadir=/execution - --discovery.port=11338 - --engine.cross-block-cache-size=${GRAVITY_ALPHA-SEPOLIA_RETH_STATE_CACHE:-4096} - --engine.memory-block-buffer-target=1024 - --engine.persistence-threshold=0 - --full - --max-inbound-peers=50 - --max-outbound-peers=50 - --metrics=0.0.0.0:9001 - --nat=extip:${IP} - --port=11338 - --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 - --http - --http.addr=0.0.0.0 - --http.api=eth,net,web3,txpool,debug - --http.corsdomain=* - --http.port=8545 - --ws - --ws.addr=0.0.0.0 - --ws.api=eth,net,web3,txpool,debug - --ws.origins=* - --ws.port=8545 - --authrpc.addr=0.0.0.0 - --authrpc.jwtsecret=/jwtsecret restart: unless-stopped stop_grace_period: 5m networks: - chains volumes: - ${GRAVITY_ALPHA_SEPOLIA_RETH_PRUNED_TRACE_DATA:-gravity-alpha-sepolia-reth-pruned-trace}:/execution - .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.gravity-alpha-sepolia-reth-pruned-trace-stripprefix.stripprefix.prefixes=/gravity-alpha-sepolia - traefik.http.services.gravity-alpha-sepolia-reth-pruned-trace.loadbalancer.server.port=8545 - ${NO_SSL:-traefik.http.routers.gravity-alpha-sepolia-reth-pruned-trace.entrypoints=websecure} - ${NO_SSL:-traefik.http.routers.gravity-alpha-sepolia-reth-pruned-trace.tls.certresolver=myresolver} - ${NO_SSL:-traefik.http.routers.gravity-alpha-sepolia-reth-pruned-trace.rule=Host(`$DOMAIN`) && (Path(`/gravity-alpha-sepolia`) || Path(`/gravity-alpha-sepolia/`))} - ${NO_SSL:+traefik.http.routers.gravity-alpha-sepolia-reth-pruned-trace.rule=Path(`/gravity-alpha-sepolia`) || Path(`/gravity-alpha-sepolia/`)} - traefik.http.routers.gravity-alpha-sepolia-reth-pruned-trace.middlewares=gravity-alpha-sepolia-reth-pruned-trace-stripprefix, ipallowlist shm_size: 2gb gravity-alpha-sepolia-node: image: ${GRAVITY_APTOSBFT_IMAGE:-ghcr.io/galxe/gravity_node}:${GRAVITY_ALPHA_SEPOLIA_APTOSBFT_VERSION:-v1.10.0} user: 0:0 ports: - 16338:26180 - 16339:26181 - 9001:9001 environment: - GRAVITY_NETWORK=alpha-sepolia - IP=${IP} entrypoint: [/bin/bash, -c] command: - | # Generate or use existing consensus config if [ ! -f /config/public_full_node.yaml ]; then gravity-node init --config-dir /config --chain alpha-sepolia fi # Start the consensus node exec gravity-node run --config /config/public_full_node.yaml restart: unless-stopped stop_grace_period: 5m networks: - chains volumes: - ${GRAVITY_ALPHA_SEPOLIA_RETH_PRUNED_TRACE_CONSENSUS_DATA:-gravity-alpha-sepolia-reth-pruned-trace-consensus}:/data/consensus:rw - ./gravity/alpha-sepolia/genesis.blob:/config/genesis.blob:ro - ./gravity/alpha-sepolia/public_full_node.yaml:/config/public_full_node.yaml:ro - ./gravity/alpha-sepolia/waypoint.txt:/config/waypoint.txt:ro healthcheck: test: [CMD-SHELL, wget -qO- http://localhost:9001/health || exit 1] interval: 30s timeout: 10s retries: 3 start_period: 60s logging: *logging-defaults labels: - prometheus-scrape.enabled=true - prometheus-scrape.port=9001 volumes: gravity-alpha-sepolia-reth-pruned-trace: gravity-alpha-sepolia-reth-pruned-trace-consensus: x-upstreams: - id: $${ID} labels: provider: $${PROVIDER} connection: generic: rpc: url: $${RPC_URL} ws: frameSize: 20Mb msgSize: 50Mb url: $${WS_URL} chain: gravity-alpha-sepolia method-groups: enabled: - debug - filter - trace methods: disabled: enabled: - name: txpool_content # TODO: should be disabled for rollup nodes ...