Struct tendermint_rpc::HttpClient[][src]

pub struct HttpClient { /* fields omitted */ }
Expand description

A JSON-RPC/HTTP Tendermint RPC client (implements crate::Client).

Supports both HTTP and HTTPS connections to Tendermint RPC endpoints, and allows for the use of HTTP proxies (see HttpClient::new_with_proxy for details).

Does not provide crate::event::Event subscription facilities (see crate::WebSocketClient for a client that does).

Examples

use tendermint_rpc::{HttpClient, Client};

#[tokio::main]
async fn main() {
    let client = HttpClient::new("http://127.0.0.1:26657")
        .unwrap();

    let abci_info = client.abci_info()
        .await
        .unwrap();

    println!("Got ABCI info: {:?}", abci_info);
}

Implementations

Construct a new Tendermint RPC HTTP/S client connecting to the given URL.

Construct a new Tendermint RPC HTTP/S client connecting to the given URL, but via the specified proxy’s URL.

If the RPC endpoint is secured (HTTPS), the proxy will automatically attempt to connect using the HTTP CONNECT method.

Trait Implementations

Perform a request against the RPC endpoint

/abci_info: get information about the ABCI application.

/abci_query: query the ABCI application

/block: get block at a given height.

/block: get the latest block.

/block_results: get ABCI results for a block at a particular height.

/block_results: get ABCI results for the latest block.

/block_search: search for blocks by BeginBlock and EndBlock events.

/blockchain: get block headers for min <= height <= max. Read more

/broadcast_tx_async: broadcast a transaction, returning immediately.

/broadcast_tx_sync: broadcast a transaction, returning the response from CheckTx. Read more

/broadcast_tx_commit: broadcast a transaction, returning the response from DeliverTx. Read more

/commit: get block commit at a given height.

/consensus_params: get current consensus parameters at the specified height. Read more

/consensus_state: get current consensus state

/validators: get validators a given height.

/consensus_params: get the latest consensus parameters.

/commit: get the latest block commit

/health: get node health. Read more

/genesis: get genesis file.

/net_info: obtain information about P2P and other network connections.

/status: get Tendermint status including node info, pubkey, latest block hash, app hash, block height and time. Read more

/broadcast_evidence: broadcast an evidence.

/tx: find transaction by hash.

/tx_search: search for transactions with their results.

Poll the /health endpoint until it returns a successful result or the given timeout has elapsed. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more