fetch-core-bpf.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env bash
  2. #
  3. # Fetches the latest Core BPF programs and produces the solana-genesis
  4. # command-line arguments needed to install them
  5. #
  6. set -e
  7. here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
  8. source "$here"/fetch-programs.sh
  9. PREFIX="core-bpf"
  10. programs=()
  11. add_core_bpf_program_to_fetch() {
  12. declare name=$1
  13. declare version=$2
  14. declare address=$3
  15. declare loader=$4
  16. so_name="solana_${name//-/_}_program.so"
  17. declare download_url="https://github.com/solana-program/$name/releases/download/program%40v$version/$so_name"
  18. programs+=("$name $version $address $loader $download_url")
  19. }
  20. add_core_bpf_program_to_fetch address-lookup-table 3.0.0 AddressLookupTab1e1111111111111111111111111 BPFLoaderUpgradeab1e11111111111111111111111
  21. add_core_bpf_program_to_fetch config 3.0.0 Config1111111111111111111111111111111111111 BPFLoaderUpgradeab1e11111111111111111111111
  22. add_core_bpf_program_to_fetch feature-gate 0.0.1 Feature111111111111111111111111111111111111 BPFLoaderUpgradeab1e11111111111111111111111
  23. add_core_bpf_program_to_fetch stake 1.0.0 Stake11111111111111111111111111111111111111 BPFLoaderUpgradeab1e11111111111111111111111
  24. fetch_programs "$PREFIX" "${programs[@]}"