Skip to content

Commit 26405d6

Browse files
glyhdkijania
authored andcommitted
improve help message
1 parent 4c3c3cb commit 26405d6

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

scripts/tests/rosetta-connectivity.sh

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,41 @@
4141
# - Container runs on port 3087 and mounts current directory as /workdir
4242
# - Load test duration is fixed at 600 seconds when enabled
4343

44-
set -x
4544
CLEAR='\033[0m'
4645
RED='\033[0;31m'
4746
GREEN='\033[0;32m'
4847

49-
DEFAULT_NETWORK=devnet
50-
NETWORK=$DEFAULT_NETWORK
48+
NETWORK=devnet
5149
TIMEOUT=900
5250
DB_CONN_STR="postgres://pguser:pguser@localhost:5432/archive"
5351
UPGRADE_SCRIPTS_WORKDIR="src/app/archive"
5452

5553
LOAD_TEST_DURATION=600
5654
RUN_LOAD_TEST=false
5755

56+
USAGE="Usage: $0 [-t docker-tag] [-n network]
57+
-t, --version The version to be used in the docker image tag
58+
-n, --network The network configuration to use (devnet or mainnet). Default=$NETWORK
59+
--timeout The timeout duration in seconds. Default=$TIMEOUT
60+
--run-compatibility-test Enable compatibility testing with specified branch
61+
--upgrade-scripts-workdir Working directory for upgrade/downgrade scripts. Default=$UPGRADE_SCRIPTS_WORKDIR
62+
-h, --help Show help
63+
64+
Example: $0 --network devnet --tag 3.0.3-bullseye-berkeley
65+
Example: $0 --network devnet --tag 3.0.3 --run-compatibility-test develop
66+
Example: $0 --network devnet --tag 3.0.3 --run-compatibility-test develop --upgrade-scripts-workdir /custom/path
67+
68+
Warning:
69+
Please execute this script from the root of the mina repository.
70+
"
71+
72+
function usage() {
73+
if [[ -n "$1" ]]; then
74+
echo -e "${RED}$1${CLEAR}\n";
75+
fi
76+
echo "$USAGE"
77+
}
78+
5879
while [[ "$#" -gt 0 ]]; do case $1 in
5980
-n|--network) NETWORK="$2"; shift;;
6081
--run-load-test) RUN_LOAD_TEST=true ;;
@@ -66,27 +87,6 @@ while [[ "$#" -gt 0 ]]; do case $1 in
6687
*) echo "Unknown parameter passed: $1"; usage; exit 1;;
6788
esac; shift; done
6889

69-
function usage() {
70-
if [[ -n "$1" ]]; then
71-
echo -e "${RED}$1${CLEAR}\n";
72-
fi
73-
echo "Usage: $0 [-t docker-tag] [-n network]"
74-
echo " -t, --version The version to be used in the docker image tag"
75-
echo " -n, --network The network configuration to use (devnet or mainnet). Default=$DEFAULT_NETWORK"
76-
echo " --timeout The timeout duration in seconds. Default=$TIMEOUT"
77-
echo " --run-compatibility-test Enable compatibility testing with specified branch"
78-
echo " --upgrade-scripts-workdir Working directory for upgrade/downgrade scripts. Default=$UPGRADE_SCRIPTS_WORKDIR"
79-
echo " -h, --help Show help"
80-
echo ""
81-
echo "Example: $0 --network devnet --tag 3.0.3-bullseye-berkeley "
82-
echo "Example: $0 --network devnet --tag 3.0.3 --run-compatibility-test develop"
83-
echo "Example: $0 --network devnet --tag 3.0.3 --run-compatibility-test develop --upgrade-scripts-workdir /custom/path"
84-
echo ""
85-
echo "Warning:"
86-
echo "Please execute this script from the root of the mina repository."
87-
echo ""
88-
}
89-
9090
if [[ "$NETWORK" != "devnet" && "$NETWORK" != "mainnet" && "$NETWORK" != "berkeley" ]]; then
9191
echo "❌ Invalid network: $NETWORK"
9292
echo "❌ Network must be either 'devnet' or 'mainnet' or 'berkeley'"
@@ -96,6 +96,8 @@ fi
9696

9797
if [[ -z "$TAG" ]]; then usage "Docker tag is not set!"; usage; exit 1; fi;
9898

99+
set -x
100+
99101
container_id=$(docker run -v .:/workdir -p 3087:3087 -d --env MINA_NETWORK=$NETWORK gcr.io/o1labs-192920/mina-rosetta:$TAG-$NETWORK )
100102

101103
stop_docker() {

0 commit comments

Comments
 (0)