Files
ethereum-rpc-docker/fantom/sonic/fantom-testnet-sonic-archive.yml
Para Dox 079aefb865 usage
2025-04-28 21:36:02 +07:00

118 lines
5.3 KiB
YAML

---
# Usage:
#
# .env
# IP=$(curl ipinfo.io/ip)
# COMPOSE_FILE=base.yml:rpc.yml:fantom/sonic/fantom-testnet-sonic-archive.yml
#
# docker compose up -d
services:
fantom-testnet-archive:
build:
context: ./fantom
dockerfile: sonic.Dockerfile
args:
VERSION: v1.2.1-h
REPO: https://github.com/Fantom-foundation/sonic.git
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:
- 10652:10652
- 10652:10652/udp
expose:
- 8545
environment:
- CACHE_GB=${SONIC_CACHE_GB:-28}
- GENESIS=https://download.fantom.network/opera/testnet/testnet-26650-rpc.g
- IP=${IP}
- SONIC_HOME=/var/sonic
command:
- --bootnodes=enode://2411cdad2780bf969c0bd6f19b53ac6683710d50f19a7604248d8a6a810d3d6369dffb08535530095c151ecad143393e4fbca2d11f62377fe15b3df4d9883053@34.172.30.235:5050,enode://6f434dc43f826f7c3c817ba7fbe7842aa47c50d1e77a6b57ec51313fd88c7f006240baa105b795712922a05e1b548d413ea6d32d8c1c8feb9ffc206a6c9e37ce@34.55.131.153:5050,enode://64e69ec1f30be48aa8d5f3e6cadf15d06d846d40918f3906e6efbc4a3421f0cc04e3e4f88569b5c90306bbc16ca15df6898ad71b8a73aa36284f1c3076f2956e@35.195.64.211:5050,enode://a76d94105f12d3fb5c31df5a59448d95b723d94543620a02f72ee990e048c43df940f4969ab06d436ef8976c49ec9c2a671c2f5af8d93af911cef63de329a8b8@35.239.100.93:5050,enode://baea3b72d091cb361283af4933da32406d707d3bb077a42c77a58cf98e27b546da837e6e9524d8588f414e1886a3b17e036b86fd2d723170db93831a22324252@35.241.219.197:5050,enode://544f06ceaddcf508a13326d95518a524e14f4980723c9dc5cb8560635a7faa7f8f91483faed19dacd7d251abf72b4a1b0bcacaced1255deb93414d097221a9bc@35.224.88.189:5050,enode://baea3b72d091cb361283af4933da32406d707d3bb077a42c77a58cf98e27b546da837e6e9524d8588f414e1886a3b17e036b86fd2d723170db93831a22324252@35.241.219.197:5050,enode://2cd3fcfe9671d81c0e8bb76bc81a430882ce5d99199c20a004da97bec48e9b03c02c3b6d95edb77498ce2dd8e090c4ce76349e775af7540b04a6e9303e5b69cd@104.155.31.23:5050
- --cache=${FANTOM_TESTNET_SONIC_ARCHIVE_CACHE_MB:-16000}
- --http
- --http.addr=0.0.0.0
- --http.api=admin,debug,web3,eth,dag,txpool,personal,abft,net,trace,ftm
- --http.port=8545
- --http.vhosts=*
- --maxpeers=50
- --nat=extip:${IP}
- --port=10652
- --rpc.gascap=600000000
- --rpc.txfeecap=0
- --ws
- --ws.addr=0.0.0.0
- --ws.api=admin,debug,web3,eth,dag,txpool,personal,abft,net,trace,ftm
- --ws.origins=*
- --ws.port=8545
restart: unless-stopped
stop_grace_period: 5m
networks:
- chains
volumes:
- ${FANTOM_TESTNET_SONIC_ARCHIVE_DATA:-fantom-testnet-sonic-archive}:/var/sonic
- /slowdisk:/slowdisk
labels:
- traefik.enable=true
- traefik.http.middlewares.fantom-testnet-sonic-archive-stripprefix.stripprefix.prefixes=/fantom-testnet-archive
- traefik.http.services.fantom-testnet-sonic-archive.loadbalancer.server.port=8545
- ${NO_SSL:-traefik.http.routers.fantom-testnet-sonic-archive.entrypoints=websecure}
- ${NO_SSL:-traefik.http.routers.fantom-testnet-sonic-archive.tls.certresolver=myresolver}
- ${NO_SSL:-traefik.http.routers.fantom-testnet-sonic-archive.rule=Host(`$DOMAIN`) && (Path(`/fantom-testnet-archive`) || Path(`/fantom-testnet-archive/`))}
- ${NO_SSL:+traefik.http.routers.fantom-testnet-sonic-archive.rule=Path(`/fantom-testnet-archive`) || Path(`/fantom-testnet-archive/`)}
- traefik.http.routers.fantom-testnet-sonic-archive.middlewares=fantom-testnet-sonic-archive-stripprefix, ipallowlist
volumes:
fantom-testnet-sonic-archive:
x-upstreams:
- id: $${ID}
labels:
provider: $${PROVIDER}
connection:
generic:
rpc:
url: $${RPC_URL}
ws:
frameSize: 20Mb
msgSize: 50Mb
url: $${WS_URL}
chain: fantom-testnet
method-groups:
enabled:
- debug
- filter
methods:
disabled:
enabled:
- name: txpool_content # TODO: should be disabled for rollup nodes
# standard geth only
- name: debug_getRawBlock
- name: debug_getRawTransaction
- name: debug_getRawReceipts
- name: debug_getRawHeader
- name: debug_getBadBlocks
# non standard geth only slightly dangerous
- name: debug_intermediateRoots
- name: debug_dumpBlock
# standard geth and erigon
- name: debug_accountRange
- name: debug_getModifiedAccountsByNumber
- name: debug_getModifiedAccountsByHash
# non standard geth and erigon
- name: eth_getRawTransactionByHash
- name: eth_getRawTransactionByBlockHashAndIndex
...