2018-06-26 22:53:05 -07:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2018-06-27 07:40:22 -07:00
|
|
|
# usage: $0 <rsync network path to solana repo on leader machine>"
|
2018-06-26 22:53:05 -07:00
|
|
|
#
|
|
|
|
|
|
|
|
here=$(dirname "$0")
|
2018-06-26 23:15:43 -07:00
|
|
|
# shellcheck source=multinode-demo/common.sh
|
2018-06-26 22:53:05 -07:00
|
|
|
source "$here"/common.sh
|
|
|
|
SOLANA_CONFIG_DIR=config-client-demo
|
|
|
|
|
|
|
|
leader=${1:-${here}/..} # Default to local solana repo
|
2018-06-29 14:12:26 -07:00
|
|
|
shift
|
2018-06-26 22:53:05 -07:00
|
|
|
|
|
|
|
rsync_leader_url=$(rsync_url "$leader")
|
|
|
|
|
2018-07-02 10:54:35 -07:00
|
|
|
set -e
|
2018-06-26 22:53:05 -07:00
|
|
|
mkdir -p $SOLANA_CONFIG_DIR
|
2018-07-02 10:54:35 -07:00
|
|
|
if [[ ! -r $SOLANA_CONFIG_DIR/leader.json ]]; then
|
|
|
|
rsync -vPz "$rsync_leader_url"/config/leader.json $SOLANA_CONFIG_DIR/
|
|
|
|
fi
|
2018-06-26 22:53:05 -07:00
|
|
|
|
2018-06-29 22:56:23 -07:00
|
|
|
client_json=$SOLANA_CONFIG_DIR/client.json
|
|
|
|
if [[ ! -r $client_json ]]; then
|
|
|
|
$solana_mint <<<0 > $client_json
|
|
|
|
fi
|
|
|
|
|
2018-07-02 10:54:35 -07:00
|
|
|
set -x
|
2018-06-29 09:16:20 -07:00
|
|
|
# shellcheck disable=SC2086 # $solana_wallet should not be quoted
|
2018-06-28 11:56:53 -07:00
|
|
|
exec $solana_wallet \
|
2018-06-29 22:56:23 -07:00
|
|
|
-l $SOLANA_CONFIG_DIR/leader.json -m $client_json "$@"
|