Files
ethereum-rpc-docker/haqq/haqq/haqq-mainnet-haqq-pruned.yml
goldsquid db89e1915d update
2025-10-25 14:14:00 +07:00

109 lines
4.3 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:haqq/haqq/haqq-mainnet-haqq-pruned.yml
#
# docker compose up -d
#
# curl -X POST https://${IP}.traefik.me/haqq-mainnet \
# -H "Content-Type: application/json" \
# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
services:
haqq-mainnet:
image: ${HAQQ_HAQQ_IMAGE:-alhaqq/haqq}:${HAQQ_MAINNET_HAQQ_VERSION:-v1.9.0}
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:
- 10465:10465
- 10465:10465/udp
expose:
- 8545
- 8546
entrypoint: [haqqd, start]
command: --p2p.laddr=tcp://0.0.0.0:10465
restart: unless-stopped
stop_grace_period: 5m
networks:
- chains
volumes:
- ${HAQQ_MAINNET_HAQQ_PRUNED_DATA:-haqq-mainnet-haqq-pruned}:/root/.haqqd
- /slowdisk:/slowdisk
logging: *logging-defaults
labels:
- prometheus-scrape.enabled=false
- traefik.enable=true
- traefik.http.middlewares.haqq-mainnet-haqq-pruned-stripprefix.stripprefix.prefixes=/haqq-mainnet
- traefik.http.services.haqq-mainnet-haqq-pruned.loadbalancer.server.port=8545
- ${NO_SSL:-traefik.http.routers.haqq-mainnet-haqq-pruned.entrypoints=websecure}
- ${NO_SSL:-traefik.http.routers.haqq-mainnet-haqq-pruned.tls.certresolver=myresolver}
- ${NO_SSL:-traefik.http.routers.haqq-mainnet-haqq-pruned.rule=Host(`$DOMAIN`) && (Path(`/haqq-mainnet`) || Path(`/haqq-mainnet/`))}
- ${NO_SSL:+traefik.http.routers.haqq-mainnet-haqq-pruned.rule=Path(`/haqq-mainnet`) || Path(`/haqq-mainnet/`)}
- traefik.http.routers.haqq-mainnet-haqq-pruned.middlewares=haqq-mainnet-haqq-pruned-stripprefix, ipallowlist
- traefik.http.routers.haqq-mainnet-haqq-pruned.priority=50 # gets any request that is not GET with UPGRADE header
- traefik.http.routers.haqq-mainnet-haqq-pruned-ws.priority=100 # answers GET requests first
- traefik.http.services.haqq-mainnet-haqq-pruned-ws.loadbalancer.server.port=8546
- traefik.http.routers.haqq-mainnet-haqq-pruned-ws.service=haqq-mainnet-haqq-pruned-ws
- traefik.http.routers.haqq-mainnet-haqq-pruned.service=haqq-mainnet-haqq-pruned
- ${NO_SSL:-traefik.http.routers.haqq-mainnet-haqq-pruned-ws.entrypoints=websecure}
- ${NO_SSL:-traefik.http.routers.haqq-mainnet-haqq-pruned-ws.tls.certresolver=myresolver}
- ${NO_SSL:-traefik.http.routers.haqq-mainnet-haqq-pruned-ws.rule=Host(`$DOMAIN`) && (Path(`/haqq-mainnet`) || Path(`/haqq-mainnet/`)) && Headers(`Upgrade`, `websocket`)}
- ${NO_SSL:+traefik.http.routers.haqq-mainnet-haqq-pruned-ws.rule=(Path(`/haqq-mainnet`) || Path(`/haqq-mainnet/`)) && Headers(`Upgrade`, `websocket`)}
- traefik.http.routers.haqq-mainnet-haqq-pruned-ws.middlewares=haqq-mainnet-haqq-pruned-stripprefix, ipallowlist
volumes:
haqq-mainnet-haqq-pruned:
x-upstreams:
- id: $${ID}
labels:
provider: $${PROVIDER}
connection:
generic:
rpc:
url: $${RPC_URL}
ws:
frameSize: 20Mb
msgSize: 50Mb
url: $${WS_URL}
chain: haqq
method-groups:
enabled:
- debug
- filter
methods:
disabled:
enabled:
- name: txpool_content # TODO: should be disabled for rollup nodes
...