TriportRPC

getIdentity

Last updated:

`getIdentity` returns the identity public key for the node that handled the request. It takes no parameters and is one of the cheapest read methods on the Solana surface, which makes it useful as a connectivity / auth smoke-test: a successful response confirms your key is valid and the endpoint is reachable.

Because requests are load-balanced across a pool of upstream nodes, the `identity` value you receive may differ from one call to the next. Treat it as the identity of *whichever* node served this particular request, not as a stable identifier for your connection.

Parameters

This method takes no parameters.

Returns

getIdentity return value
FieldType
resultobject

Examples

curl https://<your-endpoint>/ \
  -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getIdentity","params":[]}'
const res = await fetch("https://<your-endpoint>/", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "id": 1,
  "method": "getIdentity",
  "params": [],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"getIdentity","params":[],"jsonrpc":"2.0"})
print(resp.json())
{
  "id": 1,
  "result": {
    "identity": "GkySxXEnG9yjPcf6VnFwqYwWQU5rB8hHZqGo5msYRLTg"
  },
  "jsonrpc": "2.0"
}

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Networks: mainnet, devnet, testnet.
  3. Credit cost: 1 per call.

FAQ

What does getIdentity do?
Returns the identity public key of the node currently serving your request.
How many credits does getIdentity cost?
getIdentity costs 1 credit(s) per call on Triport by default.
Is getIdentity available over WebSocket?
getIdentity is an HTTP JSON-RPC method.