Compare commits
4 Commits
issue-3056
...
zerog-tarb
| Author | SHA1 | Date | |
|---|---|---|---|
| 6df9f0f17a | |||
| 561ff43828 | |||
| cfac32736e | |||
| 799209b5d2 |
@@ -1,49 +1,64 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# haqq entrypoint — family C, cosmos app with built-in EVM JSON-RPC (C2).
|
|
||||||
# Uses the shared cometbft-common.sh helpers and injects official mainnet seeds.
|
|
||||||
set -e
|
|
||||||
. /usr/local/bin/cometbft-common.sh
|
|
||||||
|
|
||||||
HOME_DIR="/root/.haqqd"
|
set -e # Exit on failure
|
||||||
CONFIG_DIR="$HOME_DIR/config"
|
|
||||||
CHAINID="${CHAINID:-haqq_11235-1}"
|
|
||||||
CHAINNAME="${CHAINNAME:-mainnet}"
|
|
||||||
API="${API:-eth,txpool,net,debug,web3}"
|
|
||||||
GENESIS_URL="${GENESIS_URL:-https://raw.githubusercontent.com/haqq-network/${CHAINNAME}/master/genesis.json}"
|
|
||||||
ADDRBOOK_URL="${ADDRBOOK_URL:-https://raw.githubusercontent.com/haqq-network/${CHAINNAME}/master/addrbook.json}"
|
|
||||||
|
|
||||||
# Official HAQQ mainnet seeds
|
echo "MONIKER: $MONIKER"
|
||||||
SEEDS="861e5892470275a394ebab407e8d62b1931843d3@192.248.181.17:26656,e1b058e5cfa2b836ddaa496b10911da62dcf182e@haqq-seed-de.allnodes.me:26656,e726816f42831689eab9378d5d577f1d06d25716@haqq-seed-us.allnodes.me:26656,0533e20e65912f72f2ad88a4c91eefbc634212d7@haqq-sync.rpc.p2p.world:26656,c45991e0098b9cacb8603caf4e1cdb7e6e5f87c0@eu.seed.haqq.network:26656,e37cb47590ba46b503269ef255873e9698244d8b@us.seed.haqq.network:26656,c593e93e1fb8be8b48d4e7bab514a227aa620bf8@as.seed.haqq.network:26656,0265238d4845e041868d610c100b88f485eeddfb@rpc.haqq.nodestake.top:666"
|
|
||||||
|
|
||||||
ct_apk curl
|
CHAINID=${CHAINID:-haqq_11235-1}
|
||||||
|
CHAINNAME=${CHAINNAME:-mainnet}
|
||||||
|
API=${API:-eth,net,web3}
|
||||||
|
|
||||||
if haqqd init "$MONIKER" --chain-id "$CHAINID" --home "$HOME_DIR"; then
|
CONFIG_DIR="/root/.haqqd/config"
|
||||||
ct_log "fresh init; fetching config"
|
|
||||||
ct_fetch "$GENESIS_URL" "$CONFIG_DIR/genesis.json" required
|
# Create config directory
|
||||||
ct_fetch "$ADDRBOOK_URL" "$CONFIG_DIR/addrbook.json" optional
|
mkdir -p "$CONFIG_DIR"
|
||||||
ct_localize_home "$CONFIG_DIR"
|
|
||||||
ct_set_min_gas_prices "$CONFIG_DIR/app.toml" "0.01hqq"
|
P2P_STRING="tcp:\\/\\/0\\.0\\.0\\.0\\:${P2P_PORT:-10465}"
|
||||||
|
NAT_STRING="${IP}:${P2P_PORT:-10465}"
|
||||||
|
|
||||||
|
env
|
||||||
|
|
||||||
|
# this goes first because it won't overwrite shit
|
||||||
|
apk add curl
|
||||||
|
if [ $? -ne 0 ]; then exit 1; fi
|
||||||
|
|
||||||
|
if haqqd init ${MONIKER} --chain-id ${CHAINID} --home /root/.haqqd/; then
|
||||||
|
# Define variables
|
||||||
|
GENESIS_URL="https://raw.githubusercontent.com/haqq-network/${CHAINNAME}/master/genesis.json"
|
||||||
|
ADDRESSBOOK_URL="https://raw.githubusercontent.com/haqq-network/${CHAINNAME}/master/addrbook.json"
|
||||||
|
|
||||||
|
# Download config files
|
||||||
|
curl -sL "$GENESIS_URL" -o "$CONFIG_DIR/genesis.json"
|
||||||
|
curl -sL "$ADDRESSBOOK_URL" -o "$CONFIG_DIR/addressbook.json"
|
||||||
|
|
||||||
|
# somehow it's better to make home static to /root
|
||||||
|
sed -i 's|~/|/root/|g' "$CONFIG_DIR/config.toml"
|
||||||
|
sed -i 's|~/|/root/|g' "$CONFIG_DIR/app.toml"
|
||||||
else
|
else
|
||||||
ct_log "already initialized, continuing"
|
echo "Already initialized, continuing!" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable JSON-RPC with correct settings
|
|
||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^enable = .*|enable = true|}" "$CONFIG_DIR/app.toml"
|
# apply a port change to the config
|
||||||
|
sed -i "/^\[p2p\]/,/^\[/{s|^laddr = .*|laddr = \"$P2P_STRING\"|}" "$CONFIG_DIR/config.toml"
|
||||||
|
#sed -i "s/^laddr = \".*\"/laddr = \"$P2P_STRING\"/" "$CONFIG_DIR/config.toml"
|
||||||
|
sed -i "/^\[p2p\]/,/^\[/{s|^external_address = .*|external_address = \"$NAT_STRING\"|}" "$CONFIG_DIR/config.toml"
|
||||||
|
|
||||||
|
#sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0.01hqq"/g' $CONFIG_DIR/app.toml
|
||||||
|
|
||||||
|
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $CONFIG_DIR/app.toml
|
||||||
|
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $CONFIG_DIR/app.toml
|
||||||
|
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"19\"/" $CONFIG_DIR/app.toml
|
||||||
|
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $CONFIG_DIR/config.toml
|
||||||
|
|
||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^address = .*|address = \"0.0.0.0:8545\"|}" "$CONFIG_DIR/app.toml"
|
sed -i "/^\[json-rpc\]/,/^\[/{s|^address = .*|address = \"0.0.0.0:8545\"|}" "$CONFIG_DIR/app.toml"
|
||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^ws-address = .*|ws-address = \"0.0.0.0:8546\"|}" "$CONFIG_DIR/app.toml"
|
sed -i "/^\[json-rpc\]/,/^\[/{s|^ws-address = .*|ws-address = \"0.0.0.0:8546\"|}" "$CONFIG_DIR/app.toml"
|
||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^metrics-address = .*|metrics-address = \"0.0.0.0:6065\"|}" "$CONFIG_DIR/app.toml"
|
sed -i "/^\[json-rpc\]/,/^\[/{s|^metrics-address = .*|metrics-address = \"0.0.0.0:6065\"|}" "$CONFIG_DIR/app.toml"
|
||||||
sed -i "/^\[json-rpc\]/,/^\[/{s|^api = .*|api = \"$API\"|}" "$CONFIG_DIR/app.toml"
|
sed -i "/^\[json-rpc\]/,/^\[/{s|^api = .*|api = \"$API\"|}" "$CONFIG_DIR/app.toml"
|
||||||
|
|
||||||
# Pruning + indexing settings
|
# Update moniker if set
|
||||||
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" "$CONFIG_DIR/app.toml"
|
if [ -n "$MONIKER" ] && [ -f "$CONFIG_DIR/config.toml" ]; then
|
||||||
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" "$CONFIG_DIR/app.toml"
|
sed -i "s/^moniker = \".*\"/moniker = \"$MONIKER\"/" "$CONFIG_DIR/config.toml"
|
||||||
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"19\"/" "$CONFIG_DIR/app.toml"
|
fi
|
||||||
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" "$CONFIG_DIR/config.toml"
|
|
||||||
|
|
||||||
# P2P: bind 0.0.0.0, advertise IP + port, inject official seeds
|
exec haqqd start --chain-id ${CHAINID} $@
|
||||||
ct_patch_p2p "$CONFIG_DIR/config.toml" "$IP" "${P2P_PORT:-10465}"
|
|
||||||
ct_merge_seeds "$CONFIG_DIR/config.toml" "$SEEDS"
|
|
||||||
ct_set_moniker "$CONFIG_DIR/config.toml" "$MONIKER"
|
|
||||||
ct_seed_priv_validator_state "$HOME_DIR"
|
|
||||||
|
|
||||||
exec haqqd start --chain-id "$CHAINID" "$@"
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ services:
|
|||||||
- 9545
|
- 9545
|
||||||
command:
|
command:
|
||||||
- --Xbonsai-full-flat-db-enabled=true
|
- --Xbonsai-full-flat-db-enabled=true
|
||||||
|
- --bonsai-historical-block-limit=4096
|
||||||
- --bootnodes=enode://069800db9e6e0ec9cadca670994ef1aea2cfd3d88133e63ecadbc1cdbd1a5847b09838ee08d8b5f02a9c32ee13abeb4d4104bb5514e5322c9d7ee19f41ff3e51@3.132.73.210:31002,enode://a8e03a71eab12ec4b47bb6e19169d8e4dc7a58373a2476969bbe463f2dded6003037fa4dd5f71e15027f7fc8d7340956fbbefed67ddd116ac19a7f74da034b61@3.132.73.210:31003,enode://97706526cf79df9d930003644f9156805f6c8bd964fc79e083444f7014ce10c9bdd2c5049e63b58040dca1d4c82ebef970822198cf0714de830cff4111534ff1@18.223.198.165:31004,enode://24e1c654a801975a96b7f54ebd7452ab15777fc635c1db25bdbd4425fdb04e7f4768e9e838a87ab724320a765e41631d5d37758c933ad0e8668693558125c8aa@18.223.198.165:31000,enode://27010891d960f73d272a553f72b6336c6698db3ade98d631f09c764e57674a797be5ebc6829ddbb65ab564f439ebc75215d20aa98b6f351d12ea623e7d139ac3@3.132.73.210:31001,enode://228e1b8a4931e46f383e30721dac21fb8fb4e5e1b32c870e13b25478c82db3dc1cd9e7ceb93d302a766466b55638cc9c5cbfc43aa48fa41ced19baf365951f76@3.1.142.64:31002,enode://c22eb0d40fc3ad5ea710aeddea906567778166bfe18c157955e8c39b23a46c45db18a0fa2ba07f2b64c81178a8c796aec2a29151533920ead06fcdfc6d8d03c6@47.128.192.57:31004,enode://8ce733abe39fd7ae0a278b9893f85c1193c611a3886168690dd843435460f22cc4d61f9e8d0ace7f5905836a665319a31cccdaacdada2acc69972c382ecce7db@3.1.142.64:31003,enode://b7c1b2bed65a855f7a2104aac9a14674dfdf018fdac763415b373b29ce18cdb81d36328ba4e5c9f12629f3a50c3e8f9ee048f22dbdbe93a82813da89c6b81334@51.20.235.126:31004,enode://95270e0550848a72fb141cf27f1c4ea10714edde365b411dc0fa06c81c0f282ce155eb9fa472b6b8bb9ee98395eeaf4c5a7b02a01fe58b37ea98ba152eda4c37@13.50.94.193:31000,enode://72013391755f24f08567b932feeeec4c893c06e0b1fb480890c83bf87fd277ad86a5ab9cb586db9ae9970371a2f8cb0c96f6c9f69045abca0fb801db7f047138@51.20.235.126:31001
|
- --bootnodes=enode://069800db9e6e0ec9cadca670994ef1aea2cfd3d88133e63ecadbc1cdbd1a5847b09838ee08d8b5f02a9c32ee13abeb4d4104bb5514e5322c9d7ee19f41ff3e51@3.132.73.210:31002,enode://a8e03a71eab12ec4b47bb6e19169d8e4dc7a58373a2476969bbe463f2dded6003037fa4dd5f71e15027f7fc8d7340956fbbefed67ddd116ac19a7f74da034b61@3.132.73.210:31003,enode://97706526cf79df9d930003644f9156805f6c8bd964fc79e083444f7014ce10c9bdd2c5049e63b58040dca1d4c82ebef970822198cf0714de830cff4111534ff1@18.223.198.165:31004,enode://24e1c654a801975a96b7f54ebd7452ab15777fc635c1db25bdbd4425fdb04e7f4768e9e838a87ab724320a765e41631d5d37758c933ad0e8668693558125c8aa@18.223.198.165:31000,enode://27010891d960f73d272a553f72b6336c6698db3ade98d631f09c764e57674a797be5ebc6829ddbb65ab564f439ebc75215d20aa98b6f351d12ea623e7d139ac3@3.132.73.210:31001,enode://228e1b8a4931e46f383e30721dac21fb8fb4e5e1b32c870e13b25478c82db3dc1cd9e7ceb93d302a766466b55638cc9c5cbfc43aa48fa41ced19baf365951f76@3.1.142.64:31002,enode://c22eb0d40fc3ad5ea710aeddea906567778166bfe18c157955e8c39b23a46c45db18a0fa2ba07f2b64c81178a8c796aec2a29151533920ead06fcdfc6d8d03c6@47.128.192.57:31004,enode://8ce733abe39fd7ae0a278b9893f85c1193c611a3886168690dd843435460f22cc4d61f9e8d0ace7f5905836a665319a31cccdaacdada2acc69972c382ecce7db@3.1.142.64:31003,enode://b7c1b2bed65a855f7a2104aac9a14674dfdf018fdac763415b373b29ce18cdb81d36328ba4e5c9f12629f3a50c3e8f9ee048f22dbdbe93a82813da89c6b81334@51.20.235.126:31004,enode://95270e0550848a72fb141cf27f1c4ea10714edde365b411dc0fa06c81c0f282ce155eb9fa472b6b8bb9ee98395eeaf4c5a7b02a01fe58b37ea98ba152eda4c37@13.50.94.193:31000,enode://72013391755f24f08567b932feeeec4c893c06e0b1fb480890c83bf87fd277ad86a5ab9cb586db9ae9970371a2f8cb0c96f6c9f69045abca0fb801db7f047138@51.20.235.126:31001
|
||||||
- --data-path=/opt/besu/database
|
- --data-path=/opt/besu/database
|
||||||
- --data-storage-format=BONSAI
|
- --data-storage-format=BONSAI
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ services:
|
|||||||
- 9545
|
- 9545
|
||||||
command:
|
command:
|
||||||
- --Xbonsai-full-flat-db-enabled=true
|
- --Xbonsai-full-flat-db-enabled=true
|
||||||
|
- --bonsai-historical-block-limit=4096
|
||||||
- --bootnodes=enode://6f20afbe4397e51b717a7c1ad3095e79aee48c835eebd9237a3e8a16951ade1fe0e66e981e30ea269849fcb6ba03d838da37f524fabd2a557474194a2e2604fa@18.221.100.27:31002,enode://ce1e0d8e0500cb5c0ac56bdcdafb2d6320c3a2c5125b5ccf12f5dfc9b47ee74acbcafc32559017613136c9c36a0ce74ba4f83b7fb8244f099f3b15708d9d3129@3.23.75.47:31000,enode://1b026a5eb0ae74300f58987d235ef0e3a550df963345cb3574be3b0b54378bd11f14dfd515a8976f2c2d2826090e9507b8ccc24f896a9ffffffcabcfd996a733@3.129.120.128:31001
|
- --bootnodes=enode://6f20afbe4397e51b717a7c1ad3095e79aee48c835eebd9237a3e8a16951ade1fe0e66e981e30ea269849fcb6ba03d838da37f524fabd2a557474194a2e2604fa@18.221.100.27:31002,enode://ce1e0d8e0500cb5c0ac56bdcdafb2d6320c3a2c5125b5ccf12f5dfc9b47ee74acbcafc32559017613136c9c36a0ce74ba4f83b7fb8244f099f3b15708d9d3129@3.23.75.47:31000,enode://1b026a5eb0ae74300f58987d235ef0e3a550df963345cb3574be3b0b54378bd11f14dfd515a8976f2c2d2826090e9507b8ccc24f896a9ffffffcabcfd996a733@3.129.120.128:31001
|
||||||
- --data-path=/opt/besu/database
|
- --data-path=/opt/besu/database
|
||||||
- --data-storage-format=BONSAI
|
- --data-storage-format=BONSAI
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ x-logging-defaults: &logging-defaults
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
polygon-amoy-archive:
|
polygon-amoy-archive:
|
||||||
image: ${POLYGON_BOR_IMAGE:-0xpolygon/bor}:${POLYGON_AMOY_BOR_VERSION:-2.10.0-private}
|
image: ${POLYGON_BOR_IMAGE:-0xpolygon/bor}:${POLYGON_AMOY_BOR_VERSION:-2.9.0}
|
||||||
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:
|
||||||
polygon-amoy:
|
polygon-amoy:
|
||||||
image: ${POLYGON_BOR_IMAGE:-0xpolygon/bor}:${POLYGON_AMOY_BOR_VERSION:-2.10.0-private}
|
image: ${POLYGON_BOR_IMAGE:-0xpolygon/bor}:${POLYGON_AMOY_BOR_VERSION:-2.9.0}
|
||||||
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
|
||||||
|
|||||||
@@ -216,6 +216,7 @@
|
|||||||
"https://bsc-dataseed3.ninicoin.io",
|
"https://bsc-dataseed3.ninicoin.io",
|
||||||
"https://bsc-dataseed4.ninicoin.io",
|
"https://bsc-dataseed4.ninicoin.io",
|
||||||
"https://bsc-rpc.publicnode.com",
|
"https://bsc-rpc.publicnode.com",
|
||||||
|
"https://bsc-rpc-public.chainpulse.cc",
|
||||||
"https://bsc.drpc.org"
|
"https://bsc.drpc.org"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -233,6 +234,7 @@
|
|||||||
"https://data-seed-prebsc-1-s3.bnbchain.org:8545",
|
"https://data-seed-prebsc-1-s3.bnbchain.org:8545",
|
||||||
"https://data-seed-prebsc-2-s3.bnbchain.org:8545",
|
"https://data-seed-prebsc-2-s3.bnbchain.org:8545",
|
||||||
"https://bsc-testnet-rpc.publicnode.com",
|
"https://bsc-testnet-rpc.publicnode.com",
|
||||||
|
"https://bsc-rpc-public.chainpulse.cc/testnet",
|
||||||
"https://bsc-testnet.drpc.org"
|
"https://bsc-testnet.drpc.org"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -3635,6 +3637,7 @@
|
|||||||
"lagging_lag": 10,
|
"lagging_lag": 10,
|
||||||
"syncing_lag": 20,
|
"syncing_lag": 20,
|
||||||
"urls": [
|
"urls": [
|
||||||
|
"https://rpc.pharos.xyz",
|
||||||
"https://pharos.drpc.org"
|
"https://pharos.drpc.org"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -3720,6 +3723,7 @@
|
|||||||
"lagging_lag": 20,
|
"lagging_lag": 20,
|
||||||
"syncing_lag": 40,
|
"syncing_lag": 40,
|
||||||
"urls": [
|
"urls": [
|
||||||
|
"https://humanity-main.g.alchemy.com/public",
|
||||||
"https://humanity.drpc.org"
|
"https://humanity.drpc.org"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ services:
|
|||||||
context: ./zero-gravity
|
context: ./zero-gravity
|
||||||
dockerfile: zerog.Dockerfile
|
dockerfile: zerog.Dockerfile
|
||||||
args:
|
args:
|
||||||
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-3.0.3}
|
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-1.0.6}
|
||||||
ZERO_GRAVITY_CHAIN_SPEC: aristotle
|
ZERO_GRAVITY_CHAIN_SPEC: aristotle
|
||||||
sysctls:
|
sysctls:
|
||||||
# TCP Performance
|
# TCP Performance
|
||||||
@@ -118,7 +118,7 @@ services:
|
|||||||
context: ./zero-gravity
|
context: ./zero-gravity
|
||||||
dockerfile: zerog.Dockerfile
|
dockerfile: zerog.Dockerfile
|
||||||
args:
|
args:
|
||||||
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-3.0.3}
|
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-1.0.6}
|
||||||
ZERO_GRAVITY_CHAIN_SPEC: aristotle
|
ZERO_GRAVITY_CHAIN_SPEC: aristotle
|
||||||
ports:
|
ports:
|
||||||
- 19914:19914
|
- 19914:19914
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ services:
|
|||||||
context: ./zero-gravity
|
context: ./zero-gravity
|
||||||
dockerfile: zerog.Dockerfile
|
dockerfile: zerog.Dockerfile
|
||||||
args:
|
args:
|
||||||
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_GALILEO_ZEROG_VERSION:-3.0.3}
|
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_GALILEO_ZEROG_VERSION:-3.0.8}
|
||||||
ZERO_GRAVITY_CHAIN_SPEC: galileo
|
ZERO_GRAVITY_CHAIN_SPEC: galileo
|
||||||
sysctls:
|
sysctls:
|
||||||
# TCP Performance
|
# TCP Performance
|
||||||
@@ -62,7 +62,7 @@ services:
|
|||||||
- CHAIN_NAME=galileo
|
- CHAIN_NAME=galileo
|
||||||
entrypoint: [/usr/local/bin/init.sh, geth]
|
entrypoint: [/usr/local/bin/init.sh, geth]
|
||||||
command:
|
command:
|
||||||
- --bootnodes=enode://de7b86d8ac452b1413983049c20eafa2ea0851a3219c2cc12649b971c1677bd83fe24c5331e078471e52a94d95e8cde84cb9d866574fec957124e57ac6056699@8.218.88.60:30303
|
- --bootnodes=enode://4c94b9ab893ee17f58505b48b53d6c02d52bd5567e5fc6c028a29ad25ce1d553286a7fe3a6c051ba18c466b196762ab0e92695d6abbaf7f70afcca2e165bca8c@34.82.252.10:30303
|
||||||
- --config /0g/geth-config.toml
|
- --config /0g/geth-config.toml
|
||||||
- --datadir=/root/.ethereum
|
- --datadir=/root/.ethereum
|
||||||
- --db.engine=pebble
|
- --db.engine=pebble
|
||||||
@@ -118,7 +118,7 @@ services:
|
|||||||
context: ./zero-gravity
|
context: ./zero-gravity
|
||||||
dockerfile: zerog.Dockerfile
|
dockerfile: zerog.Dockerfile
|
||||||
args:
|
args:
|
||||||
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_GALILEO_ZEROG_VERSION:-3.0.3}
|
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_GALILEO_ZEROG_VERSION:-3.0.8}
|
||||||
ZERO_GRAVITY_CHAIN_SPEC: galileo
|
ZERO_GRAVITY_CHAIN_SPEC: galileo
|
||||||
ports:
|
ports:
|
||||||
- 16172:16172
|
- 16172:16172
|
||||||
@@ -140,7 +140,7 @@ services:
|
|||||||
- --chaincfg.node-api.logging
|
- --chaincfg.node-api.logging
|
||||||
- --home=/root/.0g
|
- --home=/root/.0g
|
||||||
- --p2p.external_address=${IP}:16172
|
- --p2p.external_address=${IP}:16172
|
||||||
- --p2p.seeds=${ZERO_GRAVITY_GALILEO_ZEROG_SEEDS:-85a9b9a1b7fa0969704db2bc37f7c100855a75d9@8.218.88.60:26656}
|
- --p2p.seeds=${ZERO_GRAVITY_GALILEO_ZEROG_SEEDS:-461b27a9d1530eb47f62fe010a8d3e5d43b6740c@34.82.252.10:26656}
|
||||||
- --pruning=default
|
- --pruning=default
|
||||||
- --rpc.laddr=tcp://0.0.0.0:16172
|
- --rpc.laddr=tcp://0.0.0.0:16172
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
@@ -8,22 +8,92 @@ RUN chmod +x /usr/local/bin/init.sh
|
|||||||
|
|
||||||
ARG ZERO_GRAVITY_VERSION
|
ARG ZERO_GRAVITY_VERSION
|
||||||
ARG ZERO_GRAVITY_CHAIN_SPEC
|
ARG ZERO_GRAVITY_CHAIN_SPEC
|
||||||
RUN if [ "${ZERO_GRAVITY_CHAIN_SPEC}" = "aristotle" ]; then \
|
|
||||||
curl -sL https://github.com/0gfoundation/0gchain-Aristotle/releases/download/${ZERO_GRAVITY_VERSION}/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}.tar.gz -o /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}.tar.gz; \
|
# 0G publishes each network from a DIFFERENT repository, and the release-tag format is not
|
||||||
|
# consistent within either of them. The asset filename is always "<spec>-v<version>.tar.gz";
|
||||||
|
# only the tag varies:
|
||||||
|
#
|
||||||
|
# aristotle -> 0gchain-Aristotle 1.0.4 = "1.0.4" 1.0.6 = "v1.0.6"
|
||||||
|
# galileo -> 0gchain-NG 3.0.3 = "v3.0.3" 3.0.7 = "galileo-v3.0.7" 3.0.8 = "v3.0.8"
|
||||||
|
#
|
||||||
|
# So the tag cannot be hardcoded. Resolve it by trying the known forms in order and taking
|
||||||
|
# the first that actually yields the asset.
|
||||||
|
#
|
||||||
|
# curl uses -f (fail on HTTP error). Without it a 404 HTML body is written into the .tar.gz
|
||||||
|
# and the build dies several layers later at "tar: not in gzip format" -- an error that
|
||||||
|
# points nowhere near the real cause. That has cost three separate misdiagnoses.
|
||||||
|
RUN set -eu; \
|
||||||
|
ASSET="${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}.tar.gz"; \
|
||||||
|
if [ "${ZERO_GRAVITY_CHAIN_SPEC}" = "aristotle" ]; then \
|
||||||
|
REPO="0gfoundation/0gchain-Aristotle"; \
|
||||||
|
TAGS="${ZERO_GRAVITY_VERSION} v${ZERO_GRAVITY_VERSION} ${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}"; \
|
||||||
else \
|
else \
|
||||||
curl -sL https://github.com/0gfoundation/0gchain-NG/releases/download/v${ZERO_GRAVITY_VERSION}/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}.tar.gz -o /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}.tar.gz; \
|
REPO="0gfoundation/0gchain-NG"; \
|
||||||
fi
|
TAGS="v${ZERO_GRAVITY_VERSION} ${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION} ${ZERO_GRAVITY_VERSION}"; \
|
||||||
RUN tar -xzf /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}.tar.gz -C /tmp
|
fi; \
|
||||||
RUN if [ "${ZERO_GRAVITY_CHAIN_SPEC}" = "galileo" ]; then \
|
for TAG in ${TAGS}; do \
|
||||||
mv /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}/rpc /0g; \
|
URL="https://github.com/${REPO}/releases/download/${TAG}/${ASSET}"; \
|
||||||
else \
|
echo "0g: trying tag '${TAG}' -> ${URL}"; \
|
||||||
mkdir -p /0g && \
|
if curl -fsSL "${URL}" -o "/tmp/${ASSET}"; then \
|
||||||
cp -a /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}/* /0g/ 2>/dev/null || true; \
|
echo "0g: resolved ${ZERO_GRAVITY_CHAIN_SPEC} ${ZERO_GRAVITY_VERSION} from tag '${TAG}'"; \
|
||||||
cp -a /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}/.[^.]* /0g/ 2>/dev/null || true; \
|
break; \
|
||||||
rm -rf /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}; \
|
fi; \
|
||||||
|
rm -f "/tmp/${ASSET}"; \
|
||||||
|
done; \
|
||||||
|
if [ ! -s "/tmp/${ASSET}" ]; then \
|
||||||
|
echo "0g: FATAL - no release asset '${ASSET}' found in ${REPO} under any of: ${TAGS}" >&2; \
|
||||||
|
echo "0g: aristotle and galileo are SEPARATE repos on SEPARATE version lines" >&2; \
|
||||||
|
echo "0g: aristotle = 0gchain-Aristotle (1.0.x), galileo = 0gchain-NG (3.0.x)" >&2; \
|
||||||
|
echo "0g: check that version '${ZERO_GRAVITY_VERSION}' exists for '${ZERO_GRAVITY_CHAIN_SPEC}'" >&2; \
|
||||||
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RUN chmod +x /0g/bin/0gchaind
|
# Extract by DETECTING the layout rather than assuming one per chain. 0G has shipped
|
||||||
RUN chmod +x /0g/bin/geth
|
# three shapes so far and changed between them without notice:
|
||||||
|
#
|
||||||
|
# galileo <= 3.0.3 <root>/{rpc,validator,archive,seed}/bin/ + configs (168 MB)
|
||||||
|
# -> binaries duplicated inside every profile dir
|
||||||
|
# galileo >= 3.0.8 <root>/bin/ shared, + <root>/{rpc,...}/ configs (69 MB)
|
||||||
|
# -> binaries DEDUPLICATED to the tarball root; rpc/ is configs-only
|
||||||
|
# aristotle 1.0.x <root>/bin/ + configs, no profile dirs at all
|
||||||
|
#
|
||||||
|
# So "does <root>/rpc exist" is NOT sufficient: 3.0.8 still has rpc/, it just no longer
|
||||||
|
# holds bin/. Take configs from the profile dir when present, then top the binaries up
|
||||||
|
# from the shared root bin/ if the profile dir didn't supply them.
|
||||||
|
#
|
||||||
|
# The old code hardcoded "galileo -> mv <root>/rpc /0g", so 3.0.8 yielded configs but no
|
||||||
|
# binaries and the build died two layers later at
|
||||||
|
# `chmod: cannot access '/0g/bin/0gchaind'` — an error naming neither the chain, the
|
||||||
|
# version, nor the layout. Assert on the binaries here so the NEXT upstream reshuffle
|
||||||
|
# reports itself at the point of failure instead.
|
||||||
|
RUN set -eu; \
|
||||||
|
SRC="/tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}"; \
|
||||||
|
tar -xzf "${SRC}.tar.gz" -C /tmp; \
|
||||||
|
mkdir -p /0g; \
|
||||||
|
if [ -d "${SRC}/rpc" ]; then \
|
||||||
|
echo "0g: profile dir found -> ${SRC}/rpc"; \
|
||||||
|
cp -a "${SRC}/rpc/." /0g/; \
|
||||||
|
else \
|
||||||
|
echo "0g: no profile dir -> using tarball root ${SRC}"; \
|
||||||
|
cp -a "${SRC}/." /0g/; \
|
||||||
|
fi; \
|
||||||
|
if [ ! -f /0g/bin/0gchaind ] && [ -d "${SRC}/bin" ]; then \
|
||||||
|
echo "0g: binaries not in the profile dir -> topping up from ${SRC}/bin"; \
|
||||||
|
cp -a "${SRC}/bin" /0g/; \
|
||||||
|
fi; \
|
||||||
|
rm -rf "${SRC}"; \
|
||||||
|
missing=""; \
|
||||||
|
for b in 0gchaind geth; do \
|
||||||
|
[ -f "/0g/bin/${b}" ] || missing="${missing} bin/${b}"; \
|
||||||
|
done; \
|
||||||
|
if [ -n "${missing}" ]; then \
|
||||||
|
echo "0g: FATAL - missing after extraction:${missing}" >&2; \
|
||||||
|
echo "0g: ${ZERO_GRAVITY_CHAIN_SPEC} v${ZERO_GRAVITY_VERSION} tarball layout not recognised." >&2; \
|
||||||
|
echo "0g: known layouts are '<root>/rpc/bin/' (per-profile) and '<root>/bin/' (flat)." >&2; \
|
||||||
|
echo "0g: contents of /0g were:" >&2; \
|
||||||
|
ls -la /0g >&2 || true; \
|
||||||
|
exit 1; \
|
||||||
|
fi; \
|
||||||
|
chmod +x /0g/bin/0gchaind /0g/bin/geth
|
||||||
|
|
||||||
ENTRYPOINT [ "init.sh" ]
|
ENTRYPOINT [ "init.sh" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user