chainsaw massacre
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
FROM golang:1.19-alpine as builder
|
||||
RUN apk add --no-cache make g++ gcc musl-dev linux-headers git
|
||||
ARG ERIGON_VERSION=v0.0.5
|
||||
ARG ERIGON_REPOSITORY=https://github.com/maticnetwork/erigon.git
|
||||
|
||||
RUN git clone --recurse-submodules -j8 $ERIGON_REPOSITORY
|
||||
|
||||
WORKDIR ./erigon
|
||||
|
||||
RUN git checkout ${ERIGON_VERSION}
|
||||
|
||||
RUN make erigon
|
||||
|
||||
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=https://polygon-mainnet-rpc.allthatnode.com:26657
|
||||
ENV HEIMDALLR=https://polygon-mainnet-rpc.allthatnode.com:1317
|
||||
|
||||
EXPOSE 27113
|
||||
EXPOSE 8545
|
||||
EXPOSE 6060
|
||||
EXPOSE 6061
|
||||
|
||||
COPY ./scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod u+x /usr/local/bin/entrypoint.sh
|
||||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# exit script on any error
|
||||
set -e
|
||||
|
||||
# Set Bor Home Directory
|
||||
ERIGON_HOME=/datadir
|
||||
|
||||
if [ "${BOOTSTRAP}" == 1 ] && [ -n "${SNAPSHOT_URL}" ] && [ ! -f "${ERIGON_HOME}/bootstrapped" ];
|
||||
then
|
||||
echo "downloading snapshot from ${SNAPSHOT_URL}"
|
||||
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 ${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:-http://heimdalld:26657}/status | jq '.result.sync_info.catching_up')
|
||||
done
|
||||
|
||||
# add snap.keepblocks=true as mentioned on https://snapshot.polygon.technology/
|
||||
# add rpc.returndata.limit=1000000 to unstuck subgraphs due to "call retuned result on length 104704 exceeding limit 100000"
|
||||
|
||||
exec erigon \
|
||||
--chain=bor-mainnet \
|
||||
--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 \
|
||||
--port=27113 \
|
||||
--snap.keepblocks=true \
|
||||
--rpc.returndata.limit=1000000 \
|
||||
--snapshots="true" \
|
||||
--torrent.upload.rate="1250mb" --torrent.download.rate="1250mb" \
|
||||
--metrics --metrics.addr=0.0.0.0 --metrics.port=6060 \
|
||||
--pprof --pprof.addr=0.0.0.0 --pprof.port=6061
|
||||
@@ -1,28 +0,0 @@
|
||||
# Build and Install Heimdall in a stock Go builder container
|
||||
FROM golang:1.17-alpine
|
||||
|
||||
# Install packages we need
|
||||
RUN apk add --no-cache make gcc musl-dev linux-headers git
|
||||
|
||||
# create go src directory and clone heimdall
|
||||
RUN mkdir -p /root/heimdall
|
||||
|
||||
# Grab UPSTREAM_VERSION from Build Args
|
||||
ARG UPSTREAM_VERSION
|
||||
|
||||
# Clone hemidall release into folder
|
||||
RUN git clone --branch ${UPSTREAM_VERSION} https://github.com/maticnetwork/heimdall.git /root/heimdall
|
||||
|
||||
# change work directory
|
||||
WORKDIR /root/heimdall
|
||||
|
||||
# GOBIN required for go install
|
||||
ENV GOBIN $GOPATH/bin
|
||||
|
||||
# Make and Install Heimdall
|
||||
RUN make install
|
||||
|
||||
# Set entrypoint
|
||||
COPY ./scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod u+x /usr/local/bin/entrypoint.sh
|
||||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# exit script on any error
|
||||
set -e
|
||||
|
||||
# Set Heimdall Home Directory
|
||||
HEIMDALLD_HOME=/root/.heimdalld
|
||||
|
||||
if [ ! -f "$HEIMDALLD_HOME/config/config.toml" ];
|
||||
then
|
||||
echo "setting up initial configurations"
|
||||
heimdalld init
|
||||
cd $HEIMDALLD_HOME/config
|
||||
|
||||
echo "removing autogenerated genesis file"
|
||||
rm genesis.json
|
||||
|
||||
echo "downloading launch genesis file"
|
||||
wget https://raw.githubusercontent.com/maticnetwork/launch/master/mainnet-v1/without-sentry/heimdall/config/genesis.json
|
||||
|
||||
echo "overwriting toml config lines"
|
||||
# config.toml
|
||||
# CORS
|
||||
sed -i "s#^cors_allowed_origins.*#cors_allowed_origins = [\"*\"]#" config.toml
|
||||
# SEEDS
|
||||
sed -i "s#^seeds.*#seeds = \"${BOOTNODES:-"f4f605d60b8ffaaf15240564e58a81103510631c@159.203.9.164:26656,4fb1bc820088764a564d4f66bba1963d47d82329@44.232.55.71:26656,2eadba4be3ce47ac8db0a3538cb923b57b41c927@35.199.4.13:26656,3b23b20017a6f348d329c102ddc0088f0a10a444@35.221.13.28:26656,25f5f65a09c56e9f1d2d90618aa70cd358aa68da@35.230.116.151:26656"}\"#" config.toml
|
||||
# heimdall-config.toml
|
||||
# BOR
|
||||
sed -i "s#^bor_rpc_url.*#bor_rpc_url = \"http://bor:8545\"#" heimdall-config.toml
|
||||
# ETH1
|
||||
sed -i "s#^eth_rpc_url.*#eth_rpc_url = \"${ETH1_RPC_URL}\"#" heimdall-config.toml
|
||||
# RABBITMQ
|
||||
sed -i "s#^amqp_url.*#amqp_url = \"amqp://guest:guest@rabbitmq:5672\"#" heimdall-config.toml
|
||||
fi
|
||||
|
||||
if [ "${BOOTSTRAP}" == 1 ] && [ -n "${SNAPSHOT_URL}" ] && [ ! -f "$HEIMDALLD_HOME/bootstrapped" ];
|
||||
then
|
||||
echo "downloading snapshot from ${SNAPSHOT_URL}"
|
||||
mkdir -p ${HEIMDALLD_HOME}/data
|
||||
wget -c "${SNAPSHOT_URL}" -O - | tar -xz -C ${HEIMDALLD_HOME}/data && touch ${HEIMDALLD_HOME}/bootstrapped
|
||||
fi
|
||||
|
||||
if [ -n "$REST_SERVER" ];
|
||||
then
|
||||
EXEC="heimdalld rest-server --chain-id=137 --laddr=tcp://0.0.0.0:1317 --max-open=1000 --node=tcp://heimdalld:26657 --trust-node=true"
|
||||
else
|
||||
EXEC="heimdalld start --moniker=$MONIKER --fast_sync --p2p.laddr=tcp://0.0.0.0:26656 --p2p.upnp=false --pruning=syncable --rpc.laddr=tcp://0.0.0.0:26657 --with-tendermint=true"
|
||||
fi
|
||||
|
||||
exec ${EXEC}
|
||||
Reference in New Issue
Block a user