106 lines
4.2 KiB
YAML
106 lines
4.2 KiB
YAML
---
|
|
x-logging-defaults: &logging-defaults
|
|
driver: json-file
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
# Beware that the port range is fixed to 4000-4010.
|
|
# effectively only 4001,4002 are used
|
|
# the actual source of truth seems to be running in Tokio
|
|
# everyone else may be a slave to the truth
|
|
#
|
|
# the client should actually be named "node" but I'm going to fix the naming later... or not.
|
|
|
|
# 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:hyperliquid/visor/hyperliquid-mainnet-visor-pruned.yml
|
|
#
|
|
# docker compose up -d
|
|
#
|
|
# curl -X POST https://${IP}.traefik.me/hyperliquid-mainnet-pruned \
|
|
# -H "Content-Type: application/json" \
|
|
# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
|
|
|
|
services:
|
|
hyperliquid-mainnet-pruned:
|
|
build:
|
|
context: ./hyperliquid
|
|
dockerfile: visor.Dockerfile
|
|
args:
|
|
CHAIN_NAME: Mainnet
|
|
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:
|
|
- 4001:4001
|
|
- 4001:4001/udp
|
|
- 4002:4002
|
|
- 4002:4002/udp
|
|
expose:
|
|
- 3001
|
|
environment:
|
|
- ROOT_NODE_IPS=35.213.122.164,35.213.89.139,20.188.6.225,74.226.182.22,180.189.55.18,180.189.55.19,46.105.222.166,91.134.41.52,57.180.50.253,54.248.41.39,52.68.71.160,13.114.116.44,199.254.199.190,199.254.199.247,45.32.32.21,157.90.207.92,148.251.76.7,109.123.230.189,31.223.196.172,31.223.196.238,91.134.71.237,57.129.140.247,160.202.131.51,72.46.87.141,199.254.199.12,199.254.199.54,45.250.255.111,109.94.99.131,47.74.39.46,8.211.133.129
|
|
restart: unless-stopped
|
|
stop_grace_period: 5m
|
|
networks:
|
|
- chains
|
|
volumes:
|
|
- ${HYPERLIQUID_MAINNET_VISOR_PRUNED_DATA:-hyperliquid-mainnet-visor-pruned}:/root/hl/data
|
|
- /slowdisk:/slowdisk
|
|
logging: *logging-defaults
|
|
labels:
|
|
- prometheus-scrape.enabled=false
|
|
- traefik.enable=true
|
|
- traefik.http.middlewares.hyperliquid-mainnet-visor-pruned-set-path.replacepath.path=/evm
|
|
- traefik.http.middlewares.hyperliquid-mainnet-visor-pruned-stripprefix.stripprefix.prefixes=/hyperliquid-mainnet-pruned
|
|
- traefik.http.services.hyperliquid-mainnet-visor-pruned.loadbalancer.server.port=3001
|
|
- ${NO_SSL:-traefik.http.routers.hyperliquid-mainnet-visor-pruned.entrypoints=websecure}
|
|
- ${NO_SSL:-traefik.http.routers.hyperliquid-mainnet-visor-pruned.tls.certresolver=myresolver}
|
|
- ${NO_SSL:-traefik.http.routers.hyperliquid-mainnet-visor-pruned.rule=Host(`$DOMAIN`) && (Path(`/hyperliquid-mainnet-pruned`) || Path(`/hyperliquid-mainnet-pruned/`))}
|
|
- ${NO_SSL:+traefik.http.routers.hyperliquid-mainnet-visor-pruned.rule=Path(`/hyperliquid-mainnet-pruned`) || Path(`/hyperliquid-mainnet-pruned/`)}
|
|
- traefik.http.routers.hyperliquid-mainnet-visor-pruned.middlewares=hyperliquid-mainnet-visor-pruned-stripprefix, hyperliquid-mainnet-visor-pruned-set-path
|
|
|
|
volumes:
|
|
hyperliquid-mainnet-visor-pruned:
|
|
|
|
x-upstreams:
|
|
- id: $${ID}
|
|
labels:
|
|
provider: $${PROVIDER}
|
|
connection:
|
|
generic:
|
|
rpc:
|
|
url: $${RPC_URL}
|
|
chain: hyperliquid
|
|
method-groups:
|
|
enabled:
|
|
- filter
|
|
methods:
|
|
disabled:
|
|
enabled:
|
|
- name: txpool_content # TODO: should be disabled for rollup nodes
|
|
... |