From 7a2a9c54db17ec95ea0a432bbac15a2df52dd158 Mon Sep 17 00:00:00 2001
From: Benjamin Bollen <ben@erisindustries.com>
Date: Mon, 18 Jul 2016 16:26:20 +0200
Subject: [PATCH] Correct bug in erisdb-wrapper script setting ERIS_DB_DATADIR

---
 Dockerfile        |  8 ++++----
 bin/start_eris_db | 12 +++++++-----
 cmd/serve.go      |  4 ++--
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 98ecb7eb..96e97df8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -48,10 +48,10 @@ RUN git clone --quiet https://$ERIS_DB_MINT_REPO . \
 #-----------------------------------------------------------------------------
 # clean up [build container needs to be separated from shipped container]
 
- RUN unset ERIS_DB_SRC_PATH \
- 	&& unset ERIS_DB_MINT_SRC_PATH \
- 	&& apk del --purge go git musl-dev \
- 	&& rm -rf $GOPATH
+RUN unset ERIS_DB_SRC_PATH \
+	&& unset ERIS_DB_MINT_SRC_PATH \
+	&& apk del --purge go git musl-dev \
+	&& rm -rf $GOPATH
 
 # mount the data container on the eris directory
 VOLUME $ERIS
diff --git a/bin/start_eris_db b/bin/start_eris_db
index 4ca623f0..fd8cc17c 100644
--- a/bin/start_eris_db
+++ b/bin/start_eris_db
@@ -45,9 +45,8 @@ if [ ! -d "$ERIS_DB_WORKDIR" ]; then
 	ifExit "Error making working directory $ERIS_DB_WORKDIR"
 fi
 
-# [TODO]: for transition from 0.11.4 to 0.12.1 map data directory to working directory
 export ERIS_DB_WORKDIR
-export ERIS_DB_DATADIR=$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"
@@ -70,9 +69,9 @@ case $CMD in
 	echo "Install is under review to be deprecated; please contact support@erisindustries.com if you encounter this error."
 	exit 1
 	;;
-"new" ) eris-db serve $CONFIG_OPTS $@
+"new" ) echo "passed new"
 	;;
-"run" ) eris-db serve $CONFIG_OPTS $@
+"run" ) echo "passed run"
 	;;
 "register" ) 
 	echo "Register is under review to be deprecated; please contact support@erisindustries.com if you encounter this error."
@@ -80,6 +79,9 @@ case $CMD in
 	;;
 # 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
-*) eris-db serve $CONFIG_OPTS $@
+*) 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
diff --git a/cmd/serve.go b/cmd/serve.go
index 567cc407..61fdda0e 100644
--- a/cmd/serve.go
+++ b/cmd/serve.go
@@ -83,10 +83,10 @@ func addServeFlags() {
 func Serve(cmd *cobra.Command, args []string) {
 	// load configuration from a single location to avoid a wrong configuration
 	// file is loaded.
-	if err := do.ReadConfig(do.WorkDir, "server_config", "toml"); err != nil {
+	if err := do.ReadConfig(do.WorkDir, "config", "toml"); err != nil {
 		log.WithFields(log.Fields{
 			"directory": do.WorkDir,
-			"file":      "server_config.toml",
+			"file":      "config.toml",
 		}).Fatalf("Fatal error reading configuration")
 		os.Exit(1)
 	}
-- 
GitLab