split up the big files
This commit is contained in:
28
polygon/heimdall/Dockerfile
Normal file
28
polygon/heimdall/Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
||||
# Build and Install Heimdall in a stock Go builder container
|
||||
FROM golang:1.16-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" ]
|
||||
50
polygon/heimdall/scripts/entrypoint.sh
Executable file
50
polygon/heimdall/scripts/entrypoint.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh [1/1829]
|
||||
|
||||
# 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"}\"#" 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