diff --git a/tools/deprecated/replace-index-magic.go b/tools/deprecated/replace-index-magic.go deleted file mode 100644 index fcbcb8bf..00000000 --- a/tools/deprecated/replace-index-magic.go +++ /dev/null @@ -1,64 +0,0 @@ -package main - -import ( - "bytes" - "flag" - "fmt" - "io" - "os" -) - -// for file in $(find /media/runner/solana-2/indexes -name "*.index" | grep mainnet); do -// echo $file -// go run . $file -// done - -var ( - oldMagic = [8]byte{'r', 'd', 'c', 'e', 'c', 'i', 'd', 'x'} - // compact index sized - newMagic = [8]byte{'c', 'o', 'm', 'p', 'i', 's', 'z', 'd'} -) - -func main() { - var dry bool - flag.BoolVar(&dry, "dry", false, "dry run") - flag.Parse() - file := flag.Arg(0) - if file == "" { - panic("need file arg") - } - fmt.Println() - fmt.Printf("File: %s\n", file) - // open read write - f, err := os.OpenFile(file, os.O_RDWR, 0) - if err != nil { - panic(err) - } - defer f.Close() - b := make([]byte, 8) - _, err = io.ReadFull(f, b) - if err != nil { - panic(err) - } - - fmt.Printf("First 8 bytes = %v , as string = %s\n", b, b) - target := oldMagic - if !bytes.Equal(b, target[:]) { - fmt.Printf("Doesn't match old magic; skipping\n") - return - } - if dry { - fmt.Printf("⚪ Dry run, not replacing and exiting\n") - return - } - fmt.Printf("Found old magic; replacing with new magic\n") - _, err = f.Seek(0, 0) - if err != nil { - panic(err) - } - _, err = f.Write(newMagic[:]) - if err != nil { - panic(err) - } - fmt.Printf("✅ Replaced old magic with new magic.\n") -} diff --git a/tools/download-indexes.sh b/tools/download-indexes.sh index 0ba215e2..bb860017 100755 --- a/tools/download-indexes.sh +++ b/tools/download-indexes.sh @@ -42,10 +42,10 @@ fi CID_URL=https://files.old-faithful.net/${EPOCH}/epoch-${EPOCH}.cid EPOCH_CID=$($READ_COMMAND $CID_URL) -INDEXES=(slot-to-cid sig-to-cid cid-to-offset) +INDEXES=(slot-to-cid sig-to-cid cid-to-offset sig-exists) for INDEX in "${INDEXES[@]}"; do INDEX_URL=https://files.old-faithful.net/${EPOCH}/epoch-${EPOCH}.car.${EPOCH_CID}.${INDEX}.index set -x $DOWNLOAD_COMMAND $INDEX_URL set +x -done \ No newline at end of file +done diff --git a/tools/run-rpc-server-local-indexes.sh b/tools/run-rpc-server-local-indexes.sh deleted file mode 100755 index dc82c34d..00000000 --- a/tools/run-rpc-server-local-indexes.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -set -o pipefail -set -e - -# Check if there is an epoch number provided -if [ $# -eq 0 ]; then - echo "No epoch number provided" - exit 1 -fi - -EPOCH=$1 -# Check if the epoch number is a number -re='^[0-9]+$' -if ! [[ $EPOCH =~ $re ]]; then - echo "Epoch number is not a number" - exit 1 -fi - -# Check if the epoch number is greater than or equal to 0 -if [ $EPOCH -lt 0 ]; then - echo "Epoch number is less than 0" - exit 1 -fi - -INDEX_DIR=${2:-.} - -# TODO: fix with the correct URL for the epoch config file. -EPOCH_CONFIG_URL=https://files.old-faithful.net/${EPOCH}/epoch-${EPOCH}.yml - -wget -q ${EPOCH_CONFIG_URL} -O epoch-${EPOCH}.yml - -set -x -faithful-cli rpc --listen ":7999" \ - epoch-${EPOCH}.yml diff --git a/tools/run-rpc-server-local.sh b/tools/run-rpc-server-local.sh deleted file mode 100755 index 1256be30..00000000 --- a/tools/run-rpc-server-local.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -set -o pipefail -set -e - -# Check if there is an epoch number provided -if [ $# -eq 0 ]; then - echo "No epoch number provided" - exit 1 -fi - -EPOCH=$1 -# Check if the epoch number is a number -re='^[0-9]+$' -if ! [[ $EPOCH =~ $re ]]; then - echo "Epoch number is not a number" - exit 1 -fi - -# Check if the epoch number is greater than or equal to 0 -if [ $EPOCH -lt 0 ]; then - echo "Epoch number is less than 0" - exit 1 -fi - -EPOCH_DIR=${2:-.} - -set -x -faithful-cli rpc --listen ":7999" \ - ${EPOCH_DIR}/epoch-${EPOCH}.yml diff --git a/tools/run-rpc-server-remote.sh b/tools/run-rpc-server-remote.sh deleted file mode 100755 index 925db221..00000000 --- a/tools/run-rpc-server-remote.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -set -o pipefail -set -e - -echo "WARNING: THIS IS GOING TO BE SLOW" - -# Check if there is an epoch number provided -if [ $# -eq 0 ]; then - echo "No epoch number provided" - exit 1 -fi - -EPOCH=$1 -# Check if the epoch number is a number -re='^[0-9]+$' -if ! [[ $EPOCH =~ $re ]]; then - echo "Epoch number is not a number" - exit 1 -fi - -# Check if the epoch number is greater than or equal to 0 -if [ $EPOCH -lt 0 ]; then - echo "Epoch number is less than 0" - exit 1 -fi - -# Check if wget is available -DOWNLOAD_COMMAND="wget" -READ_COMMAND="wget -qO-" -if ! [ -x "$(command -v wget)" ]; then - # Fallback to curl - if ! [ -x "$(command -v curl)" ]; then - echo "curl nor wget not installed" - exit 1 - else - DOWNLOAD_COMMAND="curl -O" - READ_COMMAND="curl -s" - fi - echo "wget is not installed" - exit 1 -fi - -CID_URL=https://files.old-faithful.net/${EPOCH}/epoch-${EPOCH}.cid -EPOCH_CID=$($READ_COMMAND $CID_URL) - -EPOCH_CONFIG_URL=https://files.old-faithful.net/${EPOCH}/epoch-${EPOCH}.yml - -wget -q ${EPOCH_CONFIG_URL} -O epoch-${EPOCH}.yml - -set -x -faithful-cli rpc --listen ":7999" \ - epoch-${EPOCH}.yml