Skip to content

Commit

Permalink
adding cli example comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wcannon committed Jan 18, 2022
1 parent cffa2ff commit ebae7ee
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
4 changes: 3 additions & 1 deletion run-client.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
# Have a nice day..

# USAGE examples:
# CLI : ./run-client.sh

COMMAND='cargo run --release -- --trial --verbosity 2'

Expand Down
5 changes: 5 additions & 0 deletions run-miner.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
# Have a nice day

# USAGE examples:
# CLI with env vars: MINER_ADDRESS=aleoABCD... ./run-miner.sh
# CLI with prompts for vars: ./run-miner.sh


# if env var MINER_ADDRESS is not set, prompt for it
if [ -z "${MINER_ADDRESS}" ]
then
Expand Down
8 changes: 5 additions & 3 deletions run-operator.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
# Have a nice day

# USAGE examples:
# CLI with env vars: MINER_ADDRESS=aleoABCD... ./run-operator.sh


# if env var MINER_ADDRESS is not set, prompt for it
if [ -z "${MINER_ADDRESS}" ]
Expand Down Expand Up @@ -45,6 +48,5 @@ do
kill -INT $!; sleep 2; $COMMAND &
fi

#sleep 1800;
sleep 60;
sleep 1800;
done
24 changes: 13 additions & 11 deletions run-prover.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash
# Have a nice day

# USAGE examples:
# CLI with env vars: MINER_ADDRESS=aleoABCD... OPERATOR_IP_ADDRESS=a.b.c.d ./run-prover.sh
# CLI with prompts for vars: ./run-prover.sh


# if env var MINER_ADDRESS is not set, prompt for it
if [ -z "${MINER_ADDRESS}" ]
Expand All @@ -13,22 +17,20 @@ then
MINER_ADDRESS="aleo1d5hg2z3ma00382pngntdp68e74zv54jdxy249qhaujhks9c72yrs33ddah"
fi



# if env var OPERATOR_IP_ADDR is not set, prompt for it
# if env var OPERATOR_IP_ADDRESS is not set, prompt for it
if [ -z "${OPERATOR_IP_ADDRESS}" ]
then
read -r -p "Enter your Operator Server's IP address: "
OPERATOR_IP_ADDR=$REPLY
read -r -p "Enter your Operator Servers IP address: "
OPERATOR_IP_ADDRESS=$REPLY
fi

if [ "${OPERATOR_IP_ADDR}" == "" ]
if [ "${OPERATOR_IP_ADDRESS}" == "" ]
then
echo "IP Address of Operator server is required to run a prover"
exit 1
fi

COMMAND="cargo run --release -- --prover ${MINER_ADDRESS} --pool ${OPERATOR_IP_ADDR}:4132 --trial --verbosity 2"
COMMAND="cargo run --release -- --prover ${MINER_ADDRESS} --pool ${OPERATOR_IP_ADDRESS}:4132 --trial --verbosity 2"

for word in $*;
do
Expand All @@ -44,7 +46,7 @@ function exit_node()

trap exit_node SIGINT

echo "Running miner node..."
echo "Running prover node..."
$COMMAND &

while :
Expand All @@ -54,11 +56,11 @@ do
rm Cargo.lock
STATUS=$(git pull)

if [ "$STATUS" != "Already up to date." ]; then
if [ "${STATUS}" != "Already up to date." ]; then
echo "Updated code found, rebuilding and relaunching miner"
cargo clean
kill -INT $!; sleep 2; $COMMAND &
fi

sleep 1800;
done
done

0 comments on commit ebae7ee

Please sign in to comment.