This crate allows you to easily communicate with a running node using typed safe rust via the node's grpc and http modules.
```rs // example of a grpc propose and getting a block via hash use rhoastclient::grpc::propose::proposeutil; use rhoastclient::http::block::hashblockcall; use rhoastclient::grpc::deploy::getblocksbyheightutilstream; use rhoastclient::proto::casper::BlocksQueryByHeight;
let propose = proposeutil("endpoint".tostring(), true).await.unwrap(); let blockinfo = hashblockcall(&"endpoint".tostring(), &"hash".to_string()).await.unwrap()
//for grpc stream actions like visualizedagutilstream, showmainchainutilstream, showblocksutilstream, // getblocksbyheightutil_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 blockquery=BlocksQueryByHeight{ startblocknumber: 1, endblocknumber: 40 } fn writestreamtofile(input: &BlockInfoResponse){ //write input to file } getblocksbyheightutilstream("endpoint".tostring(), blockquery, writestreamtofile, Some(40)).await.unwrap();
```
Link to doc here
URL=http://server_url cargo test
if no URL env var is provided, all test would be skipped