Create overview of ports used

This commit is contained in:
Simon Warta 2020-08-06 10:22:54 +02:00
parent d2bf447575
commit b0c4d0e126
4 changed files with 29 additions and 5 deletions

View File

@ -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 |

View File

@ -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"

View File

@ -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" &

View File

@ -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