Compare commits
9 Commits
20e2c1a66e
...
zircuit-co
| Author | SHA1 | Date | |
|---|---|---|---|
| b15af199d4 | |||
| 3478d286f6 | |||
| 8f8ac427d3 | |||
| 81c9addac9 | |||
| 37a26d8791 | |||
| 783435dc20 | |||
| 48302a4270 | |||
| d5e3068e7f | |||
| 5182ab6bd4 |
@@ -23,7 +23,7 @@ x-logging-defaults: &logging-defaults
|
|||||||
# ...
|
# ...
|
||||||
# IP=$(curl ipinfo.io/ip)
|
# IP=$(curl ipinfo.io/ip)
|
||||||
# DOMAIN=${IP}.traefik.me
|
# DOMAIN=${IP}.traefik.me
|
||||||
# COMPOSE_FILE=base.yml:rpc.yml:abcore/geth/abcore-mainnet-geth-pruned-pebble-path.yml
|
# COMPOSE_FILE=base.yml:rpc.yml:abcore/geth/abcore-mainnet-geth-pruned-pebble-hash.yml
|
||||||
#
|
#
|
||||||
# docker compose up -d
|
# docker compose up -d
|
||||||
#
|
#
|
||||||
@@ -37,7 +37,7 @@ services:
|
|||||||
context: ./abcore
|
context: ./abcore
|
||||||
dockerfile: abcore.Dockerfile
|
dockerfile: abcore.Dockerfile
|
||||||
args:
|
args:
|
||||||
ABCORE_MAINNET_GETH_VERSION: ${ABCORE_MAINNET_GETH_VERSION:-}
|
ABCORE_MAINNET_GETH_VERSION: ${ABCORE_MAINNET_GETH_VERSION:-v1.13.15-abcore-1.2}
|
||||||
sysctls:
|
sysctls:
|
||||||
# TCP Performance
|
# TCP Performance
|
||||||
net.ipv4.tcp_slow_start_after_idle: 0 # Disable slow start after idle
|
net.ipv4.tcp_slow_start_after_idle: 0 # Disable slow start after idle
|
||||||
@@ -53,8 +53,8 @@ services:
|
|||||||
nofile: 1048576 # Max open files (for RPC/WS connections)
|
nofile: 1048576 # Max open files (for RPC/WS connections)
|
||||||
user: root
|
user: root
|
||||||
ports:
|
ports:
|
||||||
- 13430:13430
|
- 13110:13110
|
||||||
- 13430:13430/udp
|
- 13110:13110/udp
|
||||||
expose:
|
expose:
|
||||||
- 8545
|
- 8545
|
||||||
- 6060
|
- 6060
|
||||||
@@ -62,7 +62,7 @@ services:
|
|||||||
- CHAIN_NAME=mainnet
|
- CHAIN_NAME=mainnet
|
||||||
entrypoint: [/usr/local/bin/init.sh]
|
entrypoint: [/usr/local/bin/init.sh]
|
||||||
command:
|
command:
|
||||||
- --config /config/config.toml
|
- --config=/config/config.toml
|
||||||
- --datadir=/root/.ethereum
|
- --datadir=/root/.ethereum
|
||||||
- --db.engine=pebble
|
- --db.engine=pebble
|
||||||
- --gcmode=full
|
- --gcmode=full
|
||||||
@@ -77,10 +77,9 @@ services:
|
|||||||
- --metrics.port=6060
|
- --metrics.port=6060
|
||||||
- --nat=extip:${IP}
|
- --nat=extip:${IP}
|
||||||
- --networkid=36888
|
- --networkid=36888
|
||||||
- --port=13430
|
- --port=13110
|
||||||
- --rpc.gascap=600000000
|
- --rpc.gascap=600000000
|
||||||
- --rpc.txfeecap=0
|
- --rpc.txfeecap=0
|
||||||
- --state.scheme=path
|
|
||||||
- --syncmode=full
|
- --syncmode=full
|
||||||
- --ws
|
- --ws
|
||||||
- --ws.addr=0.0.0.0
|
- --ws.addr=0.0.0.0
|
||||||
@@ -92,7 +91,7 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- chains
|
- chains
|
||||||
volumes:
|
volumes:
|
||||||
- ${ABCORE_MAINNET_GETH_PRUNED_PEBBLE_PATH_DATA:-abcore-mainnet-geth-pruned-pebble-path}:/root/.ethereum
|
- ${ABCORE_MAINNET_GETH_PRUNED_PEBBLE_HASH_DATA:-abcore-mainnet-geth-pruned-pebble-hash}:/root/.ethereum
|
||||||
- ./abcore/mainnet:/config
|
- ./abcore/mainnet:/config
|
||||||
- /slowdisk:/slowdisk
|
- /slowdisk:/slowdisk
|
||||||
logging: *logging-defaults
|
logging: *logging-defaults
|
||||||
@@ -101,16 +100,16 @@ services:
|
|||||||
- prometheus-scrape.port=6060
|
- prometheus-scrape.port=6060
|
||||||
- prometheus-scrape.path=/debug/metrics/prometheus
|
- prometheus-scrape.path=/debug/metrics/prometheus
|
||||||
- traefik.enable=true
|
- traefik.enable=true
|
||||||
- traefik.http.middlewares.abcore-mainnet-geth-pruned-pebble-path-stripprefix.stripprefix.prefixes=/abcore-mainnet-geth
|
- traefik.http.middlewares.abcore-mainnet-geth-pruned-pebble-hash-stripprefix.stripprefix.prefixes=/abcore-mainnet-geth
|
||||||
- traefik.http.services.abcore-mainnet-geth-pruned-pebble-path.loadbalancer.server.port=8545
|
- traefik.http.services.abcore-mainnet-geth-pruned-pebble-hash.loadbalancer.server.port=8545
|
||||||
- ${NO_SSL:-traefik.http.routers.abcore-mainnet-geth-pruned-pebble-path.entrypoints=websecure}
|
- ${NO_SSL:-traefik.http.routers.abcore-mainnet-geth-pruned-pebble-hash.entrypoints=websecure}
|
||||||
- ${NO_SSL:-traefik.http.routers.abcore-mainnet-geth-pruned-pebble-path.tls.certresolver=myresolver}
|
- ${NO_SSL:-traefik.http.routers.abcore-mainnet-geth-pruned-pebble-hash.tls.certresolver=myresolver}
|
||||||
- ${NO_SSL:-traefik.http.routers.abcore-mainnet-geth-pruned-pebble-path.rule=Host(`$DOMAIN`) && (Path(`/abcore-mainnet-geth`) || Path(`/abcore-mainnet-geth/`))}
|
- ${NO_SSL:-traefik.http.routers.abcore-mainnet-geth-pruned-pebble-hash.rule=Host(`$DOMAIN`) && (Path(`/abcore-mainnet-geth`) || Path(`/abcore-mainnet-geth/`))}
|
||||||
- ${NO_SSL:+traefik.http.routers.abcore-mainnet-geth-pruned-pebble-path.rule=Path(`/abcore-mainnet-geth`) || Path(`/abcore-mainnet-geth/`)}
|
- ${NO_SSL:+traefik.http.routers.abcore-mainnet-geth-pruned-pebble-hash.rule=Path(`/abcore-mainnet-geth`) || Path(`/abcore-mainnet-geth/`)}
|
||||||
- traefik.http.routers.abcore-mainnet-geth-pruned-pebble-path.middlewares=abcore-mainnet-geth-pruned-pebble-path-stripprefix, ipallowlist
|
- traefik.http.routers.abcore-mainnet-geth-pruned-pebble-hash.middlewares=abcore-mainnet-geth-pruned-pebble-hash-stripprefix, ipallowlist
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
abcore-mainnet-geth-pruned-pebble-path:
|
abcore-mainnet-geth-pruned-pebble-hash:
|
||||||
|
|
||||||
x-upstreams:
|
x-upstreams:
|
||||||
- id: $${ID}
|
- id: $${ID}
|
||||||
@@ -131,8 +130,6 @@ x-upstreams:
|
|||||||
- filter
|
- filter
|
||||||
methods:
|
methods:
|
||||||
disabled:
|
disabled:
|
||||||
# not compatible with path state scheme
|
|
||||||
- name: debug_traceBlockByHash
|
|
||||||
enabled:
|
enabled:
|
||||||
- name: txpool_content # TODO: should be disabled for rollup nodes
|
- name: txpool_content # TODO: should be disabled for rollup nodes
|
||||||
# standard geth only
|
# standard geth only
|
||||||
@@ -10,7 +10,7 @@ GENESIS_FILE="/config/genesis.json"
|
|||||||
if [ -z "$(ls -A "$GETH_DATA_DIR")" ]; then
|
if [ -z "$(ls -A "$GETH_DATA_DIR")" ]; then
|
||||||
echo "abcore: data directory is empty, initializing from genesis..."
|
echo "abcore: data directory is empty, initializing from genesis..."
|
||||||
if [ -f "$GENESIS_FILE" ]; then
|
if [ -f "$GENESIS_FILE" ]; then
|
||||||
/abcore/bin/geth init --datadir "$GETH_DATA_DIR" "$GENESIS_FILE"
|
/abcore/bin/geth init --datadir "$GETH_DATA_DIR" --db.engine=pebble "$GENESIS_FILE"
|
||||||
else
|
else
|
||||||
echo "abcore: genesis file not found at $GENESIS_FILE" >&2
|
echo "abcore: genesis file not found at $GENESIS_FILE" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
{
|
{
|
||||||
"chain": "mainnet",
|
"chain": "mainnet",
|
||||||
"client": "geth",
|
"client": "geth",
|
||||||
"compose_file": "abcore/geth/abcore-mainnet-geth-pruned-pebble-path",
|
"compose_file": "abcore/geth/abcore-mainnet-geth-pruned-pebble-hash",
|
||||||
"drpc_chain": "abcore",
|
"drpc_chain": "abcore",
|
||||||
"features": [
|
"features": [
|
||||||
"path",
|
"hash",
|
||||||
"pebble"
|
"pebble"
|
||||||
],
|
],
|
||||||
"network": "abcore",
|
"network": "abcore",
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"stack": null,
|
"stack": null,
|
||||||
"type": "pruned",
|
"type": "pruned",
|
||||||
"volumes": [
|
"volumes": [
|
||||||
"abcore-mainnet-geth-pruned-pebble-path"
|
"abcore-mainnet-geth-pruned-pebble-hash"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -4166,6 +4166,42 @@
|
|||||||
"morph-mainnet-l2geth-archive-leveldb-hash-mpt_morph"
|
"morph-mainnet-l2geth-archive-leveldb-hash-mpt_morph"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"chain": "mainnet-v2",
|
||||||
|
"client": "geth",
|
||||||
|
"compose_file": "mova/geth/mova-mainnet-v2-geth-archive-leveldb-hash",
|
||||||
|
"drpc_chain": "mova-mainnet-v2",
|
||||||
|
"features": [
|
||||||
|
"hash",
|
||||||
|
"leveldb"
|
||||||
|
],
|
||||||
|
"network": "mova",
|
||||||
|
"node": null,
|
||||||
|
"relay": null,
|
||||||
|
"stack": null,
|
||||||
|
"type": "archive",
|
||||||
|
"volumes": [
|
||||||
|
"mova-mainnet-v2-geth-archive-leveldb-hash"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chain": "mainnet-v2",
|
||||||
|
"client": "geth",
|
||||||
|
"compose_file": "mova/geth/mova-mainnet-v2-geth-pruned-pebble-path",
|
||||||
|
"drpc_chain": "mova-mainnet-v2",
|
||||||
|
"features": [
|
||||||
|
"path",
|
||||||
|
"pebble"
|
||||||
|
],
|
||||||
|
"network": "mova",
|
||||||
|
"node": null,
|
||||||
|
"relay": null,
|
||||||
|
"stack": null,
|
||||||
|
"type": "pruned",
|
||||||
|
"volumes": [
|
||||||
|
"mova-mainnet-v2-geth-pruned-pebble-path"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"chain": "mainnet",
|
"chain": "mainnet",
|
||||||
"client": "erigon",
|
"client": "erigon",
|
||||||
|
|||||||
@@ -61,12 +61,13 @@ services:
|
|||||||
- API=eth,txpool,net,debug,web3
|
- API=eth,txpool,net,debug,web3
|
||||||
- CHAINID=cronosmainnet_25-1
|
- CHAINID=cronosmainnet_25-1
|
||||||
- EVM_MAX_TX_GAS_WANTED=500000
|
- EVM_MAX_TX_GAS_WANTED=500000
|
||||||
|
- FEEHISTORY_CAP=250
|
||||||
- GENESIS_URL=https://raw.githubusercontent.com/crypto-org-chain/cronos-mainnet/master/cronosmainnet_25-1/genesis.json
|
- GENESIS_URL=https://raw.githubusercontent.com/crypto-org-chain/cronos-mainnet/master/cronosmainnet_25-1/genesis.json
|
||||||
- IP=${IP}
|
- IP=${IP}
|
||||||
- JSON_RPC_BLOCK_RANGE_CAP=10000
|
- JSON_RPC_BLOCK_RANGE_CAP=10000
|
||||||
- JSON_RPC_ENABLE=true
|
- JSON_RPC_ENABLE=true
|
||||||
- JSON_RPC_ENABLE_INDEXER=true
|
- JSON_RPC_ENABLE_INDEXER=true
|
||||||
- JSON_RPC_FEEHISTORY_CAP=100
|
- JSON_RPC_FEEHISTORY_CAP=250
|
||||||
- JSON_RPC_HTTP_TIMEOUT=30s
|
- JSON_RPC_HTTP_TIMEOUT=30s
|
||||||
- JSON_RPC_LOGS_CAP=10000
|
- JSON_RPC_LOGS_CAP=10000
|
||||||
- MIN_GAS=5000000000000basecro
|
- MIN_GAS=5000000000000basecro
|
||||||
|
|||||||
@@ -61,12 +61,13 @@ services:
|
|||||||
- API=eth,txpool,net,debug,web3
|
- API=eth,txpool,net,debug,web3
|
||||||
- CHAINID=cronostestnet_338-3
|
- CHAINID=cronostestnet_338-3
|
||||||
- EVM_MAX_TX_GAS_WANTED=500000
|
- EVM_MAX_TX_GAS_WANTED=500000
|
||||||
|
- FEEHISTORY_CAP=250
|
||||||
- GENESIS_URL=https://raw.githubusercontent.com/crypto-org-chain/cronos-testnets/main/cronostestnet_338-3/genesis.json
|
- GENESIS_URL=https://raw.githubusercontent.com/crypto-org-chain/cronos-testnets/main/cronostestnet_338-3/genesis.json
|
||||||
- IP=${IP}
|
- IP=${IP}
|
||||||
- JSON_RPC_BLOCK_RANGE_CAP=10000
|
- JSON_RPC_BLOCK_RANGE_CAP=10000
|
||||||
- JSON_RPC_ENABLE=true
|
- JSON_RPC_ENABLE=true
|
||||||
- JSON_RPC_ENABLE_INDEXER=true
|
- JSON_RPC_ENABLE_INDEXER=true
|
||||||
- JSON_RPC_FEEHISTORY_CAP=100
|
- JSON_RPC_FEEHISTORY_CAP=250
|
||||||
- JSON_RPC_HTTP_TIMEOUT=30s
|
- JSON_RPC_HTTP_TIMEOUT=30s
|
||||||
- JSON_RPC_LOGS_CAP=10000
|
- JSON_RPC_LOGS_CAP=10000
|
||||||
- MIN_GAS=5000000000000basetcro
|
- MIN_GAS=5000000000000basetcro
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ PRUNING_KEEP_RECENT="${PRUNING_KEEP_RECENT:-100}"
|
|||||||
PRUNING_INTERVAL="${PRUNING_INTERVAL:-19}"
|
PRUNING_INTERVAL="${PRUNING_INTERVAL:-19}"
|
||||||
JSON_RPC_ENABLE="${JSON_RPC_ENABLE:-true}"
|
JSON_RPC_ENABLE="${JSON_RPC_ENABLE:-true}"
|
||||||
JSON_RPC_ENABLE_INDEXER="${JSON_RPC_ENABLE_INDEXER:-true}"
|
JSON_RPC_ENABLE_INDEXER="${JSON_RPC_ENABLE_INDEXER:-true}"
|
||||||
JSON_RPC_FEEHISTORY_CAP="${JSON_RPC_FEEHISTORY_CAP:-100}"
|
FEEHISTORY_CAP="${FEEHISTORY_CAP:-250}"
|
||||||
|
JSON_RPC_FEEHISTORY_CAP="${JSON_RPC_FEEHISTORY_CAP:-$FEEHISTORY_CAP}"
|
||||||
JSON_RPC_LOGS_CAP="${JSON_RPC_LOGS_CAP:-10000}"
|
JSON_RPC_LOGS_CAP="${JSON_RPC_LOGS_CAP:-10000}"
|
||||||
JSON_RPC_BLOCK_RANGE_CAP="${JSON_RPC_BLOCK_RANGE_CAP:-10000}"
|
JSON_RPC_BLOCK_RANGE_CAP="${JSON_RPC_BLOCK_RANGE_CAP:-10000}"
|
||||||
JSON_RPC_HTTP_TIMEOUT="${JSON_RPC_HTTP_TIMEOUT:-30s}"
|
JSON_RPC_HTTP_TIMEOUT="${JSON_RPC_HTTP_TIMEOUT:-30s}"
|
||||||
@@ -47,7 +48,7 @@ sed -i "/^\[json-rpc\]/,/^\[/{s|^ws-origins = .*|ws-origins = \"$JSON_RPC_WS_ORI
|
|||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^api = .*|api = \"$API\"|}" "$CONFIG_DIR/app.toml"
|
sed -i "/^\[json-rpc\]/,/^\[/{s|^api = .*|api = \"$API\"|}" "$CONFIG_DIR/app.toml"
|
||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^enable = .*|enable = $JSON_RPC_ENABLE|}" "$CONFIG_DIR/app.toml"
|
sed -i "/^\[json-rpc\]/,/^\[/{s|^enable = .*|enable = $JSON_RPC_ENABLE|}" "$CONFIG_DIR/app.toml"
|
||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^enable-indexer = .*|enable-indexer = $JSON_RPC_ENABLE_INDEXER|}" "$CONFIG_DIR/app.toml"
|
sed -i "/^\[json-rpc\]/,/^\[/{s|^enable-indexer = .*|enable-indexer = $JSON_RPC_ENABLE_INDEXER|}" "$CONFIG_DIR/app.toml"
|
||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^feehistory-cap = .*|feehistory-cap = $JSON_RPC_FEEHISTORY_CAP|}" "$CONFIG_DIR/app.toml"
|
sed -i "/^\[json-rpc\]/,/^\[/{s|^feehistory-cap = .*|feehistory-cap = $FEEHISTORY_CAP|}" "$CONFIG_DIR/app.toml"
|
||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^logs-cap = .*|logs-cap = $JSON_RPC_LOGS_CAP|}" "$CONFIG_DIR/app.toml"
|
sed -i "/^\[json-rpc\]/,/^\[/{s|^logs-cap = .*|logs-cap = $JSON_RPC_LOGS_CAP|}" "$CONFIG_DIR/app.toml"
|
||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^block-range-cap = .*|block-range-cap = $JSON_RPC_BLOCK_RANGE_CAP|}" "$CONFIG_DIR/app.toml"
|
sed -i "/^\[json-rpc\]/,/^\[/{s|^block-range-cap = .*|block-range-cap = $JSON_RPC_BLOCK_RANGE_CAP|}" "$CONFIG_DIR/app.toml"
|
||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^http-timeout = .*|http-timeout = \"$JSON_RPC_HTTP_TIMEOUT\"|}" "$CONFIG_DIR/app.toml"
|
sed -i "/^\[json-rpc\]/,/^\[/{s|^http-timeout = .*|http-timeout = \"$JSON_RPC_HTTP_TIMEOUT\"|}" "$CONFIG_DIR/app.toml"
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ services:
|
|||||||
nofile: 1048576 # Max open files (for RPC/WS connections)
|
nofile: 1048576 # Max open files (for RPC/WS connections)
|
||||||
user: root
|
user: root
|
||||||
ports:
|
ports:
|
||||||
- 10127:10127
|
- 10127:9651
|
||||||
- 10127:10127/udp
|
- 10127:9651/udp
|
||||||
expose:
|
expose:
|
||||||
- 9650
|
- 9650
|
||||||
environment:
|
environment:
|
||||||
@@ -59,7 +59,7 @@ services:
|
|||||||
- AVAGO_NETWORK_ID=mainnet
|
- AVAGO_NETWORK_ID=mainnet
|
||||||
- AVAGO_PARTIAL_SYNC_PRIMARY_NETWORK=true
|
- AVAGO_PARTIAL_SYNC_PRIMARY_NETWORK=true
|
||||||
- AVAGO_PLUGIN_DIR=/plugins/
|
- AVAGO_PLUGIN_DIR=/plugins/
|
||||||
- AVAGO_STAKING_PORT=10127
|
- AVAGO_STAKING_PORT=9651
|
||||||
- AVAGO_TRACK_SUBNETS=21uUaTxVdR3Sp6SJhpcSrdH1g66aFoE8mPQDvwKJCjXNexo5y6
|
- AVAGO_TRACK_SUBNETS=21uUaTxVdR3Sp6SJhpcSrdH1g66aFoE8mPQDvwKJCjXNexo5y6
|
||||||
- KITE_CHAIN_ID=3USaEfTcoUhHxpKXvpAG916UKCUEyjrtkg2hBArBG3JyDP7my
|
- KITE_CHAIN_ID=3USaEfTcoUhHxpKXvpAG916UKCUEyjrtkg2hBArBG3JyDP7my
|
||||||
- PLUGIN_ID=pJhES6xZkqZxjxMqHiucbpBTTnB97EjL5aTYSynmWBoF26v9e
|
- PLUGIN_ID=pJhES6xZkqZxjxMqHiucbpBTTnB97EjL5aTYSynmWBoF26v9e
|
||||||
|
|||||||
139
mova/geth/mova-mainnet-v2-geth-archive-leveldb-hash.yml
Normal file
139
mova/geth/mova-mainnet-v2-geth-archive-leveldb-hash.yml
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
---
|
||||||
|
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:mova/geth/mova-mainnet-v2-geth-archive-leveldb-hash.yml
|
||||||
|
#
|
||||||
|
# docker compose up -d
|
||||||
|
#
|
||||||
|
# curl -X POST https://${IP}.traefik.me/mova-mainnet-v2-geth-archive \
|
||||||
|
# -H "Content-Type: application/json" \
|
||||||
|
# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
|
||||||
|
|
||||||
|
services:
|
||||||
|
mova-mainnet-v2-geth-archive:
|
||||||
|
image: ${MOVA_GETH_IMAGE:-ethereum/client-go}:${MOVA_MAINNET_V2_GETH_VERSION:-v1.17.4}
|
||||||
|
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:
|
||||||
|
- 11121:11121
|
||||||
|
- 11121:11121/udp
|
||||||
|
expose:
|
||||||
|
- 8545
|
||||||
|
- 6060
|
||||||
|
command:
|
||||||
|
- --datadir=/root/.ethereum
|
||||||
|
- --db.engine=leveldb
|
||||||
|
- --gcmode=archive
|
||||||
|
- --http
|
||||||
|
- --http.addr=0.0.0.0
|
||||||
|
- --http.api=eth,net,web3,debug,admin,txpool,engine
|
||||||
|
- --http.port=8545
|
||||||
|
- --http.vhosts=*
|
||||||
|
- --maxpeers=50
|
||||||
|
- --metrics
|
||||||
|
- --metrics.addr=0.0.0.0
|
||||||
|
- --metrics.port=6060
|
||||||
|
- --nat=extip:${IP}
|
||||||
|
- --port=11121
|
||||||
|
- --rpc.gascap=600000000
|
||||||
|
- --rpc.txfeecap=0
|
||||||
|
- --state.scheme=hash
|
||||||
|
- --syncmode=full
|
||||||
|
- --ws
|
||||||
|
- --ws.addr=0.0.0.0
|
||||||
|
- --ws.api=eth,net,web3,debug,admin,txpool,engine
|
||||||
|
- --ws.origins=*
|
||||||
|
- --ws.port=8545
|
||||||
|
restart: unless-stopped
|
||||||
|
stop_grace_period: 5m
|
||||||
|
networks:
|
||||||
|
- chains
|
||||||
|
volumes:
|
||||||
|
- ${MOVA_MAINNET_V2_GETH_ARCHIVE_LEVELDB_HASH_DATA:-mova-mainnet-v2-geth-archive-leveldb-hash}:/root/.ethereum
|
||||||
|
- /slowdisk:/slowdisk
|
||||||
|
logging: *logging-defaults
|
||||||
|
labels:
|
||||||
|
- prometheus-scrape.enabled=true
|
||||||
|
- prometheus-scrape.port=6060
|
||||||
|
- prometheus-scrape.path=/debug/metrics/prometheus
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.http.middlewares.mova-mainnet-v2-geth-archive-leveldb-hash-stripprefix.stripprefix.prefixes=/mova-mainnet-v2-geth-archive
|
||||||
|
- traefik.http.services.mova-mainnet-v2-geth-archive-leveldb-hash.loadbalancer.server.port=8545
|
||||||
|
- ${NO_SSL:-traefik.http.routers.mova-mainnet-v2-geth-archive-leveldb-hash.entrypoints=websecure}
|
||||||
|
- ${NO_SSL:-traefik.http.routers.mova-mainnet-v2-geth-archive-leveldb-hash.tls.certresolver=myresolver}
|
||||||
|
- ${NO_SSL:-traefik.http.routers.mova-mainnet-v2-geth-archive-leveldb-hash.rule=Host(`$DOMAIN`) && (Path(`/mova-mainnet-v2-geth-archive`) || Path(`/mova-mainnet-v2-geth-archive/`))}
|
||||||
|
- ${NO_SSL:+traefik.http.routers.mova-mainnet-v2-geth-archive-leveldb-hash.rule=Path(`/mova-mainnet-v2-geth-archive`) || Path(`/mova-mainnet-v2-geth-archive/`)}
|
||||||
|
- traefik.http.routers.mova-mainnet-v2-geth-archive-leveldb-hash.middlewares=mova-mainnet-v2-geth-archive-leveldb-hash-stripprefix, ipallowlist
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mova-mainnet-v2-geth-archive-leveldb-hash:
|
||||||
|
|
||||||
|
x-upstreams:
|
||||||
|
- id: $${ID}
|
||||||
|
labels:
|
||||||
|
provider: $${PROVIDER}
|
||||||
|
connection:
|
||||||
|
generic:
|
||||||
|
rpc:
|
||||||
|
url: $${RPC_URL}
|
||||||
|
ws:
|
||||||
|
frameSize: 20Mb
|
||||||
|
msgSize: 50Mb
|
||||||
|
url: $${WS_URL}
|
||||||
|
chain: mova-mainnet-v2
|
||||||
|
method-groups:
|
||||||
|
enabled:
|
||||||
|
- debug
|
||||||
|
- filter
|
||||||
|
methods:
|
||||||
|
disabled:
|
||||||
|
enabled:
|
||||||
|
- name: txpool_content # TODO: should be disabled for rollup nodes
|
||||||
|
# standard geth only
|
||||||
|
- name: debug_getRawBlock
|
||||||
|
- name: debug_getRawTransaction
|
||||||
|
- name: debug_getRawReceipts
|
||||||
|
- name: debug_getRawHeader
|
||||||
|
- name: debug_getBadBlocks
|
||||||
|
# non standard geth only slightly dangerous
|
||||||
|
- name: debug_intermediateRoots
|
||||||
|
- name: debug_dumpBlock
|
||||||
|
# standard geth and erigon
|
||||||
|
- name: debug_accountRange
|
||||||
|
- name: debug_getModifiedAccountsByNumber
|
||||||
|
- name: debug_getModifiedAccountsByHash
|
||||||
|
# non standard geth and erigon
|
||||||
|
- name: eth_getRawTransactionByHash
|
||||||
|
- name: eth_getRawTransactionByBlockHashAndIndex
|
||||||
|
...
|
||||||
141
mova/geth/mova-mainnet-v2-geth-pruned-pebble-path.yml
Normal file
141
mova/geth/mova-mainnet-v2-geth-pruned-pebble-path.yml
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
---
|
||||||
|
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:mova/geth/mova-mainnet-v2-geth-pruned-pebble-path.yml
|
||||||
|
#
|
||||||
|
# docker compose up -d
|
||||||
|
#
|
||||||
|
# curl -X POST https://${IP}.traefik.me/mova-mainnet-v2-geth \
|
||||||
|
# -H "Content-Type: application/json" \
|
||||||
|
# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
|
||||||
|
|
||||||
|
services:
|
||||||
|
mova-mainnet-v2-geth:
|
||||||
|
image: ${MOVA_GETH_IMAGE:-ethereum/client-go}:${MOVA_MAINNET_V2_GETH_VERSION:-v1.17.4}
|
||||||
|
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:
|
||||||
|
- 11242:11242
|
||||||
|
- 11242:11242/udp
|
||||||
|
expose:
|
||||||
|
- 8545
|
||||||
|
- 6060
|
||||||
|
command:
|
||||||
|
- --datadir=/root/.ethereum
|
||||||
|
- --db.engine=pebble
|
||||||
|
- --gcmode=full
|
||||||
|
- --http
|
||||||
|
- --http.addr=0.0.0.0
|
||||||
|
- --http.api=eth,net,web3,debug,admin,txpool,engine
|
||||||
|
- --http.port=8545
|
||||||
|
- --http.vhosts=*
|
||||||
|
- --maxpeers=50
|
||||||
|
- --metrics
|
||||||
|
- --metrics.addr=0.0.0.0
|
||||||
|
- --metrics.port=6060
|
||||||
|
- --nat=extip:${IP}
|
||||||
|
- --port=11242
|
||||||
|
- --rpc.gascap=600000000
|
||||||
|
- --rpc.txfeecap=0
|
||||||
|
- --state.scheme=path
|
||||||
|
- --syncmode=snap
|
||||||
|
- --ws
|
||||||
|
- --ws.addr=0.0.0.0
|
||||||
|
- --ws.api=eth,net,web3,debug,admin,txpool,engine
|
||||||
|
- --ws.origins=*
|
||||||
|
- --ws.port=8545
|
||||||
|
restart: unless-stopped
|
||||||
|
stop_grace_period: 5m
|
||||||
|
networks:
|
||||||
|
- chains
|
||||||
|
volumes:
|
||||||
|
- ${MOVA_MAINNET_V2_GETH_PRUNED_PEBBLE_PATH_DATA:-mova-mainnet-v2-geth-pruned-pebble-path}:/root/.ethereum
|
||||||
|
- /slowdisk:/slowdisk
|
||||||
|
logging: *logging-defaults
|
||||||
|
labels:
|
||||||
|
- prometheus-scrape.enabled=true
|
||||||
|
- prometheus-scrape.port=6060
|
||||||
|
- prometheus-scrape.path=/debug/metrics/prometheus
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.http.middlewares.mova-mainnet-v2-geth-pruned-pebble-path-stripprefix.stripprefix.prefixes=/mova-mainnet-v2-geth
|
||||||
|
- traefik.http.services.mova-mainnet-v2-geth-pruned-pebble-path.loadbalancer.server.port=8545
|
||||||
|
- ${NO_SSL:-traefik.http.routers.mova-mainnet-v2-geth-pruned-pebble-path.entrypoints=websecure}
|
||||||
|
- ${NO_SSL:-traefik.http.routers.mova-mainnet-v2-geth-pruned-pebble-path.tls.certresolver=myresolver}
|
||||||
|
- ${NO_SSL:-traefik.http.routers.mova-mainnet-v2-geth-pruned-pebble-path.rule=Host(`$DOMAIN`) && (Path(`/mova-mainnet-v2-geth`) || Path(`/mova-mainnet-v2-geth/`))}
|
||||||
|
- ${NO_SSL:+traefik.http.routers.mova-mainnet-v2-geth-pruned-pebble-path.rule=Path(`/mova-mainnet-v2-geth`) || Path(`/mova-mainnet-v2-geth/`)}
|
||||||
|
- traefik.http.routers.mova-mainnet-v2-geth-pruned-pebble-path.middlewares=mova-mainnet-v2-geth-pruned-pebble-path-stripprefix, ipallowlist
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mova-mainnet-v2-geth-pruned-pebble-path:
|
||||||
|
|
||||||
|
x-upstreams:
|
||||||
|
- id: $${ID}
|
||||||
|
labels:
|
||||||
|
provider: $${PROVIDER}
|
||||||
|
connection:
|
||||||
|
generic:
|
||||||
|
rpc:
|
||||||
|
url: $${RPC_URL}
|
||||||
|
ws:
|
||||||
|
frameSize: 20Mb
|
||||||
|
msgSize: 50Mb
|
||||||
|
url: $${WS_URL}
|
||||||
|
chain: mova-mainnet-v2
|
||||||
|
method-groups:
|
||||||
|
enabled:
|
||||||
|
- debug
|
||||||
|
- filter
|
||||||
|
methods:
|
||||||
|
disabled:
|
||||||
|
# not compatible with path state scheme
|
||||||
|
- name: debug_traceBlockByHash
|
||||||
|
enabled:
|
||||||
|
- name: txpool_content # TODO: should be disabled for rollup nodes
|
||||||
|
# standard geth only
|
||||||
|
- name: debug_getRawBlock
|
||||||
|
- name: debug_getRawTransaction
|
||||||
|
- name: debug_getRawReceipts
|
||||||
|
- name: debug_getRawHeader
|
||||||
|
- name: debug_getBadBlocks
|
||||||
|
# non standard geth only slightly dangerous
|
||||||
|
- name: debug_intermediateRoots
|
||||||
|
- name: debug_dumpBlock
|
||||||
|
# standard geth and erigon
|
||||||
|
- name: debug_accountRange
|
||||||
|
- name: debug_getModifiedAccountsByNumber
|
||||||
|
- name: debug_getModifiedAccountsByHash
|
||||||
|
# non standard geth and erigon
|
||||||
|
- name: eth_getRawTransactionByHash
|
||||||
|
- name: eth_getRawTransactionByBlockHashAndIndex
|
||||||
|
...
|
||||||
@@ -30,7 +30,7 @@ x-logging-defaults: &logging-defaults
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
zircuit-garfield-op-reth-pruned:
|
zircuit-garfield-op-reth-pruned:
|
||||||
image: ${ZIRCUIT_RETH_IMAGE:-ghcr.io/conduitxyz/conduit-op-reth}:${ZIRCUIT_GARFIELD_RETH_VERSION:-v2.1.2}
|
image: ${ZIRCUIT_RETH_IMAGE:-ghcr.io/conduitxyz/conduit-op-reth}:${ZIRCUIT_GARFIELD_RETH_VERSION:-v2.1.1}
|
||||||
sysctls:
|
sysctls:
|
||||||
# TCP Performance
|
# TCP Performance
|
||||||
net.ipv4.tcp_slow_start_after_idle: 0 # Disable slow start after idle
|
net.ipv4.tcp_slow_start_after_idle: 0 # Disable slow start after idle
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ x-logging-defaults: &logging-defaults
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
zircuit-mainnet-op-reth-pruned:
|
zircuit-mainnet-op-reth-pruned:
|
||||||
image: ${ZIRCUIT_RETH_IMAGE:-ghcr.io/conduitxyz/conduit-op-reth}:${ZIRCUIT_MAINNET_RETH_VERSION:-v2.1.2}
|
image: ${ZIRCUIT_RETH_IMAGE:-ghcr.io/conduitxyz/conduit-op-reth}:${ZIRCUIT_MAINNET_RETH_VERSION:-v2.1.1}
|
||||||
sysctls:
|
sysctls:
|
||||||
# TCP Performance
|
# TCP Performance
|
||||||
net.ipv4.tcp_slow_start_after_idle: 0 # Disable slow start after idle
|
net.ipv4.tcp_slow_start_after_idle: 0 # Disable slow start after idle
|
||||||
|
|||||||
@@ -3441,6 +3441,7 @@
|
|||||||
"syncing_lag": 40,
|
"syncing_lag": 40,
|
||||||
"urls": [
|
"urls": [
|
||||||
"https://rpc.testnet.chain.robinhood.com/rpc",
|
"https://rpc.testnet.chain.robinhood.com/rpc",
|
||||||
|
"https://robinhood-sepolia-rpc.publicnode.com",
|
||||||
"https://robinhood-testnet.drpc.org"
|
"https://robinhood-testnet.drpc.org"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,6 +5,137 @@
|
|||||||
# survive every configure-drpc regeneration. See apply-dshackle-overrides.py.
|
# survive every configure-drpc regeneration. See apply-dshackle-overrides.py.
|
||||||
[ -f /root/rpc/apply-dshackle-overrides.py ] && python3 /root/rpc/apply-dshackle-overrides.py
|
[ -f /root/rpc/apply-dshackle-overrides.py ] && python3 /root/rpc/apply-dshackle-overrides.py
|
||||||
|
|
||||||
|
# --- Snapshot-based conditional gateway reconnect ---
|
||||||
|
# Operator ruling (2026-08-27): NEVER force a reconnect on a routine reload/rpc-update run.
|
||||||
|
# Only upstream REMOVALS or new disabled-method ADDITIONS require a gateway reconnect.
|
||||||
|
#
|
||||||
|
# For each dshackle container, we snapshot the advertised set:
|
||||||
|
# (a) upstream ids present in rendered yaml configs
|
||||||
|
# (b) disabled-method entries (from methods.disabled across all upstreams)
|
||||||
|
# into a persisted file: /root/rpc/.dshackle-adv-<container>.snapshot
|
||||||
|
#
|
||||||
|
# On each run:
|
||||||
|
# - Read current config state from disk
|
||||||
|
# - If previous snapshot exists, compare: drop connections ONLY IF
|
||||||
|
# * an upstream id disappeared (was in snapshot, not in current), OR
|
||||||
|
# * a new disabled-method entry appeared (in current, not in snapshot)
|
||||||
|
# - Pure additions or no change: reload only, no drop
|
||||||
|
# - First run with no prior snapshot: do NOT drop, just write snapshot after reload
|
||||||
|
# - Always rewrite snapshot after successful reload (for next run to compare against)
|
||||||
|
# - All snapshot/compare operations are best-effort; failures never fail the script
|
||||||
|
|
||||||
|
# Helper: extract the host config directory path for a dshackle container.
|
||||||
|
# dshackle containers mount their config at /etc/dshackle; we find the source of that mount.
|
||||||
|
get_config_dir() {
|
||||||
|
local cid="$1"
|
||||||
|
local mount
|
||||||
|
mount=$(docker inspect -f '{{range .Mounts}}{{if eq .Destination "/etc/dshackle"}}{{.Source}}{{end}}{{end}}' "$cid" 2>/dev/null) || true
|
||||||
|
[ -n "$mount" ] && echo "$mount" && return 0
|
||||||
|
# Fallback: try common locations (best-effort)
|
||||||
|
for d in /root/rpc/main_configs /root/rpc/free_configs; do
|
||||||
|
[ -d "$d" ] && echo "$d" && return 0
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper: extract advertised set (upstream ids + disabled methods) from config directory.
|
||||||
|
# Outputs two lines to stdout:
|
||||||
|
# upstream_ids (space-separated, sorted)
|
||||||
|
# disabled_methods (space-separated, sorted)
|
||||||
|
get_advertised_set() {
|
||||||
|
local config_dir="$1"
|
||||||
|
local upstream_ids=""
|
||||||
|
local disabled_methods=""
|
||||||
|
|
||||||
|
[ -d "$config_dir" ] || return 1
|
||||||
|
|
||||||
|
# Use python3 to parse YAML (available on host). Best-effort: if python fails, return empty.
|
||||||
|
python3 -c "
|
||||||
|
import yaml, glob, sys, os
|
||||||
|
config_dir = sys.argv[1]
|
||||||
|
upstream_ids = set()
|
||||||
|
disabled_methods = set()
|
||||||
|
for path in glob.glob(os.path.join(config_dir, '*.yaml')):
|
||||||
|
try:
|
||||||
|
with open(path) as f:
|
||||||
|
doc = yaml.safe_load(f)
|
||||||
|
if not isinstance(doc, dict):
|
||||||
|
continue
|
||||||
|
for up in doc.get('upstreams') or []:
|
||||||
|
if not isinstance(up, dict):
|
||||||
|
continue
|
||||||
|
uid = up.get('id')
|
||||||
|
if uid:
|
||||||
|
upstream_ids.add(uid)
|
||||||
|
methods = up.get('methods', {})
|
||||||
|
if isinstance(methods, dict):
|
||||||
|
for m in methods.get('disabled') or []:
|
||||||
|
if isinstance(m, dict):
|
||||||
|
name = m.get('name')
|
||||||
|
if name:
|
||||||
|
disabled_methods.add(name)
|
||||||
|
elif isinstance(m, str):
|
||||||
|
disabled_methods.add(m)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
print(' '.join(sorted(upstream_ids)))
|
||||||
|
print(' '.join(sorted(disabled_methods)))
|
||||||
|
" "$config_dir" 2>/dev/null
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper: read snapshot file. Returns upstream_ids and disabled_methods.
|
||||||
|
read_snapshot() {
|
||||||
|
local snapshot_file="$1"
|
||||||
|
[ -f "$snapshot_file" ] || return 1
|
||||||
|
local line1 line2
|
||||||
|
line1=$(head -1 "$snapshot_file" 2>/dev/null) || true
|
||||||
|
line2=$(tail -1 "$snapshot_file" 2>/dev/null) || true
|
||||||
|
[ -n "$line1" ] && echo "$line1"
|
||||||
|
[ -n "$line2" ] && echo "$line2"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper: write snapshot file.
|
||||||
|
write_snapshot() {
|
||||||
|
local snapshot_file="$1"
|
||||||
|
local upstream_ids="$2"
|
||||||
|
local disabled_methods="$3"
|
||||||
|
echo "$upstream_ids" > "$snapshot_file" 2>/dev/null || true
|
||||||
|
echo "$disabled_methods" >> "$snapshot_file" 2>/dev/null || true
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper: check if drop is needed.
|
||||||
|
# Args: old_upstream_ids, old_disabled_methods, new_upstream_ids, new_disabled_methods
|
||||||
|
# Returns 0 (true) if drop is needed, 1 (false) otherwise.
|
||||||
|
drop_needed() {
|
||||||
|
local old_ids="$1" new_ids="$3"
|
||||||
|
local old_methods="$2" new_methods="$4"
|
||||||
|
|
||||||
|
# Check if any upstream id disappeared (in old, not in new)
|
||||||
|
for uid in $old_ids; do
|
||||||
|
[ -z "$uid" ] && continue
|
||||||
|
# Check if uid is NOT in new_ids
|
||||||
|
found=0
|
||||||
|
for nuid in $new_ids; do
|
||||||
|
[ "$uid" = "$nuid" ] && found=1 && break
|
||||||
|
done
|
||||||
|
[ "$found" = 0 ] && return 0 # drop needed
|
||||||
|
done
|
||||||
|
|
||||||
|
# Check if any new disabled method appeared (in new, not in old)
|
||||||
|
for meth in $new_methods; do
|
||||||
|
[ -z "$meth" ] && continue
|
||||||
|
found=0
|
||||||
|
for ometh in $old_methods; do
|
||||||
|
[ "$meth" = "$ometh" ] && found=1 && break
|
||||||
|
done
|
||||||
|
[ "$found" = 0 ] && return 0 # drop needed
|
||||||
|
done
|
||||||
|
|
||||||
|
return 1 # no drop needed
|
||||||
|
}
|
||||||
|
|
||||||
# 1:1 invariant (2026-07-15): refuse to ACTIVATE a dshackle config routing >1 node for the same
|
# 1:1 invariant (2026-07-15): refuse to ACTIVATE a dshackle config routing >1 node for the same
|
||||||
# chain — we can't attribute traffic to multiple nodes behind one proxy (no per-upstream request
|
# chain — we can't attribute traffic to multiple nodes behind one proxy (no per-upstream request
|
||||||
# metric; conn-seconds biases it), and the attribution model + planner assume 1:1. The validator
|
# metric; conn-seconds biases it), and the attribution model + planner assume 1:1. The validator
|
||||||
@@ -37,6 +168,40 @@ RC=0
|
|||||||
for CID in $(docker ps -q -f "name=dshackle"); do
|
for CID in $(docker ps -q -f "name=dshackle"); do
|
||||||
NAME=$(docker inspect -f '{{.Name}}' "$CID" 2>/dev/null | sed 's|^/||')
|
NAME=$(docker inspect -f '{{.Name}}' "$CID" 2>/dev/null | sed 's|^/||')
|
||||||
[ -n "$NAME" ] || NAME="$CID"
|
[ -n "$NAME" ] || NAME="$CID"
|
||||||
|
|
||||||
|
# --- Snapshot-based conditional gateway reconnect ---
|
||||||
|
# Determine config directory and snapshot file for this container.
|
||||||
|
CONFIG_DIR=$(get_config_dir "$CID") || true
|
||||||
|
# Sanitize name for use in snapshot filename: replace / with -, remove leading -
|
||||||
|
SANITIZED_NAME=$(echo "$NAME" | tr '/' '-' | sed 's/^-//')
|
||||||
|
SNAPSHOT_FILE="/root/rpc/.dshackle-adv-${SANITIZED_NAME}.snapshot"
|
||||||
|
|
||||||
|
# Read current advertised set from the (new) on-disk config.
|
||||||
|
CURRENT_SET=$(get_advertised_set "$CONFIG_DIR") || true
|
||||||
|
CURRENT_UPSTREAMS=$(echo "$CURRENT_SET" | head -1 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
|
CURRENT_METHODS=$(echo "$CURRENT_SET" | tail -1 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
|
|
||||||
|
# Read previous snapshot if it exists.
|
||||||
|
PREVIOUS_UPSTREAMS=""
|
||||||
|
PREVIOUS_METHODS=""
|
||||||
|
HAS_PREVIOUS_SNAPSHOT=0
|
||||||
|
if [ -f "$SNAPSHOT_FILE" ]; then
|
||||||
|
PREVIOUS_SET=$(read_snapshot "$SNAPSHOT_FILE") || true
|
||||||
|
PREVIOUS_UPSTREAMS=$(echo "$PREVIOUS_SET" | head -1 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
|
PREVIOUS_METHODS=$(echo "$PREVIOUS_SET" | tail -1 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
|
HAS_PREVIOUS_SNAPSHOT=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Decide if we need to drop connections: only if there were removals.
|
||||||
|
NEED_DROP=0
|
||||||
|
if [ "$HAS_PREVIOUS_SNAPSHOT" -eq 1 ]; then
|
||||||
|
# Has previous snapshot: check for removals
|
||||||
|
if drop_needed "$PREVIOUS_UPSTREAMS" "$PREVIOUS_METHODS" "$CURRENT_UPSTREAMS" "$CURRENT_METHODS"; then
|
||||||
|
NEED_DROP=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# If no previous snapshot, NEED_DROP stays 0 (first run: do NOT drop)
|
||||||
|
|
||||||
T0=$(date +%s)
|
T0=$(date +%s)
|
||||||
if ! docker kill --signal=HUP "$CID" >/dev/null 2>&1; then
|
if ! docker kill --signal=HUP "$CID" >/dev/null 2>&1; then
|
||||||
echo "reload_dshackle: WARNING: failed to SIGHUP $NAME" >&2
|
echo "reload_dshackle: WARNING: failed to SIGHUP $NAME" >&2
|
||||||
@@ -51,7 +216,20 @@ for CID in $(docker ps -q -f "name=dshackle"); do
|
|||||||
elif echo "$LOGS" | grep -qF "$DROP_MARK"; then
|
elif echo "$LOGS" | grep -qF "$DROP_MARK"; then
|
||||||
REASON="concurrent HUP dropped (reload skipped)"
|
REASON="concurrent HUP dropped (reload skipped)"
|
||||||
fi
|
fi
|
||||||
[ -z "$REASON" ] && continue # SIGHUP applied the config — done
|
[ -z "$REASON" ] && {
|
||||||
|
# Reload succeeded. Always rewrite snapshot for next run.
|
||||||
|
write_snapshot "$SNAPSHOT_FILE" "$CURRENT_UPSTREAMS" "$CURRENT_METHODS"
|
||||||
|
|
||||||
|
# Drop established gateway gRPC connections ONLY if removals were detected.
|
||||||
|
if [ "$NEED_DROP" -eq 1 ]; then
|
||||||
|
PID=$(docker inspect -f '{{.State.Pid}}' "$CID" 2>/dev/null) && \
|
||||||
|
nsenter -t "$PID" -n ss -K state established '( sport = :2449 )' >/dev/null 2>&1
|
||||||
|
echo "reload_dshackle: $NAME reload applied, gateway connections dropped (removals detected)" >&2
|
||||||
|
else
|
||||||
|
echo "reload_dshackle: $NAME reload applied, no removals — gateway connections kept" >&2
|
||||||
|
fi
|
||||||
|
continue
|
||||||
|
}
|
||||||
echo "reload_dshackle: $NAME reload did NOT apply ($REASON) — restarting to load config fresh" >&2
|
echo "reload_dshackle: $NAME reload did NOT apply ($REASON) — restarting to load config fresh" >&2
|
||||||
if ! docker restart "$CID" >/dev/null 2>&1; then
|
if ! docker restart "$CID" >/dev/null 2>&1; then
|
||||||
echo "reload_dshackle: ERROR: restart failed for $NAME — config NOT applied, manual intervention" >&2
|
echo "reload_dshackle: ERROR: restart failed for $NAME — config NOT applied, manual intervention" >&2
|
||||||
@@ -64,7 +242,15 @@ for CID in $(docker ps -q -f "name=dshackle"); do
|
|||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
if [ -n "$UP" ]; then
|
if [ -n "$UP" ]; then
|
||||||
|
# Restart succeeded. Always rewrite snapshot for next run.
|
||||||
|
write_snapshot "$SNAPSHOT_FILE" "$CURRENT_UPSTREAMS" "$CURRENT_METHODS"
|
||||||
echo "reload_dshackle: $NAME restarted, config applied on clean start" >&2
|
echo "reload_dshackle: $NAME restarted, config applied on clean start" >&2
|
||||||
|
# On restart, the config is freshly loaded, so we need to drop if removals were detected.
|
||||||
|
if [ "$NEED_DROP" -eq 1 ]; then
|
||||||
|
PID=$(docker inspect -f '{{.State.Pid}}' "$CID" 2>/dev/null) && \
|
||||||
|
nsenter -t "$PID" -n ss -K state established '( sport = :2449 )' >/dev/null 2>&1
|
||||||
|
echo "reload_dshackle: $NAME restart applied, gateway connections dropped (removals detected)" >&2
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "reload_dshackle: ERROR: $NAME not running after restart — manual intervention" >&2
|
echo "reload_dshackle: ERROR: $NAME not running after restart — manual intervention" >&2
|
||||||
RC=1
|
RC=1
|
||||||
|
|||||||
Reference in New Issue
Block a user