diff --git a/scripts/cosm/cli.sh b/scripts/cosm/cli.sh index b013cc1a..59eeefe9 100755 --- a/scripts/cosm/cli.sh +++ b/scripts/cosm/cli.sh @@ -2,11 +2,9 @@ set -o errexit -o nounset -o pipefail command -v shellcheck > /dev/null && shellcheck "$0" -# Choose from https://hub.docker.com/r/cosmwasm/wasmd/tags -REPOSITORY="cosmwasm/wasmd" -VERSION="manual" -BLOCKCHAIN_CONTAINER_NAME="wasmd" +SCRIPT_DIR="$(realpath "$(dirname "$0")")" +source "$SCRIPT_DIR"/env # TODO: make this run as UID? Does this matter? HOME_DIR="/root" diff --git a/scripts/cosm/start.sh b/scripts/cosm/start.sh index 383403d3..57932107 100755 --- a/scripts/cosm/start.sh +++ b/scripts/cosm/start.sh @@ -2,17 +2,14 @@ set -o errexit -o nounset -o pipefail command -v shellcheck > /dev/null && shellcheck "$0" -# Choose from https://hub.docker.com/r/cosmwasm/wasmd/tags -REPOSITORY="cosmwasm/wasmd" -VERSION="manual" +SCRIPT_DIR="$(realpath "$(dirname "$0")")" +source "$SCRIPT_DIR"/env TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/gaia.XXXXXXXXX") chmod 777 "$TMP_DIR" echo "Using temporary dir $TMP_DIR" WASMD_LOGFILE="$TMP_DIR/wasmd.log" REST_SERVER_LOGFILE="$TMP_DIR/rest-server.log" -SCRIPT_DIR="$(realpath "$(dirname "$0")")" -CONTAINER_NAME="wasmd" # This starts up wasmd docker volume rm -f wasmd_data diff --git a/scripts/cosm/stop.sh b/scripts/cosm/stop.sh index 91214993..773b5eb8 100755 --- a/scripts/cosm/stop.sh +++ b/scripts/cosm/stop.sh @@ -2,7 +2,8 @@ set -o errexit -o nounset -o pipefail command -v shellcheck > /dev/null && shellcheck "$0" -CONTAINER_NAME="wasmd" +SCRIPT_DIR="$(realpath "$(dirname "$0")")" +source "$SCRIPT_DIR"/env echo "Killing Cosmos container..." docker container kill "$CONTAINER_NAME" diff --git a/scripts/env b/scripts/env new file mode 100644 index 00000000..bfa7e4c0 --- /dev/null +++ b/scripts/env @@ -0,0 +1,5 @@ +# Choose from https://hub.docker.com/r/cosmwasm/wasmd/tags +REPOSITORY="cosmwasm/wasmd-demo" +VERSION="latest" + +BLOCKCHAIN_CONTAINER_NAME="wasmd"