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.
| package manager / Bindings | Link | Use case |
|---|---|---|
| Ubuntu Launchpad | Installs 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/in3install the commandline tool in3 apt-get install in3install shared and static libs and header files apt-get install in3-dev | |
| Docker Hub | Quick and easy way to get in3 client running as docker containerdocker run -d -p 8545:8545 slockit/in3:latest --chainId=goerli -port 8545More parameters and their descriptions can be found here. | |
| Brew | Easy to install on MacOS Add a brew tap brew tap slockit/in3install all binaries and libraries brew install in3 | |
| Release page | Releases including precompiled libraries for major platforms. To build or compile against the incubed, see readthedocs. | |
| WASM | a WASM-Based npm module running in browsers or nodjs.npm install --save in3-wasmSee examples on how to use it. | |
| Java | For integrating with java applications. Take the jar-file from the release. javac -cp $IN3_JAR_LOCATION/in3.jar *.javaFor examples and documentation see readthedocs |
Please have a look at the examples folder in the repo for more detailed examples.
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.
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.
| in3 | Remote Client | Light 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-minutes | 0-instant️ | 0-instant | ~50Mb-minutes️ |
| Uses | IoT devices,Mobile,browser️ | Mobile,browser️️ | PC,Laptop️ |
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.
Contact us on or
send us an email at [email protected]
Content type
Image
Digest
Size
44.6 MB
Last updated
over 4 years ago
docker pull slockit/in3