跳到正文

database_api.list_witnesses ​

Purpose ​

返回见证人(witness)列表。参数:start:object、limit:int、order:string

  • start 取决于 order(见下文)
  • limit 最大 1000。
  • order 可取以下值:
    • by_name - 按名称排序
      • start 为字符串值:account
    • by_vote_name - 按投票、名称排序
      • start 为两个值组成的数组:votes、account
    • by_schedule_time - 按排期时间排序
      • start 为两个值组成的数组:virtual_scheduled_time、account

| start (object) | limit (int) | order (string) | | |----------------------------|---------------|-| | "" | 10 | "by_name" | 查询前 10 个见证人,按账户名排序 | | [0, ""] | 10 | "by_vote_name" | 查询前 10 个见证人,按投票数排序 | | ["473718186844702107410533306", "alice"] | 10 | "by_schedule_time" | 查询前 10 个见证人,按排期排序 |

另见:Paginated API Methods

Parameters ​

PARAMETERS
json
{
  "start": null,
  "limit": 0,
  "order": "by_name"
}

Example ​

Example 1 ​

BASH
bash
curl -s https://api.steemit.com \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "jsonrpc": "2.0",
    "method": "database_api.list_witnesses",
    "params": {
      "start": "",
      "limit": 10,
      "order": "by_name"
    },
    "id": 1
  }'

Example 2 ​

BASH
bash
curl -s https://api.steemit.com \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "jsonrpc": "2.0",
    "method": "database_api.list_witnesses",
    "params": {
      "start": [
        0,
        ""
      ],
      "limit": 10,
      "order": "by_vote_name"
    },
    "id": 1
  }'

Example 3 ​

BASH
bash
curl -s https://api.steemit.com \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "jsonrpc": "2.0",
    "method": "database_api.list_witnesses",
    "params": {
      "start": [
        "473718186844702107410533306",
        "alice"
      ],
      "limit": 10,
      "order": "by_schedule_time"
    },
    "id": 1
  }'

Response ​

RESPONSE
json
{
  "witnesses": [
    {
      "id": 6950,
      "owner": "a-0",
      "created": "1970-01-01T00:00:00",
      "url": "",
      "votes": 0,
      "virtual_last_update": "0",
      "virtual_position": "0",
      "virtual_scheduled_time": "340282366920938463463374607431768211455",
      "total_missed": 0,
      "last_aslot": 1063323,
      "last_confirmed_block_num": 1040423,
      "pow_worker": 0,
      "signing_key": "STM5RrTRNDhhrMaA24SzSeE5AvmUcutb1q1VZp1imnT8p871s3UjN",
      "props": {
        "account_creation_fee": {
          "amount": "1",
          "precision": 3,
          "nai": "@@000000021"
        },
        "maximum_block_size": 131072,
        "sbd_interest_rate": 1000,
        "account_subsidy_budget": 797,
        "account_subsidy_decay": 347321
      },
      "sbd_exchange_rate": {
        "base": {
          "amount": "0",
          "precision": 3,
          "nai": "@@000000021"
        },
        "quote": {
          "amount": "0",
          "precision": 3,
          "nai": "@@000000021"
        }
      },
      "last_sbd_exchange_update": "1970-01-01T00:00:00",
      "last_work": "000000127cb0e335667f30100bc1a061175c2d789f808e0e9ac82ee70fa8e604",
      "running_version": "0.0.0",
      "hardfork_version_vote": "0.0.0",
      "hardfork_time_vote": "2016-03-24T16:00:00",
      "available_witness_account_subsidies": 0
    }
  ]
}