diff --git a/HACKING.md b/HACKING.md index 70c235b815..3dcba19ad2 100644 --- a/HACKING.md +++ b/HACKING.md @@ -80,3 +80,19 @@ yarn lint # or if you want linting plus automatic fixing yarn lint-fix ``` + +## Ports + +In the `scripts/` folder, a bunch of blockchains and other backend systems are +started for testing purposes. Some ports need to be changed from the default in +order to avoid conflicts. Here is an overview of the ports used: + +| Port | Application | Usage | +| ----- | --------------------- | ------------------------------------------------------------------------------------- | +| 1317 | wasmd LCD API | @cosmjs/launchpad and @cosmjs/cosmwasm tests | +| 1318 | simapp API | Manual Stargate debugging | +| 4444 | sockertserver | @cosmjs/sockets tests | +| 4445 | sockertserver slow | @cosmjs/sockets tests | +| 11133 | Tendermint 0.33 RPC | @cosmjs/tendermint-rpc tests | +| 11134 | Tendermint 0.34 RPC | @cosmjs/tendermint-rpc tests ([soon™](https://github.com/CosmWasm/cosmjs/issues/344)) | +| 26657 | simapp Tendermint RPC | Stargate client tests | diff --git a/scripts/simapp/start.sh b/scripts/simapp/start.sh index 9270cd6f2e..6358ed3e2c 100755 --- a/scripts/simapp/start.sh +++ b/scripts/simapp/start.sh @@ -2,6 +2,7 @@ set -o errexit -o nounset -o pipefail command -v shellcheck > /dev/null && shellcheck "$0" +# Please keep this in sync with the Ports overview in HACKING.md TENDERMINT_PORT_GUEST="26657" TENDERMINT_PORT_HOST="26657" API_PORT_GUEST="1317" diff --git a/scripts/socketserver/start.sh b/scripts/socketserver/start.sh index 3b8a64120f..b13e3fdfe5 100755 --- a/scripts/socketserver/start.sh +++ b/scripts/socketserver/start.sh @@ -2,6 +2,12 @@ set -o errexit -o nounset -o pipefail command -v shellcheck > /dev/null && shellcheck "$0" +# Please keep this in sync with the Ports overview in HACKING.md +DEFAULT_PORT_GUEST="4000" +DEFAULT_PORT_HOST="4444" +SLOW_PORT_GUEST="4000" +SLOW_PORT_HOST="4445" + SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SOCKETSERVER_DIR=$(mktemp -d "${TMPDIR:-/tmp}/socketserver.XXXXXXXXX") @@ -11,22 +17,22 @@ echo "SOCKETSERVER_DIR = $SOCKETSERVER_DIR" NAME_DEFAULT="socketserver-default" NAME_SLOW="socketserver-slow" -LOGFILE_DEFAULT="${SOCKETSERVER_DIR}/socketserver_4444.log" -LOGFILE_SLOW="${SOCKETSERVER_DIR}/socketserver_4445.log" +LOGFILE_DEFAULT="${SOCKETSERVER_DIR}/socketserver_$DEFAULT_PORT_HOST.log" +LOGFILE_SLOW="${SOCKETSERVER_DIR}/socketserver_$SLOW_PORT_HOST.log" docker build -t "socketserver:local" "$SCRIPT_DIR" docker run --rm \ --user="$UID" \ --name "$NAME_DEFAULT" \ - -p "4444:4000" \ + -p "$DEFAULT_PORT_HOST:$DEFAULT_PORT_GUEST" \ socketserver:local \ --delay 0 \ > "$LOGFILE_DEFAULT" & docker run --rm \ --user="$UID" \ --name "$NAME_SLOW" \ - -p "4445:4000" \ + -p "$SLOW_PORT_HOST:$SLOW_PORT_GUEST" \ socketserver:local \ --delay 5 \ > "$LOGFILE_SLOW" & diff --git a/scripts/wasmd/start.sh b/scripts/wasmd/start.sh index 0d5403211d..320cc3f8e9 100755 --- a/scripts/wasmd/start.sh +++ b/scripts/wasmd/start.sh @@ -2,9 +2,10 @@ set -o errexit -o nounset -o pipefail command -v shellcheck > /dev/null && shellcheck "$0" +# Please keep this in sync with the Ports overview in HACKING.md +# Tendermint port (26657) and p2p port (26656) are not exposed since we don't need them for testing LCD_API_PORT_GUEST="1317" LCD_API_PORT_HOST="1317" -# Tendermint port (26657) and p2p port (26656) are not exposed since we don't need them for testing SCRIPT_DIR="$(realpath "$(dirname "$0")")" # shellcheck source=./env