174 lines
7.2 KiB
YAML
174 lines
7.2 KiB
YAML
---
|
|
x-logging-defaults: &logging-defaults
|
|
driver: json-file
|
|
options:
|
|
max-size: "512m"
|
|
max-file: "2"
|
|
|
|
# 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:jovay/aldaba/jovay-sepolia-aldaba-pruned.yml
|
|
#
|
|
# docker compose up -d
|
|
#
|
|
# curl -X POST https://${IP}.traefik.me/jovay-sepolia \
|
|
# -H "Content-Type: application/json" \
|
|
# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
|
|
|
|
services:
|
|
jovay-sepolia-init-conf:
|
|
image: ${JOVAY_ALDABA_IMAGE:-jovay-release-registry.cn-hongkong.cr.aliyuncs.com/jovay/l2-rpc}:${JOVAY_SEPOLIA_ALDABA_VERSION:-0.14.0-rc1}
|
|
user: 0:0
|
|
entrypoint: [/bin/sh, -c]
|
|
command:
|
|
- |
|
|
set -e
|
|
if [ -z "$$(ls -A /conf 2>/dev/null)" ]; then
|
|
cp -a /opt/l2_deploy/conf/. /conf/
|
|
fi
|
|
restart: no
|
|
networks:
|
|
- chains
|
|
volumes:
|
|
- ${JOVAY_SEPOLIA_ALDABA_PRUNED_CONF:-jovay-sepolia-aldaba-pruned_conf}:/conf
|
|
logging: *logging-defaults
|
|
|
|
jovay-sepolia-init:
|
|
image: alpine:3.21
|
|
user: 0:0
|
|
entrypoint: [/bin/sh, -c]
|
|
command:
|
|
- |
|
|
set -e
|
|
apk add --no-cache wget coreutils
|
|
if [ ! -f /conf/genesis.aldaba-ng.conf ]; then
|
|
wget -qO /tmp/genesis.conf "http://dl-testnet.jovay.io/snapshot/genesis.conf"
|
|
echo "1b6ad3d9fa67a596ca094e89bd2280ee /tmp/genesis.conf" | md5sum -c -
|
|
mv /tmp/genesis.conf /conf/genesis.aldaba-ng.conf
|
|
fi
|
|
if [ ! -f /conf/VERSION ]; then
|
|
wget -qO /tmp/VERSION "http://dl-testnet.jovay.io/snapshot/VERSION_epoch26280"
|
|
echo "994db44ba74a280efe44efdcd3f4422d /tmp/VERSION" | md5sum -c -
|
|
mv /tmp/VERSION /conf/VERSION
|
|
fi
|
|
restart: no
|
|
depends_on:
|
|
jovay-sepolia-init-conf:
|
|
condition: service_completed_successfully
|
|
networks:
|
|
- chains
|
|
volumes:
|
|
- ${JOVAY_SEPOLIA_ALDABA_PRUNED_CONF:-jovay-sepolia-aldaba-pruned_conf}:/conf
|
|
logging: *logging-defaults
|
|
|
|
jovay-sepolia:
|
|
image: ${JOVAY_ALDABA_IMAGE:-jovay-release-registry.cn-hongkong.cr.aliyuncs.com/jovay/l2-rpc}:${JOVAY_SEPOLIA_ALDABA_VERSION:-0.14.0-rc1}
|
|
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: 1000:1000
|
|
ports:
|
|
- 13442:19000
|
|
expose:
|
|
- 18100
|
|
- 18200
|
|
- 19000
|
|
environment:
|
|
- ADVERTISE_NODE_IP=${IP}
|
|
- ADVERTISE_NODE_PORT=13442
|
|
- EXTERNAL_CLB_PRE_EXPOSERPC_URL=noise_tcp://43.106.17.221:52399?2d655725a449ef9f5f1b048d596736c0e4aaaac3fd9b6bd3f7eef5dee8517d7d;noise_tcp://43.106.17.221:52398?c9664991ff25fd390f10d29c1e024594067f4e00ef470388e89f29bd9a403d23
|
|
- SEQUENCER_ADVERTISE_NODE_URL=alb-ism8q21lfjeen07hq3.ap-southeast-1.alb.aliyuncsslbintl.com:80
|
|
entrypoint: [/tini, --, /bin/bash, -c]
|
|
command:
|
|
- |
|
|
set -e
|
|
cp /opt/l2_deploy/conf/VERSION /opt/l2_deploy/bin/VERSION
|
|
mkdir -p /opt/l2_deploy/light/log
|
|
touch /opt/l2_deploy/light/log/aldaba.log /opt/l2_deploy/light/log/cubenet.log
|
|
tail -n0 -F /opt/l2_deploy/light/log/aldaba.log /opt/l2_deploy/light/log/cubenet.log &
|
|
exec /opt/entry.sh
|
|
restart: unless-stopped
|
|
stop_grace_period: 5m
|
|
depends_on:
|
|
jovay-sepolia-init:
|
|
condition: service_completed_successfully
|
|
networks:
|
|
- chains
|
|
volumes:
|
|
- ${JOVAY_SEPOLIA_ALDABA_PRUNED_CONF:-jovay-sepolia-aldaba-pruned_conf}:/opt/l2_deploy/conf
|
|
- ${JOVAY_SEPOLIA_ALDABA_PRUNED_DATA:-jovay-sepolia-aldaba-pruned}:/opt/l2_deploy/light/data
|
|
- ${JOVAY_SEPOLIA_ALDABA_PRUNED_LOG:-jovay-sepolia-aldaba-pruned_log}:/opt/l2_deploy/light/log
|
|
- /slowdisk:/slowdisk
|
|
logging: *logging-defaults
|
|
labels:
|
|
- prometheus-scrape.enabled=false
|
|
- traefik.enable=true
|
|
- traefik.http.middlewares.jovay-sepolia-aldaba-pruned-stripprefix.stripprefix.prefixes=/jovay-sepolia
|
|
- traefik.http.services.jovay-sepolia-aldaba-pruned.loadbalancer.server.port=18100
|
|
- ${NO_SSL:-traefik.http.routers.jovay-sepolia-aldaba-pruned.entrypoints=websecure}
|
|
- ${NO_SSL:-traefik.http.routers.jovay-sepolia-aldaba-pruned.tls.certresolver=myresolver}
|
|
- ${NO_SSL:-traefik.http.routers.jovay-sepolia-aldaba-pruned.rule=Host(`$DOMAIN`) && (Path(`/jovay-sepolia`) || Path(`/jovay-sepolia/`))}
|
|
- ${NO_SSL:+traefik.http.routers.jovay-sepolia-aldaba-pruned.rule=Path(`/jovay-sepolia`) || Path(`/jovay-sepolia/`)}
|
|
- traefik.http.routers.jovay-sepolia-aldaba-pruned.middlewares=jovay-sepolia-aldaba-pruned-stripprefix, ipallowlist
|
|
- traefik.http.routers.jovay-sepolia-aldaba-pruned.priority=50 # gets any request that is not GET with UPGRADE header
|
|
- traefik.http.routers.jovay-sepolia-aldaba-pruned-ws.priority=100 # answers GET requests first
|
|
- traefik.http.services.jovay-sepolia-aldaba-pruned-ws.loadbalancer.server.port=18200
|
|
- traefik.http.routers.jovay-sepolia-aldaba-pruned-ws.service=jovay-sepolia-aldaba-pruned-ws
|
|
- traefik.http.routers.jovay-sepolia-aldaba-pruned.service=jovay-sepolia-aldaba-pruned
|
|
- ${NO_SSL:-traefik.http.routers.jovay-sepolia-aldaba-pruned-ws.entrypoints=websecure}
|
|
- ${NO_SSL:-traefik.http.routers.jovay-sepolia-aldaba-pruned-ws.tls.certresolver=myresolver}
|
|
# case-insensitive Upgrade: python websocket-client sends "WebSocket" (capital W)
|
|
- ${NO_SSL:-traefik.http.routers.jovay-sepolia-aldaba-pruned-ws.rule=Host(`$DOMAIN`) && (Path(`/jovay-sepolia`) || Path(`/jovay-sepolia/`)) && HeadersRegexp(`Upgrade`, `(?i)websocket`)}
|
|
- ${NO_SSL:+traefik.http.routers.jovay-sepolia-aldaba-pruned-ws.rule=(Path(`/jovay-sepolia`) || Path(`/jovay-sepolia/`)) && HeadersRegexp(`Upgrade`, `(?i)websocket`)}
|
|
- traefik.http.routers.jovay-sepolia-aldaba-pruned-ws.middlewares=jovay-sepolia-aldaba-pruned-stripprefix, ipallowlist
|
|
|
|
volumes:
|
|
jovay-sepolia-aldaba-pruned:
|
|
jovay-sepolia-aldaba-pruned_conf:
|
|
jovay-sepolia-aldaba-pruned_log:
|
|
|
|
x-upstreams:
|
|
- id: $${ID}
|
|
labels:
|
|
provider: $${PROVIDER}
|
|
connection:
|
|
generic:
|
|
rpc:
|
|
url: $${RPC_URL}
|
|
ws:
|
|
frameSize: 20Mb
|
|
msgSize: 50Mb
|
|
url: $${WS_URL}
|
|
chain: jovay-sepolia
|
|
method-groups:
|
|
enabled:
|
|
- debug
|
|
- filter
|
|
methods:
|
|
disabled:
|
|
enabled:
|
|
- name: txpool_content # TODO: should be disabled for rollup nodes
|
|
... |