2018-11-11 08:02:50 -08:00
|
|
|
#!/usr/bin/env bash
|
2018-06-24 10:10:55 -07:00
|
|
|
|
2018-06-23 11:52:12 -07:00
|
|
|
here=$(dirname "$0")
|
2018-06-24 10:10:55 -07:00
|
|
|
# shellcheck source=multinode-demo/common.sh
|
|
|
|
source "$here"/common.sh
|
2018-06-23 11:52:12 -07:00
|
|
|
|
2018-06-24 10:10:55 -07:00
|
|
|
set -e
|
2019-09-19 08:31:22 -07:00
|
|
|
|
|
|
|
rm -rf "$SOLANA_CONFIG_DIR"/bootstrap-leader
|
|
|
|
mkdir -p "$SOLANA_CONFIG_DIR"/bootstrap-leader
|
2018-06-18 15:23:56 -07:00
|
|
|
|
2019-04-17 18:03:58 -07:00
|
|
|
# Create genesis ledger
|
2019-11-06 20:14:05 -08:00
|
|
|
if [[ -r $MINT_KEYPAIR ]]; then
|
|
|
|
cp -f "$MINT_KEYPAIR" "$SOLANA_CONFIG_DIR"/mint-keypair.json
|
|
|
|
else
|
|
|
|
$solana_keygen new -f -o "$SOLANA_CONFIG_DIR"/mint-keypair.json
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -f $BOOTSTRAP_LEADER_IDENTITY_KEYPAIR ]]; then
|
|
|
|
cp -f "$BOOTSTRAP_LEADER_IDENTITY_KEYPAIR" "$SOLANA_CONFIG_DIR"/bootstrap-leader/identity-keypair.json
|
|
|
|
else
|
|
|
|
$solana_keygen new -o "$SOLANA_CONFIG_DIR"/bootstrap-leader/identity-keypair.json
|
|
|
|
fi
|
2019-07-30 22:43:47 -07:00
|
|
|
|
|
|
|
$solana_keygen new -o "$SOLANA_CONFIG_DIR"/bootstrap-leader/vote-keypair.json
|
|
|
|
$solana_keygen new -o "$SOLANA_CONFIG_DIR"/bootstrap-leader/stake-keypair.json
|
|
|
|
$solana_keygen new -o "$SOLANA_CONFIG_DIR"/bootstrap-leader/storage-keypair.json
|
2019-04-16 13:03:01 -07:00
|
|
|
|
2019-05-07 20:28:41 -07:00
|
|
|
args=("$@")
|
2019-11-06 11:18:25 -08:00
|
|
|
default_arg --bootstrap-leader-pubkey "$SOLANA_CONFIG_DIR"/bootstrap-leader/identity-keypair.json
|
|
|
|
default_arg --bootstrap-vote-pubkey "$SOLANA_CONFIG_DIR"/bootstrap-leader/vote-keypair.json
|
|
|
|
default_arg --bootstrap-stake-pubkey "$SOLANA_CONFIG_DIR"/bootstrap-leader/stake-keypair.json
|
|
|
|
default_arg --bootstrap-storage-pubkey "$SOLANA_CONFIG_DIR"/bootstrap-leader/storage-keypair.json
|
2019-08-05 12:42:52 -07:00
|
|
|
default_arg --ledger "$SOLANA_CONFIG_DIR"/bootstrap-leader
|
2019-05-08 19:59:22 -07:00
|
|
|
default_arg --mint "$SOLANA_CONFIG_DIR"/mint-keypair.json
|
2019-06-06 12:49:46 -07:00
|
|
|
default_arg --hashes-per-tick auto
|
2019-11-15 12:18:45 -08:00
|
|
|
default_arg --operating-mode development
|
2019-04-17 18:03:58 -07:00
|
|
|
$solana_genesis "${args[@]}"
|
2019-05-07 20:28:41 -07:00
|
|
|
|
2019-07-30 22:43:47 -07:00
|
|
|
(
|
2019-08-05 12:42:52 -07:00
|
|
|
cd "$SOLANA_CONFIG_DIR"/bootstrap-leader
|
2019-07-30 22:43:47 -07:00
|
|
|
set -x
|
2019-08-14 19:25:22 -07:00
|
|
|
tar jcvfS genesis.tar.bz2 genesis.bin rocksdb
|
2019-07-30 22:43:47 -07:00
|
|
|
)
|