Sei中文文档(Sei Docs CHN)-by Chainguys
  • 导览(INTRODUCTION)
    • 版权声明(Copyright Notice)
    • 概览 (Overview)
    • Sei 设计空间 (Sei Design Space)
    • DEX 优化 (DEX Optimizations)
    • Sei 生态系统 (Sei Ecosystem)
  • 智能合约和本地开发 (Smart contracts & local development)
    • Sei工具指南 (Sei Tool Guide)
    • 设置一个本地节点 (Set up a local network)
    • 本地 Sei 脚本部署 (Local Sei script deployment)
    • Sei.go
    • CosmWasm合约测试 (CosmWasm Contract Testing)
    • 部署通用合约 (Deploy a generic contract)
    • 部署交易合约 (Deploy an exchange contract)
    • 非完整节点下部署和开发 (Deploy & develop without Full Node)
    • Dex 模块教程 (Dex Module Tutorial)
    • 代币工厂模块教程 (Tokenfactory Module Tutorial)
    • IBC转账 (IBC Transfers)
  • 订单匹配(order match)
    • 并行性 (Parallelism)
    • 资格 (Eligibility)
    • DEX 合约间依赖 (DEX Inter—Contract Dependencies)
    • 白名单商店 (Whitelisted Store)
  • 节点&验证者 (NODES&VALIDATORS)
    • 加入测试网 (Joining Testnets)
    • 更新 (Upgrades)
    • Seinami激励测试网 (Seinami Incentivized Testnet)
      • 加入激励测试网 (Joining Incentivized Testnet)
      • 所有测试任务 (All Testnet Missions)
      • 行为准则 (Code of Conduct)
      • 奖励发放详情 (Rewards Distribution Details)
  • 基础API端点 (Basic API Endpoints)
  • 模块化端点 (Module Endpoints)
  • 状态同步 (Statesync)
  • 恢复操作(Recovery Operations)
  • 治理(GOVERNANCE)
    • 创建提案 (Creating Proposals)
    • 管理质押 (Managing Staking)
    • 对提案投票表决 (Voting on Proposals)
  • 预言机(ORACLE)
    • 预言机参与 (Oracle Participation)
  • 钱包(WALLETS)
    • 钱包集成(Wallet Integration)
    • 转账 (Transfers)
  • 更多(More)
    • 推特(Twitter)
由 GitBook 提供支持
在本页
  • 获取节点信息 (Get Node status)
  • CLI
  • REST
  • 获得节点id (Get Node Id)
  • 命令行 CLI
  • REST
  • 获取同步状态 (Get Sync Status)
  • 命令行 CLI
  • REST
  • 获得最新区块 (Get Latest Block)
  • 命令行 CLI
  • REST
  • 查询银行余额 (Query Bank Balances)
  • 命令行 CLI
  • REST
  • 获取验证者 (Get Validators)
  • 命令行 CLI
  • REST

基础API端点 (Basic API Endpoints)

Here are some basic API Endpoints that might be helpful when configuring your node or validator.

以下是一些在配置节点或验证者时可能会有帮助的基本 API 端点。

For the examples below, it is assumed that the commands are run alongside the node / validator process. However, it is possible to send these requests to a remote node:

对于下面的示例,假设命令与节点/验证者进程一起运行。但是,可以将这些请求发送到远程节点:

  • For CLI calls, you may specify a remote node with the --node flag 对于 CLI 调用,您可以使用 --node 标志指定远程节点

  • For REST calls, you can replace localhost with the IP address of the remote node 对于 REST 调用,您可以将 localhost 替换为远程节点的 IP 地址

获取节点信息 (Get Node status)

CLI

> seid status | jq -r ".NodeInfo"
{
  "protocol_version": {
    "p2p": "8",
    "block": "11",
    "app": "0"
  },
  "id": "c3beb6d42f10311fd453029cb3ee6ac08880d522",
  "listen_addr": "tcp://0.0.0.0:26656",
  "network": "sei-testnet-1",
  "version": "0.34.15",
  "channels": "40202122233038606100",
  "moniker": "phils validator",
  "other": {
    "tx_index": "on",
    "rpc_address": "tcp://127.0.0.1:26657"
  }

REST

> curl localhost:1317/cosmos/base/tendermint/v1beta1/node_info  | jq -r ".default_node_info"
{
  "protocol_version": {
    "p2p": "8",
    "block": "11",
    "app": "0"
  },
  "default_node_id": "c3beb6d42f10311fd453029cb3ee6ac08880d522",
  "listen_addr": "tcp://0.0.0.0:26656",
  "network": "sei-testnet-1",
  "version": "0.34.15",
  "channels": "QCAhIiMwOGBhAA==",
  "moniker": "phils validator",
  "other": {
    "tx_index": "on",
    "rpc_address": "tcp://127.0.0.1:26657"
  }
}

获得节点id (Get Node Id)

命令行 CLI

> seid tendermint show-node-id
89e8fdd427a056fb7b4f5da2d58a4b688feb4b74

REST

> curl localhost:1317/cosmos/base/tendermint/v1beta1/node_info | jq -r ".default_node_info.default_node_id
89e8fdd427a056fb7b4f5da2d58a4b688feb4b74

获取同步状态 (Get Sync Status)

命令行 CLI

> seid status | jq -r ".SyncInfo.catching_up"
false

REST

> curl localhost:1317/cosmos/base/tendermint/v1beta1/syncing
{
  "syncing": false
}

获得最新区块 (Get Latest Block)

命令行 CLI

> seid query block | jq
{
  "block_id": {
    "hash": "92B93642DCCECFBDFEAE972C67294CF1B3574FAF55F3B24E218990CC4EE28B0A",
    "parts": {
      "total": 1,
      "hash": "5FBD2E43F3A3F6DBD9C9E2021B1505DF3AC74841F7207F479E701FF0726E0EF3"
    }
  },
  "block": {
    "header": {
      "version": {
        "block": "11"
      },
...

REST

> curl localhost:1317/cosmos/base/tendermint/v1beta1/blocks/latest
{
  "block_id": {
    "hash": "krk2QtzOz73+rpcsZylM8bNXT69V87JOIYmQzE7iiwo=",
    "part_set_header": {
      "total": 1,
      "hash": "X70uQ/Oj9tvZyeICGxUF3zrHSEH3IH9HnnAf8HJuDvM="
    }
  },
  "block": {
    "header": {
      "version": {
        "block": "11",
...

查询银行余额 (Query Bank Balances)

命令行 CLI

> seid query bank balances $ACCOUNT_ADDRESS
balances:
- amount: "29999999999995999900"
  denom: ust
pagination:
  next_key: null
  total: "0"

REST

> curl localhost:1317/bank/balances/$ACCOUNT_ADDRESS
{"height":"4028","result":[
  {
    "denom": "ust",
    "amount": "29999999999995999900"
  }
]}

获取验证者 (Get Validators)

命令行 CLI

> seid query tendermint-validator-set
block_height: "3472"
total: "2"
validators:
- address: cosmosvalcons1xrn3ejn56chrv26mfk9vaztef63zptkmygmdxf
  proposer_priority: "39374999999767"
  pub_key:
    type: tendermint/PubKeyEd25519
    value: Cf46GgHIjqEdk5ZeHux/PTWEmWUWnxTFeyJxIzwoxSA=
  voting_power: "70000000000000"

REST

> curl localhost:1317/cosmos/base/tendermint/v1beta1/validatorsets/latest
{
  "block_height": "4156",
  "validators": [
    {
      "address": "cosmosvalcons1xrn3ejn56chrv26mfk9vaztef63zptkmygmdxf",
      "pub_key": {
        "@type": "/cosmos.crypto.ed25519.PubKey",
        "key": "Cf46GgHIjqEdk5ZeHux/PTWEmWUWnxTFeyJxIzwoxSA="
      },
      "voting_power": "70000000000000",
      "proposer_priority": "42656249998811"
    },
上一页奖励发放详情 (Rewards Distribution Details)下一页模块化端点 (Module Endpoints)

最后更新于2年前