> ## 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.

# getIdentity

> 返回当前节点的身份 Pubkey

## 参数

此方法不需要任何参数。

## 响应

<ResponseField name="result" type="object">
  <Expandable title="result fields">
    <ResponseField name="identity" type="string">
      当前节点的身份 Pubkey（base-58 编码）
    </ResponseField>
  </Expandable>
</ResponseField>

## 代码示例

### 基本请求

```bash theme={null}
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

```typescript theme={null}
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

```python theme={null}
from solana.rpc.api import Client

client = Client("http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY")
response = client.get_identity()
print(response)
```

## 注意事项

1. 返回您所连接的验证者节点的身份公钥
2. 用于识别您正在与哪个节点通信
3. 响应是即时的，因为它从节点的配置中读取
4. 可用于验证是否连接到预期的节点

## 最佳实践

1. 在排查节点连接问题时使用此方法
2. 将返回的身份与预期的节点身份进行比较以进行验证
3. 适当处理网络错误并重试
