Skip to content
Snippets Groups Projects
Commit 5535520b authored by Silas Davis's avatar Silas Davis Committed by GitHub
Browse files

Merge pull request #528 from benjaminbollen/issue70-remove-startup-script

bin: remove redundant shell script
parents 83ff636b 0e0c3d91
No related branches found
No related tags found
No related merge requests found
#! /bin/bash
ifExit(){
if [[ $? != 0 ]]; then
echo "ifExit"
echo "$1"
for var in "$@"
do
echo "$var"
done
exit 1
fi
}
if0Exit(){
if [[ $? == 0 ]]; then
echo "if0Exit"
echo "$1"
for var in "$@"
do
echo "$var"
done
exit 1
fi
}
export -f ifExit
export -f if0Exit
#-----------------------------------------------------------------------
# set and export directories
if [ "$CHAIN_ID" = "" ]; then
echo "Eris-db container requires environment variable CHAIN_ID to be set. Please run docker container with \`-e CHAIN_ID=\"<chainId>\"\`"
exit 1
fi
if [ "$ERIS_DB_WORKDIR" = "" ]; then
ERIS_DB_WORKDIR="$ERIS/chains/$CHAIN_ID"
fi
if [ ! -d "$ERIS_DB_WORKDIR" ]; then
mkdir -p $ERIS_DB_WORKDIR
ifExit "Error making working directory $ERIS_DB_WORKDIR"
fi
export ERIS_DB_WORKDIR
export ERIS_DB_DATADIR=$ERIS_DB_WORKDIR/data
echo "env CHAIN_ID is set to $CHAIN_ID"
echo "env ERIS_DB_WORKDIR is set to $ERIS_DB_WORKDIR"
echo "env ERIS_DB_DATADIR is set to $ERIS_DB_DATADIR"
#-----------------------------------------------------------------------
# [2016-07-13 ben] we preserve the existing contact commands "new", "run",
# but this functionality is absorbed in eris-db, eris-cm, eris-cli
# and the mapping is preserved here to catch deployed use-cases.
# NOTE: eris-db serve picks up following environment variables which are relevant to interaction with eris-cli
# - CHAIN_ID, set by eris-cli
# - ERIS_DB_WORKDIR, set in this script
# - ERIS_DB_DATADIR, set in this script
# - ERISDB_API (to be deprecated in favor of explicit --disable-rpc)
# - CONFIG_OPTS, for arbitrary flags to be passed to `eris-db serve`
CMD=$1
case $CMD in
"install" )
echo "Install is under review to be deprecated; please contact support@erisindustries.com if you encounter this error."
exit 1
;;
"new" ) echo "passed new"
;;
"run" ) echo "passed run"
;;
"register" )
echo "Register is under review to be deprecated; please contact support@erisindustries.com if you encounter this error."
exit 1
;;
# we append $@ to eris-db to expose the same flags on the docker container,
# eg `docker run -it quay.io/eris/erisdb --chain-id=<chain_id>`, will overwrite $CHAIN_ID
*) echo "no known command given: $CMD"
;;
esac
echo "running eris-db serve --debug $CONFIG_OPTS \"$@\""
eris-db serve --debug $CONFIG_OPTS "$@"
\ No newline at end of file
...@@ -19,10 +19,10 @@ import ( ...@@ -19,10 +19,10 @@ import (
"os" "os"
"runtime" "runtime"
"github.com/eris-ltd/eris-db/rpc"
"github.com/eris-ltd/eris-db/server" "github.com/eris-ltd/eris-db/server"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/tendermint/log15" "github.com/tendermint/log15"
"github.com/eris-ltd/eris-db/rpc"
) )
func init() { func init() {
......
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