slockit/in3

By slockit

Updated over 4 years ago

The Slock.it Incubed Client

Image
1

897

slockit/in3 repository overview

INCUBED Client in C

Forks Stars License: AGPL v3

INCUBED (in3) is a minimal verification client for blockchain networks, this version of in3 is written in C.

Most blockchains, such as Ethereum, require a client to connect to their blockchain network. Often, these clients require a very high bandwidth or constant computation. While this is possible to perform on laptops or desktop systems, mobile devices struggle to meet these requirements. Currently the solution of choice is to use a light client on mobile devices. While this works for mobile phones, most IoT devices are unable to run light clients. Connecting an IoT device to a remote node enables even low-performance IoT devices to be connected to blockchain. However, by using distinct remote nodes the advantages of a decentralized network are undermined introducing a single point of failure. The Trustless Incentivized Remote Node Network, in short INCUBED, would make it possible to establish a decentralized and secure network of remote nodes, enabling trustworthy and fast access to blockchain for a large number of low-performance IoT and mobile devices.

A more detailed explanation of in3 can be found here.

For information on the in3-node, please go here.

For information on the in3 typescript client, please go here.

Installation and Usage

package manager / BindingsLinkUse case
Ubuntu LaunchpadubuntuInstalls libs and binaries on IoT devices or Linux-Systems

Add the slock.it ppa to your system
sudo add-apt-repository ppa:devops-slock-it/in3

install the commandline tool in3
apt-get install in3

install shared and static libs and header files
apt-get install in3-dev
Docker HubDockerHubQuick and easy way to get in3 client running as docker container
docker run -d -p 8545:8545 slockit/in3:latest --chainId=goerli -port 8545
More parameters and their descriptions can be found here.
BrewHomebrewEasy to install on MacOS

Add a brew tap
brew tap slockit/in3

install all binaries and libraries
brew install in3
Release pageGithubReleases including precompiled libraries for major platforms. To build or compile against the incubed, see readthedocs.
WASMnpma WASM-Based npm module running in browsers or nodjs.
npm install --save in3-wasm
See examples on how to use it.
JavaGithubFor integrating with java applications. Take the jar-file from the release.
javac -cp $IN3_JAR_LOCATION/in3.jar *.java
For examples and documentation see readthedocs

Example

Please have a look at the examples folder in the repo for more detailed examples.

CLI

in3 can be used on the command line in this manner:

in3 [options] method [arguments]

For example,

To get block number, run:

> in3 eth_blockNumber
8610795

A more detailed list with information on arguments can be found here.

C Code

Example C code can be found here

#include <in3/client.h>    // the core client
#include <in3/eth_basic.h> // use the basic module
#include <in3/in3_curl.h>  // transport implementation
#include <inttypes.h>
#include <stdio.h>

int main(int argc, char* argv[]) {
 // register a chain-verifier for basic Ethereum-Support, which is enough to verify blocks
 in3_register_eth_basic();

 in3_register_curl(); // use curl as the default for sending out requests

 in3_t* in3 = in3_new(); // create new incubed client

 char *result, *error;  // prepare 2 pointers for the result.

 in3_ret_t res = in3_client_rpc(   // send raw rpc-request, which is then verified
     in3,                    //  the configured client
     "eth_getBlockByNumber", // the rpc-method you want to call.
     "[\"latest\",true]",    // the arguments as json-string
     &result,                // the reference to a pointer whill hold the result
     &error);                // the pointer which may hold a error message

 if (res == IN3_OK) {
   printf("Latest block : \n%s\n", result);
   free(result);
 } else {
   printf("Error verifing the Latest block : \n%s\n", error);
   free(error);
 }
 in3_free(in3);   // cleanup client after usage

}

A more detailed example with information on how to call functions can be found here.

Features

in3Remote ClientLight Client
Failsafe connection✔️✔️
Automatic Nodelist updates✔️✔️
Partial nodelist✔️✔️
Multi-chain support✔️✔️
Full verification of JSON-RPC methods✔️
IPFS support✔️✔️
Caching support✔️
Proof-Levels✔️
POA Support✔️✔️✔️
Database setup size-minutes0-instant️0-instant~50Mb-minutes️
UsesIoT devices,Mobile,browser️Mobile,browser️️PC,Laptop️

Resources

Contributors welcome!

We at Slock.it believe in the power of the open source community. Feel free to open any issues you may come across, fork the repository and integrate in your own projects. You can reach us on various social media platforms for any questions and suggestions.

Twitter Blog Youtube LinkedIn Gitter

Got any questions?

Contact us on Gitter or send us an email at [email protected]

Tag summary

Content type

Image

Digest

Size

44.6 MB

Last updated

over 4 years ago

docker pull slockit/in3