5 releases

0.1.8 Mar 8, 2021
0.1.7 Sep 3, 2020
0.1.6 Jul 23, 2020
0.0.2 May 22, 2020
0.0.1 May 22, 2020

#15 in #consuming

Custom license

8.5MB
218K SLoC

C 176K SLoC // 0.1% comments C++ 20K SLoC // 0.2% comments Shell 7.5K SLoC // 0.2% comments M4 7.5K SLoC // 0.2% comments Rust 3K SLoC // 0.0% comments Python 1.5K SLoC // 0.2% comments Automake 1.5K SLoC // 0.0% comments Objective-C++ 1.5K SLoC // 0.2% comments Objective-C 446 SLoC // 0.1% comments Bazel 133 SLoC // 0.1% comments Bitbake 54 SLoC AWK 37 SLoC // 0.1% comments GNU Style Assembly 29 SLoC // 0.5% comments Crystal 16 SLoC D 3 SLoC // 0.8% comments

in3-rs

Rust bindings for the Incubed C library.

The Incubed client is a

  • Crypto-Economic
  • Non-syncronizing and stateless, but fully verifying
  • Minimal resource consuming

blockchain client (Crypto-Economic Client, Minimal Verification Client, Ultra Light Client).

[dependencies]
in3 = "0.0.2"

Links:

Requirements

  • Rust compiler version >= 1.42.0 -> rustc --version
  • A toolchain capable of compiling IN3 C sources
    • Ubuntu: apt-get install build-essential
    • Windows: https://visualstudio.microsoft.com/visual-cpp-build-tools/
  • OpenSSL dev libs
    • Ubuntu: apt-get install libssl-dev
    • Windows: TODO
  • CMake version >= 3.5.1, because we build the bundled IN3 C library with the cmake crate
    • Ubuntu: apt-get install cmake
    • Windows: https://cmake.org/install/, Make sure you add it to path for windows
  • bindgen and therefore clang dev libraries
    • Ubuntu: apt-get install clang libclang-dev llvm-dev
    • Windows: TODO

in3-rs uses the in3-sys to provide low-level bindings to the IN3 C library.

Features

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

Example

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(())
}

Contributing

Instructions for running the tests

  1. To run the tests you need to first run the build script. ./scripts/build_rust.sh.
  2. Navigate to the rust binding folder. cd rust
  3. Then run the test using cargo and an additional option RUST_TEST_THREADS=1. This can be done via RUST_TEST_THREADS=1 cargo test.

Dependencies

~5–9MB
~199K SLoC