A simple IoTeX Blockchain client implementation in C++ for embedded systems. Supporting Arduino IDE and PlatformIO.
Compatible with some popular Arduino boards and Raspberry Pi/Unix environments.
The SDK has been successfully tested on ESP32 and SAMD21 -based boards. ESP8266 will also work well for anything except smart contract calls: in this case we have experienced random crashes.
You can find the installation instructions in the wiki.
For more detailed documentation refer to the official documentation or the API reference.
The examples
directory contains examples that demonstrate most of the library functions.
They can be used with both Arduino IDE and PlatformIO.
The Dockerfile provided sets up a Ubuntu based dev container with all required dependencies to build and test the library.
Follow the below steps in order to use VSCode to develop and contribute to the library:
Install the Dev Containers VSCode extension.
Open the directory containing this repository in VSCode.
Press F1
and enter Dev Containers: Rebuild and Reopen in Container
.
Wait until the container is started. It should take a couple of minutes.
Once the container is started and open in VSCode you should be able to run the provided tasks in tasks.json
.
You can get a list of tasks and run them by pressingF1
and entering Run task
. The main tasks are described below:
The following tasks can be used to build the tests. The build output will be placed in the build
directory. The tests executable will be located at build/tests/iotex_unit_tests
.
tools/server/envoy-conf-testnet.yaml
. tools/server/envoy-conf-mainnet.yaml
. tools/server-fake/config.json
. The fake server is used by the tests that. VSCode launch configurations are also set up for launching the unit tests in debug mode.
Use the VSCode Run and Debug panel to launch them.
Edit the --gtest_filter
argument in launch.json
if you want to pass a filter to the launch command. Eg: "--gtest_filter=\"ContractTests.*\""
will only run tests from the ContracTests
test suite.
The tools
directory contains a set of tools that can be used to help with the development of the library. Some of them are described below:
Located in tools/server
.
A HTTP-JSONRPC server using Envoy proxy. Two configurations files are provided to connect to either mainnet or testnet. It implements the following endpoints:
Located in tools/server-fake
.
A fake HTTP-JSONRPC server that provides canned responses. The responses are set up in tools/server-fake/config.json
.
The clang-format configuration file is located in tools/.clang-format
.
Run ./tools/clang_format.sh
from the root directory to apply clang-format.
A JS helper script that can be used used to test/verify abi encoding. It uses the abi-decoder
JS library.
Builds the library and unit tests for the native (Linux) environemnt.
Builds all the examples for each of the supported boards using arduino-cli
.
Builds all the examples for each of the supported boards using platformio
.
Run doxygen Doxyfile
to regenerate the doxygen documentation. The output will be placed in the docs
directory.
This library uses Conventional Commits and Conventional Changelog to automete the release and changelog generation.
In order to generate a new release:
standard-version "--dry-run"
to preview the changelog and update the version in library.json
for PlatformIO library.properties
for Arduino.npm run release
. git push --follow-tags
. pio package publish
. Credentials are needed that belong to the author of the library. The Arduino library manager checks the repository for new updates periodically. The logs can bee seen at https://downloads.arduino.cc/libraries/logs/github.com/iotexproject/arduino-sdk/.