Communicates with the Grin server

SUBCOMMANDS:
    ban                   Ban peer
    help                  Prints this message or the help of the given subcommand(s)
    listconnectedpeers    Print a list of currently connected peers
    status                Current status of the Grin chain
    unban                 Unban peer

HTTP 相关库

hyper

High level JSON/HTTP client API

简单封装,实现发送 GET、POST 请求。

hyper is a fast, safe HTTP implementation written in and for Rust.

hyper offers both an HTTP client and server which can be used to drive complex web applications written entirely in Rust.

RESTful API

节点API,默认使用 3413 端口。

信息包括

blocks chain status txhashset pool peers
区块 系统状态 交易集合 交易池 节点
/// Start all server HTTP handlers. Register all of them with Iron

/// and runs the corresponding HTTP server.

///

/// Hyper currently has a bug that prevents clean shutdown. In order

/// to avoid having references kept forever by handlers, we only pass

/// weak references. Note that this likely means a crash if the handlers are

/// used after a server shutdown (which should normally never happen,

/// except during tests).

主要涉及功能模块

主要和以下几个模块进行交互:

  • chain::Chain 链(链和区块)

  • p2p::Peers 网络节点

  • pool::TransactionPool 交易池

  • pool::BlockChain 与交易池交互(间接与区块链交互)

请求涉及:链、区块、交易,交易池、节点,整体服务状态。

results matching ""

    No results matching ""