diff --git a/README.md b/README.md index 861c89fdd39a2e6a9e488e10885a12452957e21f..8f23c38443dce3166733587e9b1f0ca15c750a68 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,11 @@ is added to this testing suite via the run script (`run.sh`) ## Local Network The [localNetwork package](./localNetwork) is a more general use network tool. -This package will run a local version of the xx network on a single machine. -This can be done either via the `run.sh` script, which will run the network entirely -locally with internal IP addresses, or the `runpublish.sh`, which runs the network -with remotely accessible IP addresses. +This package will run a local version of the xx network on a single machine until a +manually killed by the user. This can be done either via the `run.sh` script, +which will run the network with internal IP addresses, or the `runpublish.sh`, which runs the network +with remotely accessible IP addresses. With this network established, a developer may, +for example, test the xxDK against it. ## How to manually run locally diff --git a/localNetwork/run.sh b/localNetwork/run.sh index b33736efbae9313add578edea0fcd1a84c15cb50..8dfecf183cb8eda1fc7357e9f1fec0e2519b783b 100755 --- a/localNetwork/run.sh +++ b/localNetwork/run.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash + +set -e + # Clear out the previous run's logs rm gateway*-knownRound || true rm errServer-* || true @@ -18,9 +21,9 @@ UDBOUT=results/udb-console.txt mkdir -p $SERVERLOGS mkdir -p $GATEWAYLOGS -# Allow for verbose gRPC logs -export GRPC_GO_LOG_VERBOSITY_LEVEL=99 -export GRPC_GO_LOG_SEVERITY_LEVEL=info +## Uncomment to allow for verbose gRPC logs +#export GRPC_GO_LOG_VERBOSITY_LEVEL=99 +#export GRPC_GO_LOG_SEVERITY_LEVEL=info nodes=$(ls -1q ./server-*.yaml | wc -l | xargs) @@ -86,6 +89,7 @@ finish() { echo "KILL -9 $job" kill -9 $job || true done + set +x } echo "You can't use the network until rounds run." @@ -94,9 +98,11 @@ echo "and review logs for what went wrong." rm rid.txt || true touch rid.txt echo -n "Waiting for rounds to run..." -while [ ! -s rid.txt ]; do +cnt=0 +while [ ! -s rid.txt ] && [ $cnt -lt 240 ]; do sleep 1 grep -a "RID 1 ReceiveFinishRealtime END" results/servers/server-2.log > rid.txt || true + cnt=$(($cnt + 1)) echo -n "." done