solana icon indicating copy to clipboard operation
solana copied to clipboard

RPC: Add ability to get information about all available snapshots on the cluster

Open diman-io opened this issue 1 year ago • 0 comments

Problem

There is no simple way to get information about available snapshots on the cluster.

Summary of Changes

Add optional param withSnapshots to getClusterNodes rpc request.

Request:

curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "method":"getClusterNodes", "params":[{"withSnapshots":true}]}'

Result (| jq '.'):

{
  "jsonrpc": "2.0",
  "result": [
    {
      "featureSet": 3605932003,
      "fullSnapshots": [
        [
          144515460,
          "EQcYuGoyMbKAxNVEW5pCSPQwybwdNYtVEcJ4vHD66sMD"
        ]
      ],
      "gossip": "135.181.60.221:8000",
      "incrementalSnapshots": [
        [
          144515460,
          144537749,
          "CNULcPDhJdayFX1kxQB7hnTtoZU3zmBtpYtmPtMSPg1p"
        ]
      ],
      "pubkey": "111AA9fqgNXBnzzV4Ef1CpNZbWqFvzKoT9vyYqDHSkF",
      "rpc": null,
      "shredVersion": 33548,
      "tpu": "135.181.60.221:8003",
      "version": "1.12.0"
    },
    {
      "featureSet": 3605932003,
      "fullSnapshots": [
        [
          144476180,
          "AFeNP6yMqZFac1LzfP1SVrBGSZdhugHxigjYqibUvEPK"
        ],
        [
          144515460,
          "EQcYuGoyMbKAxNVEW5pCSPQwybwdNYtVEcJ4vHD66sMD"
        ]
      ],
      "gossip": "144.76.60.22:8000",
      "incrementalSnapshots": [
        [
          144515460,
          144533663,
          "3J95De9FtFtS3cgE7K83uFzEn9XAuNKHtF2YTFUoKRzR"
        ],
        [
          144515460,
          144535162,
          "Fa9PvgA2hTMKEaGikzZHQhuBsdFpeSMNnvDZ7zYYykGv"
        ],
        [
          144515460,
          144537446,
          "3Thsk76kYvDGiWXMhVmbN7kqxgUqi4CfderaJUD4Jvtn"
        ],
        [
          144515460,
          144538245,
          "CeHwyC4QtJDeki3f2Bc5Pm14pgE5gFBHJ4ttd7TX74Me"
        ]
      ],
      "pubkey": "52GEvaeCcEyAUKrfoPcey6vdyw6th588nYPuCkn3Kxes",
      "rpc": "144.76.60.22:8899",
      "shredVersion": 33548,
      "tpu": "144.76.60.22:8003",
      "version": "1.11.5"
    },
...

diman-io avatar Aug 07 '22 22:08 diman-io