#json-rpc #helium #async #data #block #interface #blockchain-node

helium-jsonrpc

An async library for the Helium blockchain-node JSON_RPC interface

1 stable release

1.0.1 Jun 20, 2021

#205 in #json-rpc

Custom license

22KB
635 lines

helium-jsonrpc-client

An async library for Helium's blockchain-node using JSON-RPC calls.

Overview

It is part of the ETL Lite project for tracking and storing data from the Helium blockchain.

Example

use helium_jsonrpc_rs::{ blocks };

#[tokio::main]
async fn main() {
	let height = 873465;
	let client = helium_jsonrpc_rs::Client::new_with_base_url("http://localhost:4467".to_string());
	let block = match blocks::get_block(&client, &height).await {
		Ok(b) => b, 
		Err(e) => panic!("Couldn't get block: {}", e),
	};

	println!("Found block {} with {} transactions.", height, block.transactions.len());
}

See the examples folder and unit tests for more examples.

Dependencies

~5–17MB
~213K SLoC