in3 0.0.2

High-level bindings to IN3 library
Documentation

in3-rs

Rust bindings for the IN3 C library.

API Documentation

Requirements

  • Rust version >= 1.42.0
  • in3-rs uses the in3-sys crate to provide low-level bindings to the IN3 C library. See the in3-sys page for the requirements.

Features

  • blocking- Enables the blocking API which depends on async-std.

Example

use std::convert::TryInto;
use async_std::task;

use in3::eth1::*;
use in3::prelude::*;

fn main() -> In3Result<()> {
    let mut eth_api = Api::new(Client::new(chain::MAINNET));
    eth_api.client().configure(r#"{"autoUpdateList":false,"nodes":{"0x1":{"needsUpdate":false}}}}"#)?;

    let latest_blk_num: u64 = task::block_on(eth_api.block_number())?.try_into()?;
    println!("Latest block number is {:?}", latest_blk_num);
    Ok(())
}