update the polygon erigon setup to be able to use public rpcs and the new official supported version
This commit is contained in:
@@ -5,7 +5,7 @@ FROM golang:1.19-alpine as builder
|
||||
RUN apk add --no-cache make g++ gcc musl-dev linux-headers git
|
||||
|
||||
# Grab ERIGON_VERSION from Build Args
|
||||
ARG ERIGON_VERSION
|
||||
ARG ERIGON_VERSION=v0.0.4
|
||||
|
||||
# Clone the repo to that folder
|
||||
RUN git clone --recurse-submodules -j8 https://github.com/maticnetwork/erigon.git
|
||||
@@ -25,6 +25,25 @@ FROM alpine:latest
|
||||
RUN apk add --no-cache ca-certificates curl jq libstdc++ libgcc
|
||||
COPY --from=builder /go/erigon/build/bin/erigon /usr/local/bin/
|
||||
|
||||
# ENV HEIMDALLD=http://heimdalld:26657
|
||||
# ENV HEIMDALLR=http://heimdallr:1317
|
||||
|
||||
ENV HEIMDALLD=https://polygon-mainnet-rpc.allthatnode.com:26657
|
||||
ENV HEIMDALLR=https://polygon-mainnet-rpc.allthatnode.com:1317
|
||||
|
||||
# P2P
|
||||
EXPOSE 27113
|
||||
|
||||
# HTTP / WS
|
||||
EXPOSE 8545
|
||||
|
||||
# Metrics
|
||||
EXPOSE 6060
|
||||
|
||||
# PProf
|
||||
EXPOSE 6061
|
||||
|
||||
|
||||
# Set entrypoint
|
||||
COPY ./scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod u+x /usr/local/bin/entrypoint.sh
|
||||
|
||||
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user