The Rhoast Client
This crate allows you to easily communicate with a running node using typed safe rust via the node's grpc and http modules.
// example of a grpc propose and getting a block via hash
use propose_util;
use hash_block_call;
use get_blocks_by_height_util_stream;
use BlocksQueryByHeight;
let propose = propose_util.await.unwrap;
let block_info = hash_block_call.await.unwrap
//for grpc stream actions like visualize_dag_util_stream, show_main_chain_util_stream, show_blocks_util_stream,
// get_blocks_by_height_util_stream pass in a function that takes in the returned value of the stream
// as well as how many stream events should be listned to, passing in None as the number of optional stream event
// would make the grpc listen forever
let block_query=BlocksQueryByHeight
get_blocks_by_height_util_stream.await.unwrap;
Link to doc here
Test
- To run test exec
URL=http://server_url cargo testif no URL env var is provided, all test would be skipped