Documentation Index
Fetch the complete documentation index at: https://docs.orbitflare.com/llms.txt
Use this file to discover all available pages before exploring further.
此方法不需要任何参数。
当前节点的身份 Pubkey(base-58 编码)
代码示例
基本请求
curl http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getIdentity"
}'
使用 web3.js
import { Connection } from '@solana/web3.js';
const connection = new Connection('http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY');
const identity = await connection.getIdentity();
console.log(identity);
使用 Python
from solana.rpc.api import Client
client = Client("http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY")
response = client.get_identity()
print(response)
注意事项
- 返回您所连接的验证者节点的身份公钥
- 用于识别您正在与哪个节点通信
- 响应是即时的,因为它从节点的配置中读取
- 可用于验证是否连接到预期的节点
最佳实践
- 在排查节点连接问题时使用此方法
- 将返回的身份与预期的节点身份进行比较以进行验证
- 适当处理网络错误并重试