Rust implementation of the Nimiq RPC client specs.
A Nimiq RPC client library in Rust. This client library implements the Nimiq RPC specification. The client uses the jsonrpc library to handle JSON-RPC 2.0 requests and responses. For more information about this library see the jsonrpc documentation
``` rust use nimiq_rpc::Client;
fn main() { let client = Client::new("http://seed-host.com:8648/".tostring()); // If your node uses credentials let client = Client::newwithcredentials("http://seed-host.com:8648/".tostring(), "user".tostring(), "password".tostring());
println!("{:?}", client.accounts().unwrap());
println!("{:?}", client.block_number().unwrap());
println!("{:?}", client.hashrate().unwrap());
println!("{:?}", client.log("*", "log").unwrap());
} ```
Docs.rs link to the official crate documentation.
Add the crate to your Cargo.toml
file.
This implementation was originally contributed by Eligioo.
Please send your contributions as pull requests. Refer to the issue tracker for ideas.