From c8b7b30292d351c0895d2ec8f73de1482cf7a422 Mon Sep 17 00:00:00 2001 From: Matt Griswold Date: Wed, 25 Mar 2020 20:14:48 +0000 Subject: [PATCH] update docker env --- dockerfiles/super_node/Dockerfile | 1 + dockerfiles/super_node/entrypoint.sh | 17 ++++++++++------- environments/superNodeBTC.toml | 4 ++-- environments/superNodeETH.toml | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/dockerfiles/super_node/Dockerfile b/dockerfiles/super_node/Dockerfile index fbed02a6..84ebe54e 100644 --- a/dockerfiles/super_node/Dockerfile +++ b/dockerfiles/super_node/Dockerfile @@ -51,6 +51,7 @@ COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/vulcanizedb/d COPY --from=builder /go/src/github.com/vulcanize/vulcanizedb/vulcanizedb vulcanizedb COPY --from=builder /go/src/github.com/pressly/goose/cmd/goose/goose goose COPY --from=builder /go/src/github.com/vulcanize/vulcanizedb/db/migrations migrations/vulcanizedb +COPY --from=builder /go/src/github.com/vulcanize/vulcanizedb/environments environments COPY --from=builder /go/src/github.com/ipfs/go-ipfs/ipfs ipfs EXPOSE $EXPOSE_PORT_1 diff --git a/dockerfiles/super_node/entrypoint.sh b/dockerfiles/super_node/entrypoint.sh index 04dcf74c..1b101dd7 100755 --- a/dockerfiles/super_node/entrypoint.sh +++ b/dockerfiles/super_node/entrypoint.sh @@ -14,7 +14,7 @@ set +x #test $DATABASE_PASSWORD #test $IPFS_INIT #test $IPFS_PATH -VDB_COMMAND=${VARIABLE:-headerSync} +VDB_COMMAND=${VDB_COMMAND:-superNode} set +e # Construct the connection string for postgres @@ -39,7 +39,7 @@ export IPFS_PGPORT=$DATABASE_PORT export IPFS_PGPASSWORD=$DATABASE_PASSWORD -if [ ! -d "~/.ipfs" ]; then +if [ ! -d "$HOME/.ipfs" ]; then # initialize PG-IPFS echo "Initializing Postgres-IPFS profile" ./ipfs init --profile=postgresds @@ -51,11 +51,14 @@ if [ ! -d "~/.ipfs" ]; then fi fi -echo "Beginning the vulcanizedb super node process" -DEFAULT_OPTIONS="--config=config.toml" -VDB_FULL_CL=${VARIABLE:-$DEFAULT_OPTIONS} -# XXX stdout, not logfile -./vulcanizedb ${VDB_COMMAND} $VDB_FULL_CL + +echo "Beginning the vulcanizedb process" +VDB_CONFIG_FILE=${VDB_CONFIG_FILE:-config.toml} +DEFAULT_OPTIONS="--config=$VDB_CONFIG_FILE" +VDB_FULL_CL=${VDB_FULL_CL:-$VDB_COMMAND $DEFAULT_OPTIONS} +echo running: ./vulcanizedb $VDB_FULL_CL $@ + +./vulcanizedb $VDB_FULL_CL $@ rv=$? if [ $rv != 0 ]; then diff --git a/environments/superNodeBTC.toml b/environments/superNodeBTC.toml index 9fa27600..99171a9d 100644 --- a/environments/superNodeBTC.toml +++ b/environments/superNodeBTC.toml @@ -6,7 +6,7 @@ password = "" # $DATABASE_PASSWORD [ipfs] - path = "/root/.btc/.ipfs" # $IPFS_PATH + path = "~/.ipfs" # $IPFS_PATH [resync] chain = "bitcoin" # $RESYNC_CHAIN @@ -20,7 +20,7 @@ [superNode] chain = "bitcoin" # $SUPERNODE_CHAIN server = true # $SUPERNODE_SERVER - ipcPath = "/root/.vulcanize/btc/vulcanize.ipc" # $SUPERNODE_IPC_PATH + ipcPath = "~/.vulcanize/vulcanize.ipc" # $SUPERNODE_IPC_PATH wsPath = "127.0.0.1:8082" # $SUPERNODE_WS_PATH httpPath = "127.0.0.1:8083" # $SUPERNODE_HTTP_PATH sync = true # $SUPERNODE_SYNC diff --git a/environments/superNodeETH.toml b/environments/superNodeETH.toml index d4a55d58..69e3b32d 100644 --- a/environments/superNodeETH.toml +++ b/environments/superNodeETH.toml @@ -6,7 +6,7 @@ password = "" # $DATABASE_PASSWORD [ipfs] - path = "/root/.eth/.ipfs" # $IPFS_PATH + path = "~/.ipfs" # $IPFS_PATH [resync] chain = "ethereum" # $RESYNC_CHAIN @@ -20,7 +20,7 @@ [superNode] chain = "ethereum" # $SUPERNODE_CHAIN server = true # $SUPERNODE_SERVER - ipcPath = "/root/.vulcanize/eth/vulcanize.ipc" # $SUPERNODE_IPC_PATH + ipcPath = "~/.vulcanize/vulcanize.ipc" # $SUPERNODE_IPC_PATH wsPath = "127.0.0.1:8081" # $SUPERNODE_WS_PATH httpPath = "127.0.0.1:8082" # $SUPERNODE_HTTP_PATH sync = true # $SUPERNODE_SYNC