Code Monkey home page Code Monkey logo

iota_common's Introduction

IOTA common library

This is a collection of libraries containing models, utils, and cryptography primitives used in IOTA. It's able to use in a Bazel or CMake project.

Build and test via Bazel

bazel build -- //... -//mobile/...
bazel test -- //... -//mobile/...

Use in a Bazel project

First you need to add org_iota_common to your Bazel project in the WORKSPACE file like this:

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
    name = "org_iota_common",
    commit = "6ef2af84950f56c8489623e9672c4ac882bb3961",
    remote = "https://github.com/iotaledger/iota_common.git",
)

git_repository(
    name = "rules_iota",
    commit = "49b2674474dedd77d46fddf75330ea7dcd23f0d3",
    remote = "https://github.com/iotaledger/rules_iota.git",
)

load("@rules_iota//:defs.bzl", "iota_common_external")
iota_common_external()

Then add it to dependencies in the BUILD file:

cc_binary(
    name = "my_app",
    srcs = ["my_app.c"],
    deps = [
        "@org_iota_common//common:errors",
        "@org_iota_common//common/model:transaction"],
)

Build and test via CMake

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=. -DTRINARY_TEST=ON ..
make -j8 && make test

Use in a CMake project

Adds iota_common to your CMakeLists.txt like:

# The FetchContent module needs cmake 3.11 or above.
cmake_minimum_required(VERSION 3.11)

# fetch iota_common
include(FetchContent)
FetchContent_Declare(
  iota_common
  GIT_REPOSITORY https://github.com/iotaledger/iota_common.git
  GIT_TAG master # could be branch name, tag or commit hash.
)

if(${CMAKE_VERSION} VERSION_LESS 3.14)
    macro(FetchContent_MakeAvailable NAME)
        FetchContent_GetProperties(${NAME})
        if(NOT ${NAME}_POPULATED)
            FetchContent_Populate(${NAME})
            add_subdirectory(${${NAME}_SOURCE_DIR} ${${NAME}_BINARY_DIR})
        endif()
    endmacro()
endif()

message(STATUS "Fetching iota_common")
FetchContent_MakeAvailable(iota_common)

# iota_common headers
target_include_directories(<target> <PRIVATE|PUBLIC>
  "${CMAKE_INSTALL_PREFIX}/include",
  "${iota_common_SOURCE_DIR}"
)

# link dependent libraries
target_link_libraries(<target> <PRIVATE|PUBLIC>
  logger
  keccak
)

Contributing

Please read CONTRIBUTING.md for details.

Contributors

thibault-martinez
thibault-martinez
tsvisabo
tsvisabo
th0br0
th0br0
oopsmonk
oopsmonk
ifullgaz
ifullgaz
HowJMay
HowJMay
jkrvivian
jkrvivian
rajivshah3
rajivshah3

iota_common's People

Contributors

howjmay avatar marktwtn avatar rajivshah3 avatar thibault-martinez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.