From c5be85c9ace808b037e505e41bd0cdc479c60d63 Mon Sep 17 00:00:00 2001 From: Slavomir Date: Thu, 1 Jul 2021 13:43:10 +0200 Subject: [PATCH] Add RPC/getClusterNodes --- rpc/getClusterNodes.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 rpc/getClusterNodes.go diff --git a/rpc/getClusterNodes.go b/rpc/getClusterNodes.go new file mode 100644 index 0000000..b832ffe --- /dev/null +++ b/rpc/getClusterNodes.go @@ -0,0 +1,27 @@ +package rpc + +import ( + "context" + + bin "github.com/dfuse-io/binary" + "github.com/dfuse-io/solana-go" +) + +type GetClusterNodesResult struct { + Pubkey solana.PublicKey `json:"pubkey"` // Node public key, as base-58 encoded string + Gossip string `json:"gossip"` // Gossip network address for the node + TPU string `json:"tpu"` // TPU network address for the node + + // TODO: "" or nil ? + RPC string `json:"rpc"` // JSON RPC network address for the node, or empty if the JSON RPC service is not enabled + Version string `json:"version"` // The software version of the node, or empty if the version information is not available + FeatureSet bin.Int64 `json:"featureSet"` // The unique identifier of the node's feature set + ShredVersion bin.Int64 `json:"shredVersion"` // The shred version the node has been configured to use +} + +// GetClusterNodes returns information about all the nodes participating in the cluster. +func (cl *Client) GetClusterNodes(ctx context.Context) (out []*GetClusterNodesResult, err error) { + params := []interface{}{} + err = cl.rpcClient.CallFor(&out, "getClusterNodes", params...) + return +}