Skip to content
Cmake based version of Entangled MAM
C C++ Python Objective-C CMake Smarty Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cclient Changed CBT to MiniSizeRel Oct 6, 2019
ciri First Cmake-MAM commit Sep 26, 2019
cmake First Cmake-MAM commit Sep 26, 2019
common First Cmake-MAM commit Sep 26, 2019
cppclient First Cmake-MAM commit Sep 26, 2019
docs First Cmake-MAM commit Sep 26, 2019
mam Changed CBT to MiniSizeRel Oct 6, 2019
mobile First Cmake-MAM commit Sep 26, 2019
tanglescope First Cmake-MAM commit Sep 26, 2019
tools First Cmake-MAM commit Sep 26, 2019
utils First Cmake-MAM commit Sep 26, 2019
.bazelignore First Cmake-MAM commit Sep 26, 2019
.bazelrc First Cmake-MAM commit Sep 26, 2019
.clang-format First Cmake-MAM commit Sep 26, 2019
BUILD
CMakeLists.txt Changed CBT to MiniSizeRel Oct 6, 2019
CODEOWNERS First Cmake-MAM commit Sep 26, 2019
CONTRIBUTING.md First Cmake-MAM commit Sep 26, 2019
Dockerfile First Cmake-MAM commit Sep 26, 2019
Doxyfile First Cmake-MAM commit Sep 26, 2019
LICENSE First Cmake-MAM commit Sep 26, 2019
README.md Update README.md Oct 2, 2019
SECURITY.md First Cmake-MAM commit Sep 26, 2019
WORKSPACE First Cmake-MAM commit Sep 26, 2019
make -d.txt First Cmake-MAM commit Sep 26, 2019

README.md

IOT2TANGLE Cmake based Entangled MAM Library

The following repo allows to build Entangled MAM examples to send and receive messages via the new MAM Protocol using Cmake instead of Bazel. The main reason to transition from Bazel to Cmake is portability: Bazel does not perform very well on IoT devices (it does not even provide an installer for Raspberry Pi3B).

Why do we need this?

Since IOT2TANGLE requires us to build code to send data over MAM2 on different IoT devices, a build system that can run on SoCs such as ESP32, STM32, etc. was needed to compile the required code. Cmake allows us to do so while keeping a clear relation with Entangled modifications.

This repositorie reflects official Entangled 100% adding only the headers generated by Bazel and the CMakeLists.txt files to indicate dependencies and targets. Future modifications on Entangled should be easily absorved by adding new headers if needed and entries to the CMakesLists.txt files.

Installation and usage

The following instructions cover Unix based systems (Linux/MacOS). Be sure to have GNU Compiler Collection (GCC) and Cmake installed before running the following commands.

git clone https://github.com/iot2tangle/cmake-mam.git
cd cmake-mam
cmake .
make

Once the build is done, you can seek for the send-msg and recv executables inside mam folder. To send a message (be sure to use nodes without SSL and do not include the http://):

./send-msg node05.iotatoken.nl 16265 YOURSEED9YOURSEED9YOURSEED9YOURSEED9YOURSEED9YOURSEED9YOURSEED9YOURSEED9YOURSEED "Testing MAM2 sending script built with Cmake" "no"

If everything went well you should get an Address, Message ID and Bundle.

Address: VSBDFUUIOYGYSYFAOCCUBFSJGZDIDLNMBCDHENGGYPKMCDZYGLZTBPVSTPQENVSRJXFMWWRZRLYRFUTZX 
Message ID: IONONZOXVGTNGVEOCXPUI
Bundle: SLMYHEVDFVLIRCWGJLGTJ9SZZEGNOFKUIHGOLGKVPBRBWXGVTCKPSGXK9RBXICCSSVPSJDYRPHLKSGEEYSLMYHEVDFVLIRCWGJLGTJ9SZZEGNOFKUIHGOLGKVPBRBWXGVTCKPSGXK9RBXICCSSVPSJDYRPHLKSGEEY

To fetch a given message we use the recv program and pass node, port and Bundle as arguments

./recv node05.iotatoken.nl 16265 SLMYHEVDFVLIRCWGJLGTJ9SZZEGNOFKUIHGOLGKVPBRBWXGVTCKPSGXK9RBXICCSSVPSJDYRPHLKSGEEYSLMYHEVDFVLIRCWGJLGTJ9SZZEGNOFKUIHGOLGKVPBRBWXGVTCKPSGXK9RBXICCSSVPSJDYRPHLKSGEEY

Final comments

This is a work in progress and requires a lot of optimization to clean up unneeded dependencies being included by Bazel that have an impact on the binaries size. As we publish this code the send-msg script is 1.2MB (around 1MB when built optimized). Because some IoT devices have 1MB of Flash memory the size of this binaries needs to be reduced.


IOTA Entangled Monorepo

Build status

This is a monorepo containing all you need to get [IOTA] operating in C/C++

Containing IOTA components, models as well as cryptography primitives used in IOTA.

Content:

Component Description
[Tanglescope] A monitoring tool for the Tangle
[MAM] A low level implementation for MAM
[CIRI] (WIP) A low level implementation of IOTA node largely inspired by [IRI]
[CClient] A low level IOTA client implementation

Building

bazel test //...

Developing Entangled

  • Be sure to run ./tools/hooks/autohook.sh install after initial checkout!
  • Pass -c dbg for building with debug symbols.

Tools required for running git commit hook

  • buildifier
  • clang-format

Buildifier

Buildifier can be installed with bazel or go

Install with go

  1. change directory to $GOPATH
  2. run $ go get github.com/bazelbuild/buildtools/buildifier The executable file will be located under $GOPATH/bin
  3. make a soft link for global usage, run $ sudo ln -s $HOME/go/bin/buildifier /usr/bin/buildifier

Install with bazel

  1. clone bazelbuild/buildtools repository $ git clone https://github.com/bazelbuild/buildtools.git
  2. change directory to buildtools
  3. build it with bazel command, $ bazel build //buildifier The executable file will be located under path/to/buildtools/bazel-bin
  4. make a soft link

clang-format

clang-format can be installed by command:

  • Debian/Ubuntu based: $ sudo apt-get install clang-format
  • OSX: $ brew install clang-format

Contributors

thibault-martinez
thibault-martinez
tsvisabo
tsvisabo
th0br0
th0br0
oopsmonk
oopsmonk
ifullgaz
ifullgaz
HowJMay
HowJMay
jkrvivian
jkrvivian
rajivshah3
rajivshah3
You can’t perform that action at this time.