Skip to content
Snippets Groups Projects
Commit ebe9c40e authored by Ethan Buchman's avatar Ethan Buchman
Browse files

ecm cleanup, back to bash

parent be6622f8
No related branches found
No related tags found
No related merge requests found
......@@ -34,9 +34,11 @@ WORKDIR $REPO
RUN go build -o /usr/local/bin/erisdb ./cmd/erisdb && \
go build -o /usr/local/bin/erisdbss ./cmd/erisdbss
# install chain manager scripts
COPY ./DOCKER/chain_* /usr/local/bin/
ENV ECM_PATH /usr/local/bin
# install chain manager scripts and default mint config
ENV ECM_PATH /usr/local/lib/ecm/
RUN mkdir -p $ECM_PATH
COPY ./DOCKER/chain_* $ECM_PATH
COPY ./DOCKER/config.toml $ECM_PATH
# set the repo and install mint-client
ENV REPO github.com/eris-ltd/mint-client
......@@ -62,4 +64,5 @@ RUN mkdir --parents /home/$USER/.eris/blockchains/tendermint
ENV TMROOT /home/$USER/.eris/blockchains/tendermint
# run tendermint
ENTRYPOINT ["erisdb-wrapper"]
# really should be entrypoint but broken in API 1.19
CMD ["erisdb-wrapper"]
#! /bin/sh
#! /bin/bash
#-----------------------------------------------------------------------
# get genesis, seed, copy config
......@@ -8,9 +8,11 @@ REFS_CHAIN_ID=$(mintinfo --node-addr $NODE_ADDR genesis chain_id)
ifExit "Error fetching default chain id from $NODE_ADDR"
REFS_CHAIN_ID=$(echo "$REFS_CHAIN_ID" | tr -d '"') # remove surrounding quotes
echo "etcb chain: $REFS_CHAIN_ID"
# get the genesis.json for a refs chain from the /genesis rpc endpoint
# for a different chain, use etcb (ie namereg on the ref chain)
if [ "$CHAIN_ID" = "$REF_CHAIN_ID" ] ; then
if [ "$CHAIN_ID" = "$REFS_CHAIN_ID" ] ; then
# grab genesis.json and config
mintinfo --node-addr $NODE_ADDR genesis > "${CHAIN_DIR}/genesis.json"
ifExit "Error fetching genesis.json from $NODE_ADDR"
......
#! /bin/sh
#! /bin/bash
echo "new chain: $CHAIN_ID"
if [ "$GENERATE_GENESIS" = "true" ]; then
mintgen --single $CHAIN_DIR
ifExit "Error creating genesis file"
fi
if [ "$RUN" = "true" ]; then
tendermint node
ifExit "Error starting tendermint"
else
# this will just run for a second and quit
tendermint node & last_pid=$! && sleep 1 && kill -KILL $last_pid
ifExit "Error starting tendermint"
fi
#! /bin/sh
# if no CHAIN_ID, get that off the main test net
if [[ ! $CHAIN_ID ]]; then
# get the chain id
CHAIN_ID=$(mintinfo --node-addr $NODE_ADDR genesis chain_id)
ifExit "Error fetching default chain id from $NODE_ADDR"
CHAIN_ID=$(echo "$CHAIN_ID" | tr -d '"') # remove surrounding quotes
fi
CHAIN_DIR="${ROOT_DIR}/$CHAIN_ID"
if [[ ! -d $CHAIN_DIR ]]; then
echo "Unknown chain ($CHAIN_ID)"
exit 1
fi
#! /bin/bash
echo Running chain $CHAIN_ID
tendermint node
#! /bin/sh
#! /bin/bash
ifExit(){
if [ $? -ne 0 ]; then
......@@ -7,15 +7,15 @@ ifExit(){
fi
}
export -f ifExit
#------------------------------------------------
# set and export directories
#############################################
# We expect the following env vars to be set
# $CHAIN_ID
#
# one day we'll make it more flexible
# for now the only consumer is eris-cli
if [ "$CHAIN_ID" = "" ]; then
echo "ecm requires CHAIN_ID be set"
exit 1
fi
# TODO: deal with chain numbers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment