Infura开发手册

在线工具推荐: Three.js AI纹理开发包 - YOLO合成数据生成器 - GLTF/GLB在线编辑 - 3D模型格式在线转换 - 可编程3D场景编辑器

eth_syncing

返回表示节点同步状态的对象,未同步时返回false。

API请求

POST https://<network>.infura.io/v3/YOUR-PROJECT-ID

请求头:

Content-Type: application/json

请求示例:

JSON-RPC over HTTPS POST:

curl https://mainnet.infura.io/v3/YOUR-PROJECT-ID \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_syncing","params": [],"id":1}'

JSON-RPC over websockets:

wscat -c wss://mainnet.infura.io/ws/v3/YOUR-PROJECT-ID
>{"jsonrpc":"2.0","method":"eth_syncing","params": [],"id":1}

API响应

返回false时,表示节点未同步。或者返回如下对象:

  • startingBlock:同步开始区块
  • currentBlock:当前已同步区块
  • highestBlock:最高区块

响应结果示例:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": false
}