Crates.io | in3 |
lib.rs | in3 |
version | 0.1.8 |
source | src |
created_at | 2020-05-22 10:17:46.303954 |
updated_at | 2021-03-08 14:21:03.720848 |
description | High-level bindings to IN3 library |
homepage | https://slock.it/incubed/ |
repository | https://github.com/blockchainsllc/in3/releases |
max_upload_size | |
id | 244523 |
size | 234,847 |
Rust bindings for the Incubed C library.
The Incubed client is a
blockchain client (Crypto-Economic Client, Minimal Verification Client, Ultra Light Client).
[dependencies]
in3 = "0.0.2"
Links:
rustc --version
apt-get install build-essential
https://visualstudio.microsoft.com/visual-cpp-build-tools/
apt-get install libssl-dev
cmake
crate
apt-get install cmake
https://cmake.org/install/
, Make sure you add it to path for windowsapt-get install clang libclang-dev llvm-dev
in3-rs uses the
in3-sys
to provide low-level bindings to the IN3 C library.
blocking
- Enables the blocking API which depends on async-std.Cargo.toml
[dependencies]
async-std = "1.5.0"
in3 = "0.2.0"
main.rs
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(())
}
./scripts/build_rust.sh
.cd rust
RUST_TEST_THREADS=1
. This can be done via RUST_TEST_THREADS=1 cargo test
.