init-bigtable.sh 471 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env bash
  2. #
  3. # Configures a BigTable instance with the expected tables
  4. #
  5. set -e
  6. instance=solana-ledger
  7. cbt=(
  8. cbt
  9. -instance
  10. "$instance"
  11. )
  12. if [[ -n $BIGTABLE_EMULATOR_HOST ]]; then
  13. cbt+=(-project emulator)
  14. fi
  15. for table in blocks entries tx tx-by-addr; do
  16. (
  17. set -x
  18. "${cbt[@]}" createtable $table
  19. "${cbt[@]}" createfamily $table x
  20. "${cbt[@]}" setgcpolicy $table x maxversions=1
  21. "${cbt[@]}" setgcpolicy $table x maxage=360d
  22. )
  23. done