Skip to content

Conversation

@leafaar
Copy link
Contributor

@leafaar leafaar commented Jun 9, 2025

Problem

We need the Client-ID to use on validators.app

Summary of Changes

I made a simple modification where I'm using the Debug version output of Version, because it exposes the Client ID;

impl fmt::Debug for Version {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(
            f,
            "{}.{}.{} (src:{:08x}; feat:{}, client:{:?})",
            self.major,
            self.minor,
            self.patch,
            self.commit,
            self.feature_set,
            self.client(),
        )
    }
}

I didn't wanted to add a new parameter to the client-id because it would change the API for the getClusterNodes, so what you will receive now instead of the version is:
2.2.15 (src:00000000; feat:798020478, client:Agave)
instead of
2.2.15

It's easy to parse this, if you want to get the version just split based on the "(" and get the first part, then to get the version do the same but for "client:" and get second part.

here's what you going to see (I prettified the json, just to make easy to visualize.)

leafar@rafael-pc:~$ curl -X POST http://127.0.0.1:8899 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getClusterNodes"
  }'

RESPONSE:

{
  "jsonrpc": "2.0",
  "result": [
    {
      "featureSet": 798020478,
      "gossip": "127.0.0.1:1024",
      "pubkey": "CEucL8UAsFZur9Ce57F7jM5hr7RVMY1KYwgbL5nQrbFE",
      "pubsub": "127.0.0.1:8900",
      "rpc": "127.0.0.1:8899",
      "serveRepair": "127.0.0.1:1036",
      "shredVersion": 46683,
      "tpu": "127.0.0.1:1027",
      "tpuForwards": "127.0.0.1:1028",
      "tpuForwardsQuic": "127.0.0.1:1034",
      "tpuQuic": "127.0.0.1:1033",
      "tpuVote": "127.0.0.1:1029",
      "tvu": "127.0.0.1:1025",
      "version": "2.2.15 (src:00000000; feat:798020478, client:Agave)"
    }
  ],
  "id": 1
}

rpc/src/rpc.rs Outdated
Comment on lines 3733 to 3737
(Some(version.to_string()), Some(version.feature_set))
(Some(format!("{:?}", version)), Some(version.feature_set))
// version will be displayed:
// solana 2.2.15 (src:7aff93a2; feat:798020478, client:Agave)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the only thing I changed, the other things is my VS Code formatting things (I should disable)

@leafaar leafaar force-pushed the v2.2-triton-public branch from 1412b3a to c0bfc59 Compare June 13, 2025 20:44
@leafaar leafaar force-pushed the v2.2-triton-public branch from c0bfc59 to 140c650 Compare July 4, 2025 23:11
@leafaar leafaar force-pushed the v2.2-triton-public branch from 140c650 to 357fdb3 Compare July 15, 2025 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants