forked from solana-labs/tour-de-sol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrpc-check.sh
executable file
·23 lines (21 loc) · 1.04 KB
/
rpc-check.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
#
# Outputs some useful information about the TdS cluster.
#
# Example:
# $ ./rpc-check.sh # <-- query the TdS cluster entrypoint
# $ ./rpc-check.sh local # <-- query your local node (which should match what the TdS cluster entrypoint returned)
#
# Requires: https://stedolan.github.io/jq/
#
here=$(dirname "$0")
source $here/get-url.sh
set -x
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getLeaderSchedule"}' $url | jq
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getVoteAccounts"}' $url | jq
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getClusterNodes"}' $url | jq
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getEpochInfo"}' $url | jq
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getSlot"}' $url | jq
if [[ -f ~/validator-keypair.json ]]; then
solana --keypair ~/validator-keypair.json --url $url balance
fi