fetch-core-bpf.sh 1001 B

12345678910111213141516171819202122232425262728293031
  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. source fetch-programs.sh
  8. PREFIX="core-bpf"
  9. programs=()
  10. add_core_bpf_program_to_fetch() {
  11. declare name=$1
  12. declare version=$2
  13. declare address=$3
  14. declare loader=$4
  15. so_name="solana_${name//-/_}_program.so"
  16. declare download_url="https://github.com/solana-program/$name/releases/download/program%40$version/$so_name"
  17. programs+=("$name $version $address $loader $download_url")
  18. }
  19. add_core_bpf_program_to_fetch address-lookup-table 3.0.0 AddressLookupTab1e1111111111111111111111111 BPFLoaderUpgradeab1e11111111111111111111111
  20. add_core_bpf_program_to_fetch config 3.0.0 Config1111111111111111111111111111111111111 BPFLoaderUpgradeab1e11111111111111111111111
  21. add_core_bpf_program_to_fetch feature-gate 0.0.1 Feature111111111111111111111111111111111111 BPFLoaderUpgradeab1e11111111111111111111111
  22. fetch_programs "$PREFIX" "${programs[@]}"