114 lines
6.2 KiB
YAML
114 lines
6.2 KiB
YAML
---
|
|
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:viction/node/viction-mainnet-node-archive-leveldb-hash.yml
|
|
#
|
|
# docker compose up -d
|
|
#
|
|
# curl -X POST https://${IP}.traefik.me/viction-mainnet-node-archive \
|
|
# -H "Content-Type: application/json" \
|
|
# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
|
|
|
|
services:
|
|
viction-mainnet-node-archive:
|
|
image: ${VICTION_NODE_IMAGE:-buildonviction/node}:${VICTION_MAINNET_NODE_VERSION:-v2.6.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:
|
|
- 13184:13184
|
|
- 13184:13184/udp
|
|
expose:
|
|
- 8545
|
|
- 8546
|
|
environment:
|
|
BOOTNODES: enode://7270ccd99b23605442ebe731848360b166e7a688e51242ae1f662b323961d314e54fb92e9cefc3dbd687ac80620416a781b9787685666a3f38f6f9708efe325c@162.19.43.250:11133,enode://98b06c30c631ab869c25b4836684b3de632ec7db60db34920095f8039cd49076913a64565dc4d8a06569bd84afa9553b95590ba3dd86263e3b9b5657463693a7@162.19.43.250:15133,enode://1985d8adc406d74969e511e621fc3eb6b9432273e61f5dfb0334d9944bc68cd65a05130b7367e31f662f0055dbb3693914154eb1dff63535818c329c436253d7@15.235.228.11:11133,enode://3d54f9596233d25d3ef762e859a0262af96d7c67a26b53870d6f88af9d036948018381e908dac964c93ca2e74405a9948071f261c56b8feb330158b5cbb4662b@15.235.228.11:15133,enode://cb7d3cfa345c727ba185963f63b823e4b84c4add66d82c9efaf002efdae00d3951c5a2f68ff5d7d2d1dd013fdae9532700148a59830062a5b68c32038ad4bfbe@51.77.4.223:30001,enode://6239b4e3aa982b0bacf8b0dffea4e8cb314f5539321c6419370cf6cd6998065d590a9bbcd49b5acbaaf407ae51fef0a8ccf550c770414e8111ac48eb2a8feb325c@57.128.235.169:30006,enode://ebfaf177ddadc34cacd7c36391272a3016d9369e0568aeb161e05d9d4bdcc2ad3c6544173034317423431742349c0b7ef4907613a2f7@148.113.49.199:30007
|
|
EXTIP: ${IP}
|
|
NETWORK_ID: 88
|
|
P2P_PORT: 13184
|
|
command: --tomox --tomox.datadir /tomochain/data/tomox --gcmode archive --rpcapi eth,debug,net,db,admin,web3
|
|
restart: unless-stopped
|
|
stop_grace_period: 5m
|
|
networks:
|
|
- chains
|
|
volumes:
|
|
- ${VICTION_MAINNET_NODE_ARCHIVE_LEVELDB_HASH_DATA:-viction-mainnet-node-archive-leveldb-hash}:/tomochain/data
|
|
- /slowdisk:/slowdisk
|
|
logging: *logging-defaults
|
|
labels:
|
|
- prometheus-scrape.enabled=false
|
|
- traefik.enable=true
|
|
- traefik.http.middlewares.viction-mainnet-node-archive-leveldb-hash-stripprefix.stripprefix.prefixes=/viction-mainnet-node-archive
|
|
- traefik.http.services.viction-mainnet-node-archive-leveldb-hash.loadbalancer.server.port=8545
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-archive-leveldb-hash.entrypoints=websecure}
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-archive-leveldb-hash.tls.certresolver=myresolver}
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-archive-leveldb-hash.rule=Host(`$DOMAIN`) && (Path(`/viction-mainnet-node-archive`) || Path(`/viction-mainnet-node-archive/`))}
|
|
- ${NO_SSL:+traefik.http.routers.viction-mainnet-node-archive-leveldb-hash.rule=Path(`/viction-mainnet-node-archive`) || Path(`/viction-mainnet-node-archive/`)}
|
|
- traefik.http.routers.viction-mainnet-node-archive-leveldb-hash.middlewares=viction-mainnet-node-archive-leveldb-hash-stripprefix, ipallowlist
|
|
- traefik.http.routers.viction-mainnet-node-archive-leveldb-hash.priority=50 # gets any request that is not GET with UPGRADE header
|
|
- traefik.http.routers.viction-mainnet-node-archive-leveldb-hash-ws.priority=100 # answers GET requests first
|
|
- traefik.http.services.viction-mainnet-node-archive-leveldb-hash-ws.loadbalancer.server.port=8546
|
|
- traefik.http.routers.viction-mainnet-node-archive-leveldb-hash-ws.service=viction-mainnet-node-archive-leveldb-hash-ws
|
|
- traefik.http.routers.viction-mainnet-node-archive-leveldb-hash.service=viction-mainnet-node-archive-leveldb-hash
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-archive-leveldb-hash-ws.entrypoints=websecure}
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-archive-leveldb-hash-ws.tls.certresolver=myresolver}
|
|
# case-insensitive Upgrade: python websocket-client sends "WebSocket" (capital W)
|
|
- ${NO_SSL:-traefik.http.routers.viction-mainnet-node-archive-leveldb-hash-ws.rule=Host(`$DOMAIN`) && (Path(`/viction-mainnet-node-archive`) || Path(`/viction-mainnet-node-archive/`)) && HeadersRegexp(`Upgrade`, `(?i)websocket`)}
|
|
- ${NO_SSL:+traefik.http.routers.viction-mainnet-node-archive-leveldb-hash-ws.rule=(Path(`/viction-mainnet-node-archive`) || Path(`/viction-mainnet-node-archive/`)) && HeadersRegexp(`Upgrade`, `(?i)websocket`)}
|
|
- traefik.http.routers.viction-mainnet-node-archive-leveldb-hash-ws.middlewares=viction-mainnet-node-archive-leveldb-hash-stripprefix, ipallowlist
|
|
|
|
volumes:
|
|
viction-mainnet-node-archive-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
|
|
... |