@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Start a dynamically-configured archiver
|
||||
#
|
||||
|
||||
here=$(dirname "$0")
|
||||
exec "$here"/archiver.sh --label x$$ "$@"
|
@@ -1,83 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# A thin wrapper around `solana-archiver` that automatically provisions the
|
||||
# archiver's identity and/or storage keypair if not provided by the caller.
|
||||
#
|
||||
set -e
|
||||
|
||||
here=$(dirname "$0")
|
||||
# shellcheck source=multinode-demo/common.sh
|
||||
source "$here"/common.sh
|
||||
|
||||
entrypoint=127.0.0.0:8001
|
||||
label=
|
||||
|
||||
while [[ -n $1 ]]; do
|
||||
if [[ ${1:0:1} = - ]]; then
|
||||
if [[ $1 = --entrypoint ]]; then
|
||||
entrypoint=$2
|
||||
args+=("$1" "$2")
|
||||
shift 2
|
||||
elif [[ $1 = --identity ]]; then
|
||||
identity=$2
|
||||
[[ -r $identity ]] || {
|
||||
echo "$identity does not exist"
|
||||
exit 1
|
||||
}
|
||||
args+=("$1" "$2")
|
||||
shift 2
|
||||
elif [[ $1 = --label ]]; then
|
||||
label="-$2"
|
||||
shift 2
|
||||
elif [[ $1 = --ledger ]]; then
|
||||
args+=("$1" "$2")
|
||||
shift 2
|
||||
elif [[ $1 = --storage-keypair ]]; then
|
||||
storage_keypair=$2
|
||||
[[ -r $storage_keypair ]] || {
|
||||
echo "$storage_keypair does not exist"
|
||||
exit 1
|
||||
}
|
||||
args+=("$1" "$2")
|
||||
shift 2
|
||||
else
|
||||
echo "Unknown argument: $1"
|
||||
$solana_archiver --help
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Unknown argument: $1"
|
||||
$solana_archiver --help
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
: "${identity:="$SOLANA_ROOT"/farf/archiver-identity"$label".json}"
|
||||
: "${storage_keypair:="$SOLANA_ROOT"/farf/archiver-storage-keypair"$label".json}"
|
||||
ledger="$SOLANA_ROOT"/farf/archiver-ledger"$label"
|
||||
|
||||
rpc_url=$($solana_gossip rpc-url --entrypoint "$entrypoint")
|
||||
|
||||
if [[ ! -r $identity ]]; then
|
||||
$solana_keygen new --no-passphrase -so "$identity"
|
||||
|
||||
# See https://github.com/solana-labs/solana/issues/4344
|
||||
$solana_cli --keypair "$identity" --url "$rpc_url" airdrop 1
|
||||
fi
|
||||
identity_pubkey=$($solana_keygen pubkey "$identity")
|
||||
|
||||
if [[ ! -r $storage_keypair ]]; then
|
||||
$solana_keygen new --no-passphrase -so "$storage_keypair"
|
||||
|
||||
$solana_cli --keypair "$identity" --url "$rpc_url" \
|
||||
create-archiver-storage-account "$identity_pubkey" "$storage_keypair"
|
||||
fi
|
||||
|
||||
default_arg --entrypoint "$entrypoint"
|
||||
default_arg --identity "$identity"
|
||||
default_arg --storage-keypair "$storage_keypair"
|
||||
default_arg --ledger "$ledger"
|
||||
|
||||
set -x
|
||||
# shellcheck disable=SC2086 # Don't want to double quote $solana_archiver
|
||||
exec $solana_archiver "${args[@]}"
|
@@ -59,7 +59,6 @@ solana_gossip=$(solana_program gossip)
|
||||
solana_keygen=$(solana_program keygen)
|
||||
solana_ledger_tool=$(solana_program ledger-tool)
|
||||
solana_cli=$(solana_program)
|
||||
solana_archiver=$(solana_program archiver)
|
||||
|
||||
export RUST_BACKTRACE=1
|
||||
|
||||
|
@@ -78,10 +78,6 @@ while [[ -n $1 ]]; do
|
||||
vote_account=$2
|
||||
args+=("$1" "$2")
|
||||
shift 2
|
||||
elif [[ $1 = --storage-keypair ]]; then
|
||||
storage_keypair=$2
|
||||
args+=("$1" "$2")
|
||||
shift 2
|
||||
elif [[ $1 = --init-complete-file ]]; then
|
||||
args+=("$1" "$2")
|
||||
shift 2
|
||||
@@ -214,7 +210,6 @@ faucet_address="${gossip_entrypoint%:*}":9900
|
||||
|
||||
: "${identity:=$ledger_dir/identity.json}"
|
||||
: "${vote_account:=$ledger_dir/vote-account.json}"
|
||||
: "${storage_keypair:=$ledger_dir/storage-keypair.json}"
|
||||
|
||||
default_arg --entrypoint "$gossip_entrypoint"
|
||||
if ((airdrops_enabled)); then
|
||||
@@ -223,7 +218,6 @@ fi
|
||||
|
||||
default_arg --identity "$identity"
|
||||
default_arg --vote-account "$vote_account"
|
||||
default_arg --storage-keypair "$storage_keypair"
|
||||
default_arg --ledger "$ledger_dir"
|
||||
default_arg --log -
|
||||
default_arg --enable-rpc-exit
|
||||
@@ -279,12 +273,6 @@ setup_validator_accounts() {
|
||||
fi
|
||||
echo "Validator vote account configured"
|
||||
|
||||
if ! wallet storage-account "$storage_keypair"; then
|
||||
echo "Creating validator storage account"
|
||||
wallet create-validator-storage-account "$identity" "$storage_keypair" || return $?
|
||||
fi
|
||||
echo "Validator storage account configured"
|
||||
|
||||
echo "Validator identity account balance:"
|
||||
wallet balance || return $?
|
||||
|
||||
@@ -295,7 +283,6 @@ rpc_url=$($solana_gossip rpc-url --entrypoint "$gossip_entrypoint" --any)
|
||||
|
||||
[[ -r "$identity" ]] || $solana_keygen new --no-passphrase -so "$identity"
|
||||
[[ -r "$vote_account" ]] || $solana_keygen new --no-passphrase -so "$vote_account"
|
||||
[[ -r "$storage_keypair" ]] || $solana_keygen new --no-passphrase -so "$storage_keypair"
|
||||
|
||||
setup_validator_accounts "$node_sol"
|
||||
|
||||
|
Reference in New Issue
Block a user