Drone now grabs mint.json locally

This commit is contained in:
Michael Vines 2018-07-02 16:10:55 -07:00
parent feb1669d39
commit 7d708be121
3 changed files with 14 additions and 7 deletions

View File

@ -53,6 +53,7 @@ export RUST_BACKTRACE=1
[[ $(uname) = Linux ]] && (set -x; sudo sysctl -w net.core.rmem_max=26214400 1>/dev/null 2>/dev/null) [[ $(uname) = Linux ]] && (set -x; sudo sysctl -w net.core.rmem_max=26214400 1>/dev/null 2>/dev/null)
SOLANA_CONFIG_DIR=${SNAP_DATA:-$PWD}/config SOLANA_CONFIG_DIR=${SNAP_DATA:-$PWD}/config
SOLANA_CONFIG_PRIVATE_DIR=${SNAP_DATA:-$PWD}/config-private
rsync_url() { # adds the 'rsync://` prefix to URLs that need it rsync_url() { # adds the 'rsync://` prefix to URLs that need it
declare url="$1" declare url="$1"

View File

@ -24,12 +24,18 @@ else
leader=${1:-${here}/..} # Default to local solana repo leader=${1:-${here}/..} # Default to local solana repo
fi fi
[[ -f "$SOLANA_CONFIG_PRIVATE_DIR"/mint.json ]] || {
echo "$SOLANA_CONFIG_PRIVATE_DIR/mint.json not found, create it by running:"
echo
echo " ${here}/setup.sh -t leader"
exit 1
}
rsync_leader_url=$(rsync_url "$leader") rsync_leader_url=$(rsync_url "$leader")
set -ex set -ex
mkdir -p $SOLANA_CONFIG_DIR mkdir -p $SOLANA_CONFIG_DIR
$rsync -vPz "$rsync_leader_url"/config/leader.json $SOLANA_CONFIG_DIR/ $rsync -vPz "$rsync_leader_url"/config/leader.json $SOLANA_CONFIG_DIR/
$rsync -vPz "$rsync_leader_url"/config-private/mint.json $SOLANA_CONFIG_DIR/
# shellcheck disable=SC2086 # $solana_drone should not be quoted # shellcheck disable=SC2086 # $solana_drone should not be quoted
exec $solana_drone \ exec $solana_drone \
-l $SOLANA_CONFIG_DIR/leader.json < $SOLANA_CONFIG_DIR/mint.json -l $SOLANA_CONFIG_DIR/leader.json < $SOLANA_CONFIG_PRIVATE_DIR/mint.json

View File

@ -80,14 +80,14 @@ mkdir -p "$SOLANA_CONFIG_DIR"
if $node_type_leader; then if $node_type_leader; then
rm -rvf "$SOLANA_CONFIG_DIR"-private rm -rvf "$SOLANA_CONFIG_PRIVATE_DIR"
mkdir -p "$SOLANA_CONFIG_DIR"-private mkdir -p "$SOLANA_CONFIG_PRIVATE_DIR"
echo "Creating $SOLANA_CONFIG_DIR/mint.json with $num_tokens tokens" echo "Creating $SOLANA_CONFIG_DIR/mint.json with $num_tokens tokens"
$solana_mint <<<"$num_tokens" > "$SOLANA_CONFIG_DIR"-private/mint.json $solana_mint <<<"$num_tokens" > "$SOLANA_CONFIG_PRIVATE_DIR"/mint.json
echo "Creating $SOLANA_CONFIG_DIR/genesis.log" echo "Creating $SOLANA_CONFIG_DIR/genesis.log"
$solana_genesis < "$SOLANA_CONFIG_DIR"-private/mint.json > "$SOLANA_CONFIG_DIR"/genesis.log $solana_genesis < "$SOLANA_CONFIG_PRIVATE_DIR"/mint.json > "$SOLANA_CONFIG_DIR"/genesis.log
echo "Creating $SOLANA_CONFIG_DIR/leader.json" echo "Creating $SOLANA_CONFIG_DIR/leader.json"
$solana_fullnode_config "${leader_address_args[@]}" > "$SOLANA_CONFIG_DIR"/leader.json $solana_fullnode_config "${leader_address_args[@]}" > "$SOLANA_CONFIG_DIR"/leader.json
@ -101,5 +101,5 @@ fi
ls -lh "$SOLANA_CONFIG_DIR"/ ls -lh "$SOLANA_CONFIG_DIR"/
if $node_type_leader; then if $node_type_leader; then
ls -lh "$SOLANA_CONFIG_DIR"-private/ ls -lh "$SOLANA_CONFIG_PRIVATE_DIR"
fi fi