Skip to content

Latest commit

 

History

History
49 lines (40 loc) · 1015 Bytes

hmy_getshardingstructure.md

File metadata and controls

49 lines (40 loc) · 1015 Bytes
description
GetShardingStructure

hmy_getShardingStructure

Returns the current shard of the node and lists API and WebSocket endpoints for each shard.

Returns

  • current - bool - If the current node is on this shard.
  • http - String - API endpoint for the shard.
  • shardID - Integer - Shard ID.
  • ws - String - WebSocket endpoint

Sample Curl Request

curl -d '{
    "jsonrpc": "2.0",
    "method": "hmy_getShardingStructure",
    "params": [],
    "id": 1
}' -H "Content-Type:application/json" -X POST "http://api.s0.b.hmny.io"

Sample Curl Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": [
        {
            "current": true,
            "http": "https://api.s0.b.hmny.io",
            "shardID": 0,
            "ws": "wss://ws.s0.b.hmny.io"
        },
        {
            "current": false,
            "http": "https://api.s1.b.hmny.io",
            "shardID": 1,
            "ws": "wss://ws.s1.b.hmny.io"
        }
    ]
}