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
| Field | Type |
|---|---|
| result | object |
Examples
curl https://triport.io/sol \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"id":1,"method":"getIdentity","params":[],"jsonrpc":"2.0"}'const res = await fetch("https://triport.io/sol", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"id": 1,
"method": "getIdentity",
"params": [],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/sol",
headers={"Authorization": "Bearer <api-key>"},
json={"id":1,"method":"getIdentity","params":[],"jsonrpc":"2.0"},
)
print(resp.json()){
"id": 1,
"result": {
"identity": "GkySxXEnG9yjPcf6VnFwqYwWQU5rB8hHZqGo5msYRLTg"
},
"jsonrpc": "2.0"
}Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet, devnet, testnet.
- 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.