在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:blockchainsllc/in3开源软件地址:https://github.com/blockchainsllc/in3开源编程语言:C 60.4%开源软件介绍:Incubed Client in CThe Incubed client is a
blockchain client (Crypto-Economic Client, Minimal Verification Client, Ultra Light Client). This version is written in C. Most blockchains, such as Ethereum, require a client to connect to their blockchain network. Often, these clients require a lot of storage, a very high bandwidth or constant computation. While this is possible to perform on laptops or desktop systems, mobile devices, mobile app, and even web applications struggle to meet these requirements. Currently the solution of choice is to use a light client or remote client on mobile devices. While this may work 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. Also, it is unsecure because the client is not able to verify the results by itself. The same applies for mobile apps or web pages. The Trustless Incentivized Remote Node Network, in short Incubed, makes it possible to establish a decentralized and secure network of remote nodes and clients which are able to verify and validate the results, enabling trustworthy and fast access to blockchain for a large number of low-performance IoT, mobile devices, and web applications. 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
ExamplePlease have a look at the examples folder in the repo for more detailed examples. CLIin3 can be used on the command line in this manner:
For example, To get block number, run:
A more detailed list with information on arguments can be found here. C CodeExample 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_for_chain(CHAIN_ID_MAINNET); // 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
Resources
Contributors welcome!We at Blockchains 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. Got any questions?Contact us on or send us an email at [email protected] LICENSECOMMERCIAL LICENSELicensees holding a valid commercial license may use this software in accordance with the commercial license agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and slock.it GmbH/Blockchains LLC. For licensing terms and conditions or further information please contact slock.it at [email protected]. Alternatively, this software may be used under the AGPL license as follows: AGPL LICENSEThis program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. [Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights.] You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论