setup.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/usr/bin/env bash
  2. here=$(dirname "$0")
  3. # shellcheck source=multinode-demo/common.sh
  4. source "$here"/common.sh
  5. set -e
  6. rm -rf "$SOLANA_CONFIG_DIR"/bootstrap-validator
  7. mkdir -p "$SOLANA_CONFIG_DIR"/bootstrap-validator
  8. # Create genesis ledger
  9. if [[ -r $FAUCET_KEYPAIR ]]; then
  10. cp -f "$FAUCET_KEYPAIR" "$SOLANA_CONFIG_DIR"/faucet.json
  11. else
  12. $solana_keygen new --no-passphrase -fso "$SOLANA_CONFIG_DIR"/faucet.json
  13. fi
  14. if [[ -f $BOOTSTRAP_VALIDATOR_IDENTITY_KEYPAIR ]]; then
  15. cp -f "$BOOTSTRAP_VALIDATOR_IDENTITY_KEYPAIR" "$SOLANA_CONFIG_DIR"/bootstrap-validator/identity.json
  16. else
  17. $solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/identity.json
  18. fi
  19. if [[ -f $BOOTSTRAP_VALIDATOR_STAKE_KEYPAIR ]]; then
  20. cp -f "$BOOTSTRAP_VALIDATOR_STAKE_KEYPAIR" "$SOLANA_CONFIG_DIR"/bootstrap-validator/stake-account.json
  21. else
  22. $solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/stake-account.json
  23. fi
  24. if [[ -f $BOOTSTRAP_VALIDATOR_VOTE_KEYPAIR ]]; then
  25. cp -f "$BOOTSTRAP_VALIDATOR_VOTE_KEYPAIR" "$SOLANA_CONFIG_DIR"/bootstrap-validator/vote-account.json
  26. else
  27. $solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/vote-account.json
  28. fi
  29. args=(
  30. "$@"
  31. --max-genesis-archive-unpacked-size 1073741824
  32. --enable-warmup-epochs
  33. --bootstrap-validator "$SOLANA_CONFIG_DIR"/bootstrap-validator/identity.json
  34. "$SOLANA_CONFIG_DIR"/bootstrap-validator/vote-account.json
  35. "$SOLANA_CONFIG_DIR"/bootstrap-validator/stake-account.json
  36. )
  37. "$SOLANA_ROOT"/fetch-core-bpf.sh
  38. if [[ -r core-bpf-genesis-args.sh ]]; then
  39. CORE_BPF_GENESIS_ARGS=$(cat "$SOLANA_ROOT"/core-bpf-genesis-args.sh)
  40. #shellcheck disable=SC2207
  41. #shellcheck disable=SC2206
  42. args+=($CORE_BPF_GENESIS_ARGS)
  43. fi
  44. "$SOLANA_ROOT"/fetch-spl.sh
  45. if [[ -r spl-genesis-args.sh ]]; then
  46. SPL_GENESIS_ARGS=$(cat "$SOLANA_ROOT"/spl-genesis-args.sh)
  47. #shellcheck disable=SC2207
  48. #shellcheck disable=SC2206
  49. args+=($SPL_GENESIS_ARGS)
  50. fi
  51. default_arg --ledger "$SOLANA_CONFIG_DIR"/bootstrap-validator
  52. default_arg --faucet-pubkey "$SOLANA_CONFIG_DIR"/faucet.json
  53. default_arg --faucet-lamports 500000000000000000
  54. default_arg --hashes-per-tick auto
  55. default_arg --cluster-type development
  56. $solana_genesis "${args[@]}"