Skip to content

Commit 5db2301

Browse files
committed
adds convenience script to start waku node for testing
1 parent d59f5c6 commit 5db2301

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

_assets/scripts/run_waku.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
6+
source "${GIT_ROOT}/_assets/scripts/colors.sh"
7+
source "${GIT_ROOT}/_assets/scripts/codecov.sh"
8+
9+
root_path="${GIT_ROOT}/tests-functional"
10+
11+
identifier=${BUILD_ID:-$(git rev-parse --short HEAD)}
12+
container_name="waku-${identifier}"
13+
14+
echo -e "${YLW}Starting waku node...${RST}"
15+
16+
IP_ADDRESS=$(ip -o -4 addr show up primary scope global | awk '{print $4}' | cut -d/ -f1 | head -n1);
17+
docker run -d --name ${container_name} \
18+
-p 60000:60000/tcp -p 9000:9000/udp -p 8645:8645/tcp \
19+
harbor.status.im/wakuorg/nwaku:v0.36.0 \
20+
--tcp-port=60000 --discv5-discovery=true \
21+
--cluster-id=16 --shard=32 --shard=64 \
22+
--nat=extip:${IP_ADDRESS} --discv5-udp-port=9000 \
23+
--rest-address=0.0.0.0 --store
24+
25+
echo -e "${GRN}Waku node started.${RST}"
26+
27+
read -p "Press any button to exit..." -n 1 -r
28+
echo
29+
30+
cleanup() {
31+
echo -e "${YLW}Removing containers...${RST}"
32+
docker ps -a --filter "name=${container_name}" -q | xargs -r docker rm -f
33+
echo -e "${GRN}DONE!${RST}"
34+
}
35+
36+
trap cleanup EXIT

0 commit comments

Comments
 (0)