106 lines
3.8 KiB
YAML
106 lines
3.8 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-testnet-visor-pruned.yml
|
|
#
|
|
# docker compose up -d
|
|
#
|
|
# curl -X POST https://${IP}.traefik.me/hyperliquid-testnet-pruned \
|
|
# -H "Content-Type: application/json" \
|
|
# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
|
|
|
|
services:
|
|
hyperliquid-testnet-pruned:
|
|
build:
|
|
context: ./hyperliquid
|
|
dockerfile: visor.Dockerfile
|
|
args:
|
|
CHAIN_NAME: Testnet
|
|
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=
|
|
restart: unless-stopped
|
|
stop_grace_period: 5m
|
|
networks:
|
|
- chains
|
|
volumes:
|
|
- ${HYPERLIQUID_TESTNET_VISOR_PRUNED_DATA:-hyperliquid-testnet-visor-pruned}:/root/hl/data
|
|
- /slowdisk:/slowdisk
|
|
logging: *logging-defaults
|
|
labels:
|
|
- prometheus-scrape.enabled=false
|
|
- traefik.enable=true
|
|
- traefik.http.middlewares.hyperliquid-testnet-visor-pruned-set-path.replacepath.path=/evm
|
|
- traefik.http.middlewares.hyperliquid-testnet-visor-pruned-stripprefix.stripprefix.prefixes=/hyperliquid-testnet-pruned
|
|
- traefik.http.services.hyperliquid-testnet-visor-pruned.loadbalancer.server.port=3001
|
|
- ${NO_SSL:-traefik.http.routers.hyperliquid-testnet-visor-pruned.entrypoints=websecure}
|
|
- ${NO_SSL:-traefik.http.routers.hyperliquid-testnet-visor-pruned.tls.certresolver=myresolver}
|
|
- ${NO_SSL:-traefik.http.routers.hyperliquid-testnet-visor-pruned.rule=Host(`$DOMAIN`) && (Path(`/hyperliquid-testnet-pruned`) || Path(`/hyperliquid-testnet-pruned/`))}
|
|
- ${NO_SSL:+traefik.http.routers.hyperliquid-testnet-visor-pruned.rule=Path(`/hyperliquid-testnet-pruned`) || Path(`/hyperliquid-testnet-pruned/`)}
|
|
- traefik.http.routers.hyperliquid-testnet-visor-pruned.middlewares=hyperliquid-testnet-visor-pruned-stripprefix, hyperliquid-testnet-visor-pruned-set-path
|
|
|
|
volumes:
|
|
hyperliquid-testnet-visor-pruned:
|
|
|
|
x-upstreams:
|
|
- id: $${ID}
|
|
labels:
|
|
provider: $${PROVIDER}
|
|
connection:
|
|
generic:
|
|
rpc:
|
|
url: $${RPC_URL}
|
|
chain: hyperliquid-testnet
|
|
method-groups:
|
|
enabled:
|
|
- filter
|
|
methods:
|
|
disabled:
|
|
enabled:
|
|
- name: txpool_content # TODO: should be disabled for rollup nodes
|
|
... |