Set ADVERTISE_NODE_IP=${IP} and ADVERTISE_NODE_PORT to the salted host
port; map client_port:19000 so inbound cubenet peering is dialable.
Co-authored-by: Cursor <cursoragent@cursor.com>
169 lines
6.9 KiB
YAML
169 lines
6.9 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:jovay/aldaba/jovay-mainnet-aldaba-pruned.yml
|
|
#
|
|
# docker compose up -d
|
|
#
|
|
# curl -X POST https://${IP}.traefik.me/jovay-mainnet \
|
|
# -H "Content-Type: application/json" \
|
|
# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
|
|
|
|
services:
|
|
jovay-mainnet-init-conf:
|
|
image: ${JOVAY_ALDABA_IMAGE:-jovay-release-registry.cn-hongkong.cr.aliyuncs.com/jovay/l2-rpc}:${JOVAY_MAINNET_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_MAINNET_ALDABA_PRUNED_CONF:-jovay-mainnet-aldaba-pruned_conf}:/conf
|
|
logging: *logging-defaults
|
|
|
|
jovay-mainnet-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.jovay.io/snapshot/genesis.conf"
|
|
echo "502c910cbc21137c606621622fe67d28 /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.jovay.io/snapshot/VERSION_epoch16905"
|
|
echo "3b8bfc464d24c101e0b407aeba200345 /tmp/VERSION" | md5sum -c -
|
|
mv /tmp/VERSION /conf/VERSION
|
|
fi
|
|
restart: no
|
|
depends_on:
|
|
jovay-mainnet-init-conf:
|
|
condition: service_completed_successfully
|
|
networks:
|
|
- chains
|
|
volumes:
|
|
- ${JOVAY_MAINNET_ALDABA_PRUNED_CONF:-jovay-mainnet-aldaba-pruned_conf}:/conf
|
|
logging: *logging-defaults
|
|
|
|
jovay-mainnet:
|
|
image: ${JOVAY_ALDABA_IMAGE:-jovay-release-registry.cn-hongkong.cr.aliyuncs.com/jovay/l2-rpc}:${JOVAY_MAINNET_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:
|
|
- 12008:19000
|
|
expose:
|
|
- 18100
|
|
- 18200
|
|
- 19000
|
|
environment:
|
|
- ADVERTISE_NODE_IP=${IP}
|
|
- ADVERTISE_NODE_PORT=12008
|
|
- EXTERNAL_CLB_PRE_EXPOSERPC_URL=noise_tcp://47.83.131.74:52398?842016e6eb94da561b1b4c856e08bf71cd70c05ea847e934b8be1d5a74a979f8;noise_tcp://47.83.131.74:52399?ce08efde90a7970d18dd6763fdc68d19a24084fd7c8cf67a68a19e943b30c5e3
|
|
- SEQUENCER_ADVERTISE_NODE_URL=alb-cnjrn9zqms3o5flehu.cn-hongkong.alb.aliyuncsslbintl.com:80
|
|
restart: unless-stopped
|
|
stop_grace_period: 5m
|
|
depends_on:
|
|
jovay-mainnet-init:
|
|
condition: service_completed_successfully
|
|
networks:
|
|
- chains
|
|
volumes:
|
|
- ${JOVAY_MAINNET_ALDABA_PRUNED_CONF:-jovay-mainnet-aldaba-pruned_conf}:/opt/l2_deploy/conf
|
|
- ${JOVAY_MAINNET_ALDABA_PRUNED_DATA:-jovay-mainnet-aldaba-pruned}:/opt/l2_deploy/light/data
|
|
- ${JOVAY_MAINNET_ALDABA_PRUNED_LOG:-jovay-mainnet-aldaba-pruned_log}:/opt/l2_deploy/light/log
|
|
- type: volume
|
|
source: ${JOVAY_MAINNET_ALDABA_PRUNED_CONF:-jovay-mainnet-aldaba-pruned_conf}
|
|
target: /opt/l2_deploy/bin/VERSION
|
|
volume:
|
|
subpath: VERSION
|
|
- /slowdisk:/slowdisk
|
|
logging: *logging-defaults
|
|
labels:
|
|
- prometheus-scrape.enabled=false
|
|
- traefik.enable=true
|
|
- traefik.http.middlewares.jovay-mainnet-aldaba-pruned-stripprefix.stripprefix.prefixes=/jovay-mainnet
|
|
- traefik.http.services.jovay-mainnet-aldaba-pruned.loadbalancer.server.port=18100
|
|
- ${NO_SSL:-traefik.http.routers.jovay-mainnet-aldaba-pruned.entrypoints=websecure}
|
|
- ${NO_SSL:-traefik.http.routers.jovay-mainnet-aldaba-pruned.tls.certresolver=myresolver}
|
|
- ${NO_SSL:-traefik.http.routers.jovay-mainnet-aldaba-pruned.rule=Host(`$DOMAIN`) && (Path(`/jovay-mainnet`) || Path(`/jovay-mainnet/`))}
|
|
- ${NO_SSL:+traefik.http.routers.jovay-mainnet-aldaba-pruned.rule=Path(`/jovay-mainnet`) || Path(`/jovay-mainnet/`)}
|
|
- traefik.http.routers.jovay-mainnet-aldaba-pruned.middlewares=jovay-mainnet-aldaba-pruned-stripprefix, ipallowlist
|
|
- traefik.http.routers.jovay-mainnet-aldaba-pruned.priority=50 # gets any request that is not GET with UPGRADE header
|
|
- traefik.http.routers.jovay-mainnet-aldaba-pruned-ws.priority=100 # answers GET requests first
|
|
- traefik.http.services.jovay-mainnet-aldaba-pruned-ws.loadbalancer.server.port=18200
|
|
- traefik.http.routers.jovay-mainnet-aldaba-pruned-ws.service=jovay-mainnet-aldaba-pruned-ws
|
|
- traefik.http.routers.jovay-mainnet-aldaba-pruned.service=jovay-mainnet-aldaba-pruned
|
|
- ${NO_SSL:-traefik.http.routers.jovay-mainnet-aldaba-pruned-ws.entrypoints=websecure}
|
|
- ${NO_SSL:-traefik.http.routers.jovay-mainnet-aldaba-pruned-ws.tls.certresolver=myresolver}
|
|
- ${NO_SSL:-traefik.http.routers.jovay-mainnet-aldaba-pruned-ws.rule=Host(`$DOMAIN`) && (Path(`/jovay-mainnet`) || Path(`/jovay-mainnet/`)) && HeadersRegexp(`Upgrade`, `(?i)websocket`)}
|
|
- ${NO_SSL:+traefik.http.routers.jovay-mainnet-aldaba-pruned-ws.rule=(Path(`/jovay-mainnet`) || Path(`/jovay-mainnet/`)) && HeadersRegexp(`Upgrade`, `(?i)websocket`)}
|
|
- traefik.http.routers.jovay-mainnet-aldaba-pruned-ws.middlewares=jovay-mainnet-aldaba-pruned-stripprefix, ipallowlist
|
|
|
|
volumes:
|
|
jovay-mainnet-aldaba-pruned:
|
|
jovay-mainnet-aldaba-pruned_conf:
|
|
jovay-mainnet-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
|
|
method-groups:
|
|
enabled:
|
|
- debug
|
|
- filter
|
|
methods:
|
|
disabled:
|
|
enabled:
|
|
- name: txpool_content # TODO: should be disabled for rollup nodes
|
|
... |