From a8265f4bad396527ddec3548bcb2890fa66165d3 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 2 Jul 2020 13:44:57 +0200 Subject: [PATCH 1/2] Extract REST_PORT_GUEST/REST_PORT_HOST --- scripts/wasmd/start.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/wasmd/start.sh b/scripts/wasmd/start.sh index f0c56902..cb20904a 100755 --- a/scripts/wasmd/start.sh +++ b/scripts/wasmd/start.sh @@ -2,6 +2,8 @@ set -o errexit -o nounset -o pipefail command -v shellcheck > /dev/null && shellcheck "$0" +REST_PORT_GUEST="1317" +REST_PORT_HOST="1317" SCRIPT_DIR="$(realpath "$(dirname "$0")")" # shellcheck source=./env # shellcheck disable=SC1091 @@ -19,7 +21,7 @@ REST_SERVER_LOGFILE="$TMP_DIR/rest-server.log" docker volume rm -f wasmd_data docker run --rm \ --name "$CONTAINER_NAME" \ - -p 1317:1317 \ + -p "$REST_PORT_HOST":"$REST_PORT_GUEST" \ -p 26657:26657 \ -p 26656:26656 \ --mount type=bind,source="$SCRIPT_DIR/template",target=/template \ @@ -47,10 +49,10 @@ docker exec "$CONTAINER_NAME" \ --node tcp://localhost:26657 \ --trust-node \ --cors \ - --laddr tcp://0.0.0.0:1317 \ + --laddr "tcp://0.0.0.0:$REST_PORT_GUEST" \ > "$REST_SERVER_LOGFILE" & -echo "rest server running on http://localhost:1317 and logging into $REST_SERVER_LOGFILE" +echo "rest server running on http://localhost:$REST_PORT_HOST and logging into $REST_SERVER_LOGFILE" # Give REST server some time to come alive. No idea why this helps. Needed for CI. if [ -n "${CI:-}" ]; then From fce0309ff2754748fc0b4d25945935fcb801c9c8 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 2 Jul 2020 13:47:01 +0200 Subject: [PATCH 2/2] Don't open Wasmd Tendermint/p2p ports --- scripts/wasmd/start.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/wasmd/start.sh b/scripts/wasmd/start.sh index cb20904a..c7ce878d 100755 --- a/scripts/wasmd/start.sh +++ b/scripts/wasmd/start.sh @@ -18,12 +18,11 @@ WASMD_LOGFILE="$TMP_DIR/wasmd.log" REST_SERVER_LOGFILE="$TMP_DIR/rest-server.log" # This starts up wasmd +# The Tendermint port (26657) and the p2p port (26656) are not exposed since we don't need for testing docker volume rm -f wasmd_data docker run --rm \ --name "$CONTAINER_NAME" \ -p "$REST_PORT_HOST":"$REST_PORT_GUEST" \ - -p 26657:26657 \ - -p 26656:26656 \ --mount type=bind,source="$SCRIPT_DIR/template",target=/template \ --mount type=volume,source=wasmd_data,target=/root \ "$REPOSITORY:$VERSION" \