113 lines
6.0 KiB
YAML
113 lines
6.0 KiB
YAML
---
|
|
x-logging-defaults: &logging-defaults
|
|
driver: json-file
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
# 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:viction/node/viction-mainnet-node-pruned-leveldb-hash.yml
|
|
#
|
|
# docker compose up -d
|
|
#
|
|
# curl -X POST https://${IP}.traefik.me/viction-mainnet-node \
|
|
# -H "Content-Type: application/json" \
|
|
# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
|
|
|
|
services:
|
|
viction-mainnet-node:
|
|
image: ${VICTION_NODE_IMAGE:-buildonviction/node}:${VICTION_MAINNET_NODE_VERSION:-v2.5.1}
|
|
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:
|
|
- 14670:14670
|
|
- 14670:14670/udp
|
|
expose:
|
|
- 8545
|
|
- 8546
|
|
environment:
|
|
BOOTNODES: enode://98b06c30c631ab869c25b4836684b3de632ec7db60db34920095f8039cd49076913a64565dc4d8a06569bd84afa9553b95590ba3dd86263e3b9b5657463693a7@162.19.43.250:30301,enode://4c075010c7c1199240aea58a4e570b13af374a4aa2ed0219360c6017da34ca644706426ab2c75f1da00552ef4a40245ba043854d20e7c1873306023b6790bf03@15.235.228.11:30301,enode://477afcdf9581d0f38f00b2d0376bb536a3c71b13fcfa3d6039efb19c57a69e389b819efeb516609fe3eb3c90a8ffe620e62abaf481de6b07b873cad543a635fb@162.19.103.252:30301,enode://fd3da177f9492a39d1e7ce036b05745512894df251399cb3ec565081cb8c6dfa1092af8fac27991e66b6af47e9cb42e02420cc89f8549de0ce513ee25ebffc3a@3.212.20.0:30303,enode://97f0ca95a653e3c44d5df2674e19e9324ea4bf4d47a46b1d8560f3ed4ea328f725acec3fcfcb37eb11706cf07da669e9688b091f1543f89b2425700a68bc8876@104.248.98.78:30301,enode://b72927f349f3a27b789d0ca615ffe3526f361665b496c80e7cc19dace78bd94785fdadc270054ab727dbb172d9e3113694600dd31b2558dd77ad85a869032dea@188.166.207.189:30301,enode://c8f2f0643527d4efffb8cb10ef9b6da4310c5ac9f2e988a7f85363e81d42f1793f64a9aa127dbaff56b1e8011f90fe9ff57fa02a36f73220da5ff81d8b8df351@104.248.98.60:30301
|
|
EXTIP: ${IP}
|
|
NETWORK_ID: 88
|
|
P2P_PORT: 14670
|
|
command: --tomox --tomox.datadir /tomochain/data/tomox --gcmode full --rpcapi eth,debug,net,db,admin,web3
|
|
restart: unless-stopped
|
|
stop_grace_period: 5m
|
|
networks:
|
|
- chains
|
|
volumes:
|
|
- ${VICTION_MAINNET_NODE_PRUNED_LEVELDB_HASH_DATA:-viction-mainnet-node-pruned-leveldb-hash}:/tomochain/data
|
|
- /slowdisk:/slowdisk
|
|
logging: *logging-defaults
|
|
labels:
|
|
- prometheus-scrape.enabled=false
|
|
- traefik.enable=true
|
|
- traefik.http.middlewares.viction-mainnet-node-pruned-leveldb-hash-stripprefix.stripprefix.prefixes=/viction-mainnet-node
|
|
- traefik.http.services.viction-mainnet-node-pruned-leveldb-hash.loadbalancer.server.port=8545
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash.entrypoints=websecure}
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash.tls.certresolver=myresolver}
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash.rule=Host(`$DOMAIN`) && (Path(`/viction-mainnet-node`) || Path(`/viction-mainnet-node/`))}
|
|
- ${NO_SSL:+traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash.rule=Path(`/viction-mainnet-node`) || Path(`/viction-mainnet-node/`)}
|
|
- traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash.middlewares=viction-mainnet-node-pruned-leveldb-hash-stripprefix, ipallowlist
|
|
- traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash.priority=50 # gets any request that is not GET with UPGRADE header
|
|
- traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash-ws.priority=100 # answers GET requests first
|
|
- traefik.http.services.viction-mainnet-node-pruned-leveldb-hash-ws.loadbalancer.server.port=8546
|
|
- traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash-ws.service=viction-mainnet-node-pruned-leveldb-hash-ws
|
|
- traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash.service=viction-mainnet-node-pruned-leveldb-hash
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash-ws.entrypoints=websecure}
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash-ws.tls.certresolver=myresolver}
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash-ws.rule=Host(`$DOMAIN`) && (Path(`/viction-mainnet-node`) || Path(`/viction-mainnet-node/`)) && Headers(`Upgrade`, `websocket`)}
|
|
- ${NO_SSL:+traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash-ws.rule=(Path(`/viction-mainnet-node`) || Path(`/viction-mainnet-node/`)) && Headers(`Upgrade`, `websocket`)}
|
|
- traefik.http.routers.viction-mainnet-node-pruned-leveldb-hash-ws.middlewares=viction-mainnet-node-pruned-leveldb-hash-stripprefix, ipallowlist
|
|
|
|
volumes:
|
|
viction-mainnet-node-pruned-leveldb-hash:
|
|
|
|
x-upstreams:
|
|
- id: $${ID}
|
|
labels:
|
|
provider: $${PROVIDER}
|
|
connection:
|
|
generic:
|
|
rpc:
|
|
url: $${RPC_URL}
|
|
ws:
|
|
frameSize: 20Mb
|
|
msgSize: 50Mb
|
|
url: $${WS_URL}
|
|
chain: viction
|
|
method-groups:
|
|
enabled:
|
|
- debug
|
|
- filter
|
|
methods:
|
|
disabled:
|
|
enabled:
|
|
- name: txpool_content # TODO: should be disabled for rollup nodes
|
|
... |