solana/multinode-demo/wallet.sh

31 lines
746 B
Bash
Raw Normal View History

#!/bin/bash
#
# usage: $0 <rsync network path to solana repo on leader machine>"
#
here=$(dirname "$0")
2018-06-26 23:15:43 -07:00
# shellcheck source=multinode-demo/common.sh
source "$here"/common.sh
SOLANA_CONFIG_DIR=config-client-demo
leader=${1:-${here}/..} # Default to local solana repo
shift
rsync_leader_url=$(rsync_url "$leader")
2018-07-02 10:54:35 -07:00
set -e
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-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
exec $solana_wallet \
2018-06-29 22:56:23 -07:00
-l $SOLANA_CONFIG_DIR/leader.json -m $client_json "$@"