Rename leader/validator to bootstrap-leader/fullnode
Only rsyncing the genesis ledger snuck in here as well
This commit is contained in:
@ -23,7 +23,7 @@ Creates a fullnode configuration
|
||||
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 validator or leader. Creates configuration files
|
||||
options are bootstrap_leader or fullnode. Creates configuration files
|
||||
for both by default
|
||||
|
||||
EOF
|
||||
@ -32,8 +32,8 @@ EOF
|
||||
|
||||
ip_address_arg=-l
|
||||
num_tokens=1000000000
|
||||
node_type_leader=true
|
||||
node_type_validator=true
|
||||
bootstrap_leader=true
|
||||
fullnode=true
|
||||
while getopts "h?n:lpt:" opt; do
|
||||
case $opt in
|
||||
h|\?)
|
||||
@ -52,13 +52,13 @@ while getopts "h?n:lpt:" opt; do
|
||||
t)
|
||||
node_type="$OPTARG"
|
||||
case $OPTARG in
|
||||
leader)
|
||||
node_type_leader=true
|
||||
node_type_validator=false
|
||||
bootstrap_leader|leader) # TODO: Remove legacy 'leader' option
|
||||
bootstrap_leader=true
|
||||
fullnode=false
|
||||
;;
|
||||
validator)
|
||||
node_type_leader=false
|
||||
node_type_validator=true
|
||||
fullnode|validator) # TODO: Remove legacy 'validator' option
|
||||
bootstrap_leader=false
|
||||
fullnode=true
|
||||
;;
|
||||
*)
|
||||
usage "Error: unknown node type: $node_type"
|
||||
@ -74,49 +74,43 @@ done
|
||||
|
||||
set -e
|
||||
|
||||
for i in "$SOLANA_CONFIG_DIR" "$SOLANA_CONFIG_VALIDATOR_DIR" "$SOLANA_CONFIG_PRIVATE_DIR"; do
|
||||
for i in "$SOLANA_RSYNC_CONFIG_DIR" "$SOLANA_CONFIG_DIR"; do
|
||||
echo "Cleaning $i"
|
||||
rm -rvf "$i"
|
||||
mkdir -p "$i"
|
||||
done
|
||||
|
||||
if $node_type_leader; then
|
||||
leader_address_args=("$ip_address_arg")
|
||||
leader_id_path="$SOLANA_CONFIG_PRIVATE_DIR"/leader-id.json
|
||||
mint_id_path="$SOLANA_CONFIG_PRIVATE_DIR"/mint-id.json
|
||||
if $bootstrap_leader; then
|
||||
# Create genesis configuration
|
||||
(
|
||||
set -x
|
||||
$solana_keygen -o "$SOLANA_CONFIG_DIR"/mint-id.json
|
||||
$solana_keygen -o "$SOLANA_CONFIG_DIR"/bootstrap-leader-id.json
|
||||
$solana_genesis \
|
||||
--bootstrap-leader-keypair "$SOLANA_CONFIG_DIR"/bootstrap-leader-id.json \
|
||||
--ledger "$SOLANA_RSYNC_CONFIG_DIR"/ledger \
|
||||
--mint "$SOLANA_CONFIG_DIR"/mint-id.json \
|
||||
--num_tokens "$num_tokens"
|
||||
)
|
||||
|
||||
$solana_keygen -o "$leader_id_path"
|
||||
# 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
|
||||
|
||||
echo "Creating $mint_id_path with $num_tokens tokens"
|
||||
$solana_keygen -o "$mint_id_path"
|
||||
|
||||
echo "Creating $SOLANA_CONFIG_DIR/leader.json"
|
||||
$solana_fullnode_config \
|
||||
--keypair="$leader_id_path" \
|
||||
"${leader_address_args[@]}" > "$SOLANA_CONFIG_DIR"/leader.json
|
||||
|
||||
echo "Creating $SOLANA_CONFIG_DIR/ledger"
|
||||
$solana_genesis \
|
||||
--num_tokens "$num_tokens" \
|
||||
--mint "$mint_id_path" \
|
||||
--bootstrap-leader-keypair "$leader_id_path" \
|
||||
--ledger "$SOLANA_CONFIG_DIR"/ledger \
|
||||
|
||||
ls -lhR "$SOLANA_CONFIG_DIR"/
|
||||
ls -lhR "$SOLANA_CONFIG_PRIVATE_DIR"/
|
||||
cp -ra "$SOLANA_RSYNC_CONFIG_DIR"/ledger "$SOLANA_CONFIG_DIR"/bootstrap-leader-ledger
|
||||
)
|
||||
fi
|
||||
|
||||
|
||||
if $node_type_validator; then
|
||||
validator_address_args=("$ip_address_arg" -b 9000)
|
||||
validator_id_path="$SOLANA_CONFIG_PRIVATE_DIR"/validator-id.json
|
||||
|
||||
$solana_keygen -o "$validator_id_path"
|
||||
|
||||
echo "Creating $SOLANA_CONFIG_VALIDATOR_DIR/validator.json"
|
||||
$solana_fullnode_config \
|
||||
--keypair="$validator_id_path" \
|
||||
"${validator_address_args[@]}" > "$SOLANA_CONFIG_VALIDATOR_DIR"/validator.json
|
||||
|
||||
ls -lhR "$SOLANA_CONFIG_VALIDATOR_DIR"/
|
||||
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