hmy_getValidators

Description

hmy_getValidators returns list of validators for a particular epoch in corresponding shard

API v1

Parameters

  1. 1.
    uint64 - epoch number

Returns

  • shardID - Uint32 - shard id
  • validators - Array : list of validators in below format
    • address - String : one address
    • balance - String : validator current balance (will be replaced with stake soon) 0x format

Sample Curl Request

1
curl -d '{
2
"jsonrpc":"2.0",
3
"method":"hmy_getValidators",
4
"params":[0],
5
"id":1
6
​
7
}' -H "Content-Type: application/json" -X POST "http://localhost:9500"
Copied!

Sample Curl Response

1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": {
5
"shardID": 0,
6
"validators": [
7
{
8
"address": "one1pdv9lrdwl0rg5vglh4xtyrv3wjk3wsqket7zxy",
9
"balance": "0x3763284988b12fdb3"
10
},
11
{
12
"address": "one12fuf7x9rgtdgqg7vgq0962c556m3p7afsxgvll",
13
"balance": "0x376322519535f6db3"
14
},
15
{
16
"address": "one1pf75h0t4am90z8uv3y0dgunfqp4lj8wr3t5rsp",
17
"balance": "0x376322519535f6dbc"
18
},
19
{
20
"address": "one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj",
21
"balance": "0x36f416a4047f9ddb3"
22
},
23
{
24
"address": "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc",
25
"balance": "0x45a3027c55a812498"
26
},
27
{
28
"address": "one1a50tun737ulcvwy0yvve0pvu5skq0kjargvhwe",
29
"balance": "0x30f1a8ebe2ec1b6d8"
30
},
31
{
32
"address": "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7",
33
"balance": "0x376322519535f6dbb"
34
}
35
]
36
}
37
}
Copied!

API v2

Parameters

  1. 1.
    uint64 - epoch number

Returns

  • shardID - Uint32 - shard id
  • validators - Array : list of validators in below format
    • address - String : one address
    • balance - Number : validator current balance (will be replaced with stake soon)

Sample Curl Request

1
curl -d '{
2
"jsonrpc":"2.0",
3
"method":"hmyv2_getValidators",
4
"params":[0],
5
"id":1
6
​
7
}' -H "Content-Type: application/json" -X POST "http://localhost:9500"
Copied!

Sample Curl Response

1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": {
5
"shardID": 0,
6
"validators": [
7
{
8
"address": "one1pdv9lrdwl0rg5vglh4xtyrv3wjk3wsqket7zxy",
9
"balance": 100000000000000000
10
},
11
{
12
"address": "one12fuf7x9rgtdgqg7vgq0962c556m3p7afsxgvll",
13
"balance": 100000000000000000
14
},
15
{
16
"address": "one1pf75h0t4am90z8uv3y0dgunfqp4lj8wr3t5rsp",
17
"balance": 100000000000000000
18
},
19
{
20
"address": "one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj",
21
"balance": 100000000000000000
22
},
23
{
24
"address": "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc",
25
"balance": 100000000000000000
26
},
27
{
28
"address": "one1a50tun737ulcvwy0yvve0pvu5skq0kjargvhwe",
29
"balance": 100000000000000000
30
},
31
{
32
"address": "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7",
33
"balance": 100000000000000000
34
}
35
]
36
}
37
}
Copied!