--- 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:tac/tacchaind/tac-spb-tacchaind-pruned.yml # # docker compose up -d # # curl -X POST https://${IP}.traefik.me/tac-spb \ # -H "Content-Type: application/json" \ # --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' services: tac-spb: build: context: ./tac dockerfile: tacchaind.Dockerfile args: VERSION: ${TAC_SPB_TACCHAIND_VERSION:-v1.6.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) user: root ports: - 14331:14331 - 14331:14331/udp expose: - 26657 - 6065 environment: - API=eth,net,web3,txpool,debug - CHAIN_ID=tacchain_2391-1 - GENESIS_URL=https://raw.githubusercontent.com/TacBuild/tacchain/refs/heads/main/networks/tacchain_2391-1/genesis.json - IP=${IP} - MIN_GAS=25000000000utac - MONIKER=d${DOMAIN:-local} - P2P_PORT=14331 - PERSISTENT_PEERS=9c32b3b959a2427bd2aa064f8c9a8efebdad4c23@206.217.210.164:45130,04a2152eed9f73dc44779387a870ea6480c41fe7@206.217.210.164:45140,5aaaf8140262d7416ac53abe4e0bd13b0f582168@23.92.177.41:45110,ddb3e8b8f4d051e914686302dafc2a73adf9b0d2@23.92.177.41:45120 - STATESYNC_RPC=https://spb.tendermint.rpc.tac.build restart: unless-stopped stop_grace_period: 5m networks: - chains volumes: - ${TAC_SPB_TACCHAIND_PRUNED_DATA:-tac-spb-tacchaind-pruned}:/root/.tacchaind/data - /slowdisk:/slowdisk - tac-spb-tacchaind-pruned_config:/root/.tacchaind/config logging: *logging-defaults labels: - prometheus-scrape.enabled=true - prometheus-scrape.port=6065 - prometheus-scrape.path=/metrics - traefik.enable=true - traefik.http.middlewares.tac-spb-tacchaind-pruned-stripprefix.stripprefix.prefixes=/tac-spb - traefik.http.services.tac-spb-tacchaind-pruned.loadbalancer.server.port=26657 - ${NO_SSL:-traefik.http.routers.tac-spb-tacchaind-pruned.entrypoints=websecure} - ${NO_SSL:-traefik.http.routers.tac-spb-tacchaind-pruned.tls.certresolver=myresolver} - ${NO_SSL:-traefik.http.routers.tac-spb-tacchaind-pruned.rule=Host(`$DOMAIN`) && (Path(`/tac-spb`) || Path(`/tac-spb/`))} - ${NO_SSL:+traefik.http.routers.tac-spb-tacchaind-pruned.rule=Path(`/tac-spb`) || Path(`/tac-spb/`)} - traefik.http.routers.tac-spb-tacchaind-pruned.middlewares=tac-spb-tacchaind-pruned-stripprefix, ipallowlist - traefik.http.routers.tac-spb-tacchaind-pruned.priority=50 # gets any request that is not GET with UPGRADE header - traefik.http.routers.tac-spb-tacchaind-pruned-ws.priority=100 # answers GET requests first - traefik.http.middlewares.tac-spb-tacchaind-pruned-set-ws-path.replacepath.path=/websocket - traefik.http.services.tac-spb-tacchaind-pruned-ws.loadbalancer.server.port=26657 - traefik.http.routers.tac-spb-tacchaind-pruned-ws.service=tac-spb-tacchaind-pruned-ws - traefik.http.routers.tac-spb-tacchaind-pruned.service=tac-spb-tacchaind-pruned - ${NO_SSL:-traefik.http.routers.tac-spb-tacchaind-pruned-ws.entrypoints=websecure} - ${NO_SSL:-traefik.http.routers.tac-spb-tacchaind-pruned-ws.tls.certresolver=myresolver} # case-insensitive Upgrade: python websocket-client sends "WebSocket" (capital W) - ${NO_SSL:-traefik.http.routers.tac-spb-tacchaind-pruned-ws.rule=Host(`$DOMAIN`) && (Path(`/tac-spb`) || Path(`/tac-spb/`)) && HeadersRegexp(`Upgrade`, `(?i)websocket`)} - ${NO_SSL:+traefik.http.routers.tac-spb-tacchaind-pruned-ws.rule=(Path(`/tac-spb`) || Path(`/tac-spb/`)) && HeadersRegexp(`Upgrade`, `(?i)websocket`)} - traefik.http.routers.tac-spb-tacchaind-pruned-ws.middlewares=tac-spb-tacchaind-pruned-stripprefix, tac-spb-tacchaind-pruned-set-ws-path, ipallowlist volumes: tac-spb-tacchaind-pruned: tac-spb-tacchaind-pruned_config: x-upstreams: - id: $${ID} labels: provider: $${PROVIDER} connection: generic: rpc: url: $${RPC_URL} ws: frameSize: 20Mb msgSize: 50Mb url: $${WS_URL} chain: tac-spb method-groups: enabled: - debug - filter methods: disabled: enabled: - name: txpool_content # TODO: should be disabled for rollup nodes ...