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
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
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
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.
|[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|
- Please use Bazel:
bazel test //...
- Be sure to run
./tools/hooks/autohook.sh installafter initial checkout!
-c dbgfor building with debug symbols.
Tools required for running git commit hook
Buildifier can be installed with
Install with go
- change directory to
$ go get github.com/bazelbuild/buildtools/buildifierThe executable file will be located under
- make a soft link for global usage, run
$ sudo ln -s $HOME/go/bin/buildifier /usr/bin/buildifier
Install with bazel
$ git clone https://github.com/bazelbuild/buildtools.git
- change directory to
- build it with bazel command,
$ bazel build //buildifierThe executable file will be located under
- make a soft link
clang-format can be installed by command:
- Debian/Ubuntu based:
$ sudo apt-get install clang-format
$ brew install clang-format