Files
ethereum-rpc-docker/viction/node/viction-testnet-node-archive-leveldb-hash.yml
2025-06-22 14:47:42 +07:00

113 lines
5.4 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-testnet-node-archive-leveldb-hash.yml
#
# docker compose up -d
#
# curl -X POST https://${IP}.traefik.me/viction-testnet-node-archive \
# -H "Content-Type: application/json" \
# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
services:
viction-testnet-node-archive:
image: ${VICTION_NODE_IMAGE:-buildonviction/node}:${VICTION_TESTNET_NODE_VERSION:-v2.4.7}
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:
- 11689:11689
- 11689:11689/udp
expose:
- 8545
- 8546
environment:
BOOTNODES: enode://ce1191bf9a634e7939676d136816ad84941b079c03d6a96e64cca35852363012169055c6879c644e821dc236a01d0499a1b7ff39e9518dbc00da87c7f1898604@13.251.101.216:30301,enode://cf2d05f71f143d85dce45dae6f74fae0ba56fc5ea1d1c548a095e29a5becb3a1fb93eb33e7b1dec43946dcfe608fd1495a02740af710bc615b90ad60fcc04d14@13.250.94.232:30301
EXTIP: ${IP}
NETWORK_ID: 89
P2P_PORT: 11689
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_TESTNET_NODE_ARCHIVE_LEVELDB_HASH_DATA:-viction-testnet-node-archive-leveldb-hash}:/tomochain/data
- /slowdisk:/slowdisk
logging: *logging-defaults
labels:
- prometheus-scrape.enabled=false
- traefik.enable=true
- traefik.http.middlewares.viction-testnet-node-archive-leveldb-hash-stripprefix.stripprefix.prefixes=/viction-testnet-node-archive
- traefik.http.services.viction-testnet-node-archive-leveldb-hash.loadbalancer.server.port=8545
- ${NO_SSL:-traefik.http.routers.viction-testnet-node-archive-leveldb-hash.entrypoints=websecure}
- ${NO_SSL:-traefik.http.routers.viction-testnet-node-archive-leveldb-hash.tls.certresolver=myresolver}
- ${NO_SSL:-traefik.http.routers.viction-testnet-node-archive-leveldb-hash.rule=Host(`$DOMAIN`) && (Path(`/viction-testnet-node-archive`) || Path(`/viction-testnet-node-archive/`))}
- ${NO_SSL:+traefik.http.routers.viction-testnet-node-archive-leveldb-hash.rule=Path(`/viction-testnet-node-archive`) || Path(`/viction-testnet-node-archive/`)}
- traefik.http.routers.viction-testnet-node-archive-leveldb-hash.middlewares=viction-testnet-node-archive-leveldb-hash-stripprefix, ipallowlist
- traefik.http.routers.viction-testnet-node-archive-leveldb-hash.priority=50 # gets any request that is not GET with UPGRADE header
- traefik.http.routers.viction-testnet-node-archive-leveldb-hash-ws.priority=100 # answers GET requests first
- traefik.http.services.viction-testnet-node-archive-leveldb-hash-ws.loadbalancer.server.port=8546
- traefik.http.routers.viction-testnet-node-archive-leveldb-hash-ws.service=viction-testnet-node-archive-leveldb-hash-ws
- traefik.http.routers.viction-testnet-node-archive-leveldb-hash.service=viction-testnet-node-archive-leveldb-hash
- ${NO_SSL:-traefik.http.routers.viction-testnet-node-archive-leveldb-hash-ws.entrypoints=websecure}
- ${NO_SSL:-traefik.http.routers.viction-testnet-node-archive-leveldb-hash-ws.tls.certresolver=myresolver}
- ${NO_SSL:-traefik.http.routers.viction-testnet-node-archive-leveldb-hash-ws.rule=Host(`$DOMAIN`) && (Path(`/viction-testnet-node-archive`) || Path(`/viction-testnet-node-archive/`)) && Headers(`Upgrade`, `websocket`)}
- ${NO_SSL:+traefik.http.routers.viction-testnet-node-archive-leveldb-hash-ws.rule=(Path(`/viction-testnet-node-archive`) || Path(`/viction-testnet-node-archive/`)) && Headers(`Upgrade`, `websocket`)}
- traefik.http.routers.viction-testnet-node-archive-leveldb-hash-ws.middlewares=viction-testnet-node-archive-leveldb-hash-stripprefix, ipallowlist
volumes:
viction-testnet-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-testnet
method-groups:
enabled:
- debug
- filter
methods:
disabled:
enabled:
- name: txpool_content # TODO: should be disabled for rollup nodes
...