All Projects → iotaledger → iota.c

iotaledger / iota.c

Licence: Apache-2.0 license
IOTA client library in C

Programming Languages

c
50402 projects - #5 most used programming language
CMake
9771 projects


The official C client library for interacting with the Tangle

Developer Documentation

Discord StackExchange Apache 2.0 license Client API Reference

AboutPrerequisitesBuilding Client LibraryBuilding DocumentVisual Studio Code IntegrationSupporting the projectJoining the discussion


About

This is the official C client library, which allows you to do the following:

  • Create blocks
  • Read blocks
  • Sign transactions
  • Generate addresses
  • Implement a wallet application

You can find API reference on C Client API Reference

This is in highly development, so there may be performance and stability issues. Please report any issues in Issues or Discussions

Prerequisites

  • pkg-config
  • libcurl4-openssl-dev
  • GCC or Clang
  • CMake 3.15 and above
  • ninja-build (optional)

Ubuntu

sudo apt install build-essential libcurl4-openssl-dev pkg-config

Building IOTA C Client Library

IOTA C Client support different crypto libraries, including OpenSSL, libsodium, and mbedtsl, it can be changed by CMake property CryptoUse. Fro example, adding -DCryptoUse=libsodium to use libsodium.

Compiling and testing library with Clang11 and Ninja

git clone https://github.com/iotaledger/iota.c.git
cd iota.c
mkdir build && cd build
cmake -G Ninja -DCMAKE_C_COMPILER=clang-11 -DCMAKE_CXX_COMPILER=clang++-11 -DIOTA_WALLET_ENABLE:BOOL=TRUE -DCMAKE_INSTALL_PREFIX=$PWD ..
ninja && ninja test

Compiling and testing library with Make and GCC

git clone https://github.com/iotaledger/iota.c.git
cd iota.c
mkdir build && cd build
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DIOTA_WALLET_ENABLE:BOOL=TRUE -DCMAKE_INSTALL_PREFIX=$PWD ..
make -j8 && make test

Compiling and testing library with default compiler

git clone https://github.com/iotaledger/iota.c.git
cd iota.c
mkdir build && cd build
cmake -DIOTA_WALLET_ENABLE:BOOL=TRUE -DCMAKE_INSTALL_PREFIX=$PWD ..
make && make test

The default build type is Debug mode with debug symbols, for Release mode you can add -DCMAKE_BUILD_TYPE=Release during the CMake configuration stage.

Building Documentation

The documentation is automatically generated thought Doxygen and Sphinx tools.

This steps are tested on Ubuntu, please refer to installation guides for different platforms:

sudo apt install doxygen python3-sphinx python3-pip
git clone https://github.com/iotaledger/iota.c.git
cd iota.c/docs
pip3 install -r requirements.txt
doxygen Doxyfile && make html

The documentation will locate at docs/_build/html/index.html in the project root directory.

Visual Studio Code Integration

This template includes launch configurations for debugging test cases with Visual Studio Code located in the .vscode/ directory. See .vscode/README.md for more information. If you're not using VS Code, you can safely delete or ignore the directory.

Supporting the project

If the IOTA C client library has been useful to you and you feel like contributing, consider posting a bug report, feature request or a pull request.

We have some basic contribution guidelines to keep our code base stable and consistent.

Joining the discussion

If you want to get involved in the community, need help with getting set up, have any issues related with the library or just want to discuss blockchain, distributed ledgers, and IoT with other people, feel free to join our Discord.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].