update the polygon erigon setup to be able to use public rpcs and the new official supported version

This commit is contained in:
Sebastian
2022-12-18 12:02:30 +01:00
parent f0ee4c3038
commit d5313803dd
3 changed files with 35 additions and 14 deletions

View File

@@ -5,31 +5,33 @@ set -e
# Set Bor Home Directory
ERIGON_HOME=/datadir
HEIMDALL_RPC=heimdall:26657
#HEIMDALLD=http://heimdalld:26657
#HEIMDALLR=http://heimdallr:1317
if [ "${BOOTSTRAP}" == 1 ] && [ -n "${SNAPSHOT_URL}" ] && [ ! -f "${ERIGON_HOME}/bootstrapped" ];
then
echo "downloading snapshot from ${SNAPSHOT_URL}"
mkdir -p ${ERIGON_HOME}
wget --tries=0 -O - "${SNAPSHOT_URL}" | tar -xz -C ${ERIGON_HOME} && touch ${ERIGON_HOME}/bootstrapped
mkdir -p ${ERIGON_HOME:-/datadir}
wget --tries=0 -O - "${SNAPSHOT_URL}" | tar -xz -C ${ERIGON_HOME:-/datadir} && touch ${ERIGON_HOME:-/datadir}/bootstrapped
fi
READY=$(curl -s http://heimdalld:26657/status | jq '.result.sync_info.catching_up')
READY=$(curl -s ${HEIMDALLD:-http://heimdalld:26657}/status | jq '.result.sync_info.catching_up')
while [[ "${READY}" != "false" ]];
do
echo "Waiting for heimdalld to catch up."
sleep 30
READY=$(curl -s heimdalld:26657/status | jq '.result.sync_info.catching_up')
READY=$(curl -s ${HEIMDALLD:-http://heimdalld:26657}/status | jq '.result.sync_info.catching_up')
done
# add snap.keepblocks=true as mentioned on https://snapshot.polygon.technology/
exec erigon \
--chain=bor-mainnet \
--bor.heimdall=http://heimdallr:1317 \
--bor.heimdall=${HEIMDALLR:-http://heimdallr:1317} \
--datadir=${ERIGON_HOME} \
--http --http.addr="0.0.0.0" --http.port="8545" --http.compression --http.vhosts="*" --http.corsdomain="*" --http.api="eth,debug,net,trace,web3,erigon,bor" \
--ws --ws.compression \
--ws --ws.compression --ws.port="8545" \
--port=27113
--snap.keepblocks=true \
--snapshots="true" \
--torrent.upload.rate="1250mb" --torrent.download.rate="1250mb" \