#json-rpc #helium #async #block #data #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

#199 in #json-rpc

21 downloads per month

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–18MB
~244K SLoC