Delete fullnode-config/
This commit is contained in:
@ -10,8 +10,8 @@ source "$here"/common.sh
|
||||
# shellcheck source=scripts/oom-score-adj.sh
|
||||
source "$here"/../scripts/oom-score-adj.sh
|
||||
|
||||
[[ -f "$SOLANA_CONFIG_DIR"/bootstrap-leader.json ]] || {
|
||||
echo "$SOLANA_CONFIG_DIR/bootstrap-leader.json not found, create it by running:"
|
||||
[[ -f "$SOLANA_CONFIG_DIR"/bootstrap-leader-id.json ]] || {
|
||||
echo "$SOLANA_CONFIG_DIR/bootstrap-leader-id.json not found, create it by running:"
|
||||
echo
|
||||
echo " ${here}/setup.sh"
|
||||
exit 1
|
||||
@ -23,26 +23,6 @@ else
|
||||
program="$solana_fullnode"
|
||||
fi
|
||||
|
||||
maybe_blockstream=
|
||||
maybe_init_complete_file=
|
||||
maybe_no_leader_rotation=
|
||||
|
||||
while [[ -n $1 ]]; do
|
||||
if [[ $1 = --init-complete-file ]]; then
|
||||
maybe_init_complete_file="--init-complete-file $2"
|
||||
shift 2
|
||||
elif [[ $1 = --blockstream ]]; then
|
||||
maybe_blockstream="$1 $2"
|
||||
shift 2
|
||||
elif [[ $1 = --no-leader-rotation ]]; then
|
||||
maybe_no_leader_rotation="--no-leader-rotation"
|
||||
shift
|
||||
else
|
||||
echo "Unknown argument: $1"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
tune_system
|
||||
|
||||
trap 'kill "$pid" && wait "$pid"' INT TERM
|
||||
@ -50,13 +30,11 @@ $solana_ledger_tool --ledger "$SOLANA_CONFIG_DIR"/bootstrap-leader-ledger verify
|
||||
|
||||
# shellcheck disable=SC2086 # Don't want to double quote maybe_blockstream or maybe_init_complete_file
|
||||
$program \
|
||||
$maybe_blockstream \
|
||||
$maybe_init_complete_file \
|
||||
$maybe_no_leader_rotation \
|
||||
--identity "$SOLANA_CONFIG_DIR"/bootstrap-leader.json \
|
||||
--identity "$SOLANA_CONFIG_DIR"/bootstrap-leader-id.json \
|
||||
--ledger "$SOLANA_CONFIG_DIR"/bootstrap-leader-ledger \
|
||||
--accounts "$SOLANA_CONFIG_DIR"/bootstrap-leader-accounts \
|
||||
--rpc-port 8899 \
|
||||
"$@" \
|
||||
> >($bootstrap_leader_logger) 2>&1 &
|
||||
pid=$!
|
||||
oom_score_adj "$pid" 1000
|
||||
|
@ -60,7 +60,6 @@ solana_bench_tps=$(solana_program bench-tps)
|
||||
solana_wallet=$(solana_program wallet)
|
||||
solana_drone=$(solana_program drone)
|
||||
solana_fullnode=$(solana_program fullnode)
|
||||
solana_fullnode_config=$(solana_program fullnode-config)
|
||||
solana_fullnode_cuda=$(solana_program fullnode-cuda)
|
||||
solana_genesis=$(solana_program genesis)
|
||||
solana_keygen=$(solana_program keygen)
|
||||
|
@ -25,6 +25,7 @@ Start a full node on the specified network
|
||||
--blockstream PATH - open blockstream at this unix domain socket location
|
||||
--init-complete-file FILE - create this file, if it doesn't already exist, once node initialization is complete
|
||||
--no-leader-rotation - disable leader rotation
|
||||
--public-address - advertise public machine address in gossip. By default the local machine address is advertised
|
||||
--no-signer - start node without vote signer
|
||||
--rpc-port port - custom RPC port for this node
|
||||
|
||||
@ -36,7 +37,9 @@ if [[ $1 = -h ]]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
gossip_port=9000
|
||||
maybe_blockstream=
|
||||
maybe_public_address=
|
||||
maybe_init_complete_file=
|
||||
maybe_no_leader_rotation=
|
||||
maybe_no_signer=
|
||||
@ -56,13 +59,16 @@ while [[ ${1:0:1} = - ]]; do
|
||||
maybe_blockstream="$1 $2"
|
||||
shift 2
|
||||
elif [[ $1 = --init-complete-file ]]; then
|
||||
maybe_init_complete_file="--init-complete-file $2"
|
||||
maybe_init_complete_file="$1 $2"
|
||||
shift 2
|
||||
elif [[ $1 = --no-leader-rotation ]]; then
|
||||
maybe_no_leader_rotation="--no-leader-rotation"
|
||||
maybe_no_leader_rotation=$1
|
||||
shift
|
||||
elif [[ $1 = --public-address ]]; then
|
||||
maybe_public_address=$1
|
||||
shift
|
||||
elif [[ $1 = --no-signer ]]; then
|
||||
maybe_no_signer="--no-signer"
|
||||
maybe_no_signer=$1
|
||||
shift
|
||||
elif [[ $1 = --rpc-port ]]; then
|
||||
maybe_rpc_port="$1 $2"
|
||||
@ -119,14 +125,13 @@ else
|
||||
fi
|
||||
|
||||
if ((!self_setup)); then
|
||||
[[ -f $SOLANA_CONFIG_DIR/fullnode.json ]] || {
|
||||
echo "$SOLANA_CONFIG_DIR/fullnode.json not found, create it by running:"
|
||||
[[ -f $SOLANA_CONFIG_DIR/fullnode-id.json ]] || {
|
||||
echo "$SOLANA_CONFIG_DIR/fullnode-id.json not found, create it by running:"
|
||||
echo
|
||||
echo " ${here}/setup.sh"
|
||||
exit 1
|
||||
}
|
||||
fullnode_id_path=$SOLANA_CONFIG_DIR/fullnode-id.json
|
||||
fullnode_json_path=$SOLANA_CONFIG_DIR/fullnode.json
|
||||
ledger_config_dir=$SOLANA_CONFIG_DIR/fullnode-ledger
|
||||
accounts_config_dir=$SOLANA_CONFIG_DIR/fullnode-accounts
|
||||
else
|
||||
@ -134,24 +139,18 @@ else
|
||||
fullnode_id_path=$SOLANA_CONFIG_DIR/fullnode-id-x$self_setup_label.json
|
||||
[[ -f "$fullnode_id_path" ]] || $solana_keygen -o "$fullnode_id_path"
|
||||
|
||||
mkdir -p "$SOLANA_CONFIG_DIR"
|
||||
fullnode_json_path=$SOLANA_CONFIG_DIR/fullnode-x$self_setup_label.json
|
||||
[[ -f "$fullnode_json_path" ]] || {
|
||||
echo "Finding a port.."
|
||||
# Find an available port in the range 9100-9899
|
||||
(( port = 9100 + ($$ % 800) ))
|
||||
while true; do
|
||||
(( port = port >= 9900 ? 9100 : ++port ))
|
||||
echo "Testing $port"
|
||||
if ! nc -w 10 -z 127.0.0.1 $port; then
|
||||
echo "Selected port $port"
|
||||
break;
|
||||
fi
|
||||
echo "Port $port is in use"
|
||||
done
|
||||
$solana_fullnode_config --keypair="$fullnode_id_path" -l -b "$port" > "$fullnode_json_path"
|
||||
}
|
||||
|
||||
echo "Finding a port.."
|
||||
# Find an available port in the range 9100-9899
|
||||
(( gossip_port = 9100 + ($$ % 800) ))
|
||||
while true; do
|
||||
(( gossip_port = gossip_port >= 9900 ? 9100 : ++gossip_port ))
|
||||
echo "Testing $gossip_port"
|
||||
if ! nc -w 10 -z 127.0.0.1 $gossip_port; then
|
||||
echo "Selected gossip_port $gossip_port"
|
||||
break;
|
||||
fi
|
||||
echo "Port $gossip_port is in use"
|
||||
done
|
||||
ledger_config_dir=$SOLANA_CONFIG_DIR/fullnode-ledger-x$self_setup_label
|
||||
accounts_config_dir=$SOLANA_CONFIG_DIR/fullnode-accounts-x$self_setup_label
|
||||
fi
|
||||
@ -219,14 +218,16 @@ if [[ ! -d "$ledger_config_dir" ]]; then
|
||||
fi
|
||||
|
||||
trap 'kill "$pid" && wait "$pid"' INT TERM
|
||||
# shellcheck disable=SC2086 # Don't want to double quote maybe_blockstream or maybe_init_complete_file or maybe_no_signer or maybe_rpc_port
|
||||
# shellcheck disable=SC2086 # Don't want to double quote maybe_blockstream or maybe_init_complete_file or ...
|
||||
$program \
|
||||
$maybe_blockstream \
|
||||
$maybe_init_complete_file \
|
||||
$maybe_no_leader_rotation \
|
||||
$maybe_no_signer \
|
||||
$maybe_rpc_port \
|
||||
--identity "$fullnode_json_path" \
|
||||
$maybe_public_address \
|
||||
--gossip-port "$gossip_port" \
|
||||
--identity "$fullnode_id_path" \
|
||||
--network "$leader_address" \
|
||||
--ledger "$ledger_config_dir" \
|
||||
--accounts "$accounts_config_dir" \
|
||||
|
@ -19,9 +19,6 @@ usage: $0 [-n num_tokens] [-l] [-p] [-t node_type]
|
||||
Creates a fullnode configuration
|
||||
|
||||
-n num_tokens - Number of tokens to create
|
||||
-l - Detect network address from local machine configuration, which
|
||||
may be a private IP address unaccessible on the Intenet (default)
|
||||
-p - Detect public address using public Internet servers
|
||||
-t node_type - Create configuration files only for this kind of node. Valid
|
||||
options are bootstrap-leader or fullnode. Creates configuration files
|
||||
for both by default
|
||||
@ -30,7 +27,6 @@ EOF
|
||||
exit $exitcode
|
||||
}
|
||||
|
||||
ip_address_arg=-l
|
||||
num_tokens=1000000000
|
||||
bootstrap_leader=true
|
||||
fullnode=true
|
||||
@ -40,12 +36,6 @@ while getopts "h?n:lpt:" opt; do
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
l)
|
||||
ip_address_arg=-l
|
||||
;;
|
||||
p)
|
||||
ip_address_arg=-p
|
||||
;;
|
||||
n)
|
||||
num_tokens="$OPTARG"
|
||||
;;
|
||||
@ -91,26 +81,13 @@ if $bootstrap_leader; then
|
||||
--ledger "$SOLANA_RSYNC_CONFIG_DIR"/ledger \
|
||||
--mint "$SOLANA_CONFIG_DIR"/mint-id.json \
|
||||
--num_tokens "$num_tokens"
|
||||
)
|
||||
|
||||
# Create bootstrap leader configuration
|
||||
(
|
||||
set -x
|
||||
$solana_fullnode_config \
|
||||
--keypair="$SOLANA_CONFIG_DIR"/bootstrap-leader-id.json \
|
||||
"$ip_address_arg" > "$SOLANA_CONFIG_DIR"/bootstrap-leader.json
|
||||
|
||||
cp -a "$SOLANA_RSYNC_CONFIG_DIR"/ledger "$SOLANA_CONFIG_DIR"/bootstrap-leader-ledger
|
||||
)
|
||||
fi
|
||||
|
||||
|
||||
if $fullnode; then
|
||||
(
|
||||
set -x
|
||||
$solana_keygen -o "$SOLANA_CONFIG_DIR"/fullnode-id.json
|
||||
$solana_fullnode_config \
|
||||
--keypair="$SOLANA_CONFIG_DIR"/fullnode-id.json \
|
||||
"$ip_address_arg" -b 9000 > "$SOLANA_CONFIG_DIR"/fullnode.json
|
||||
)
|
||||
fi
|
||||
|
Reference in New Issue
Block a user