IOTA Tangle is a Blockless Distributed Ledger for the Internet of Things – Running a IOTA Full Node on Rock64 Board
A lot of efforts is going into distributed ledger technologies like the blockchain, and while I keep hearing blockchain is the future, there’s a lot of hype, and so far I have not seen that many practical use cases.
So maybe we have a practical application here… Sadly, there’s no video recording of the IOTA blockchain BoF, so instead let’s go to the IOTA website to find out more.
What is IOTA?
That’s the short description of the solution:
An Open-Source Distributed Ledger
The first open-source distributed ledger that is being built to power the future of the Internet of Things with feeless microtransactions and data integrity for machines.
The key technology behind IOTA (Internet of Things Applications) is called the Tangle:
IOTA is a revolutionary new transaction settlement and data transfer layer for the Internet of Things (IoT). It is based on a new distributed ledger technology, the Tangle, which overcomes the inefficiencies of current Blockchain designs and introduces a new way of reaching consensus in a decentralized peer-to-peer system. Using IOTA, for the first time ever, people and machines can transfer money and/or data without any transaction fees in a trustless, permissionless, and decentralized environment. This means that even nano-payments are possible without the need for a trusted intermediary of any kind.
Blockchaing vs Tangle
IOTA’s crypto-currency is called MIOTA and is listed on coin exchange websites. If you want to read the actual science / math behind the technology, you’ll find several academic papers.
Everything still feels a little abstract after reading the introduction, and description, but the summary of the talk at OpenIoT Summit explains some of the potential application of this type of technology:
Blockchain based protocols can be utilized to solve difficult problems in the IoT and Embedded spaces. In this BoF we will discuss how to use this technology to establish a decentralized root of trust, that allows device control, ownership, and secure data transfer for devices with constrained footprints. In addition to blockchain, we will delve into new distributed ledger technology, and zero-knowledge proofs which allow one party (the prover) to prove to another (the verifier) that a statement is true, without revealing any information beyond the validity of the statement itself. This is important for anonymous machine to machine transactions to occur with very little compute resources.
The latter appears to refer to IOTA without directly mentioning it.
You’ll read in many places that IOTA is the ideal solution for the Internet of Things, but others have a different opinion. Only time will tell.
The best way to start understanding how it works is to experiment with it, and while IOTA website has a getting started guide, I recently saw information about using IOTA on Rock64 board.
Installing IOTA Full Node on Rock64 board
The work was done by muXxer, and is described as “docker-compose.yml for IOTA IRI on ROCK64 including Nelson.cli, Nelson.gui and Field.cli”.
This is all alpha and beta software with four main components used:
CarrIOTA Nelson.cli – Allows auto-discovery (P2P) for IOTA-Fullnodes while at the same time protecting the network against attacks
CarrIOTA Nelson.gui – Web based UI for Nelson.cli
CarrIOTA Field.cli – Proxy for your IRI that sends regular statistics to the Field server, and optionally accepts jobs from the server’s load balancer
The first think it do is to download and flash ayufan Ubuntu Bionic containers image. At the time of writing, the latest release was bionic-containers-rock64-0.6.41-227-arm64.img.xz,and I just flashed with Etcher to my eMMC flash module, but a micro SD card would do. In case you don’t know how to perform that step, read Rock64 Ubuntu review. As we’ll see below you’ll also need a USB hard drive or SSD to store the Tangle, unless you have a large (64GB+) eMMC module or micro SD card.
Now we can insert the eMMC flash module or micro SD card int othe board, boot it up, and login via SSH or the serial terminal using rock64/rock64. Now we can make sure our system is up-to-date:
We now need to mount our external hard drive and redirect the docker directory. I’ll use the EXT4 partition (volume name USB3_EXT4) on my USB drive. Let’s find out the UUID / PARTUUID:
All all storage devices, & check our drive are mounted correctly:
1
2
sudo mount-a
ls/mnt/iota-hdd/
The next step is to redirect docker containers to our external drive with a symlink:
1
2
3
4
5
sudo systemctl stop docker
sudo mv/var/lib/docker//mnt/iota-hdd/docker
sudo ln-s/mnt/iota-hdd/docker//var/lib/docker
sudo chown-Rroot:root/mnt/iota-hdd/docker
sudo systemctl start docker
The instructions recommend to setup 8GB swap for Rock64 with 4GB RAM. Instead I tried to enable ZRAM first, but while the current Ubuntu 18.04 image comes with a kernel with ZRAM module, and zram-config is installed, the zram swaps are not configured automatically. So instead I just configured 2GB swap for my Rock64 1GB RAM board:
Shell
1
2
3
4
5
sudo mkdir-p/var/cache/swap
sudo fallocate-l8G/var/cache/swap/swap0
sudo chmod0600/var/cache/swap/swap0
sudo mkswap/var/cache/swap/swap0
sudo swapon/var/cache/swap/swap0
Let’s check it’s properly enabled:
Shell
1
2
3
4
free-mh
total used free shared buff/cache available
Mem:920M101M568M3.5M251M802M
Swap:2.0G0B2.0G
Good, now we can add to /etc/fstab:
1
/var/cache/swap/swap0 none swap sw00
and adjust some swap settings in /etc/sysctl.conf:
Shell
1
2
vm.swappiness=10
vm.vfs_cache_pressure=50
This will only make the system use swap if RAM is low, and try to keep more memory for applications instead of cache. The parameters are explained in details here.
The first configuration step is to change the Nelson config in volumes/nelson.cli/config.ini file to match our requirements. I just changed the name, but as you can see there are plenty of other parameters in the file:
;Alternatively toaddress,you can providea(NEW)seed
;Inthiscase,the Field cient will be generating new,unused addresses dynamically.
;seed=XYZ
port=21310
pow=yes
disableIRI=false
;Ifyou want Field togenerateacustom id,instead of using machine-id
customFieldId=true
You’ll likely want to change the address to you own IOTA address for donations, otherwise you can leave the default to give donations to muXxer (the developer).
The first time we launch the wallet, we’re being asked to select between light node or full node. Now we can better understand that we are dong… Full node download the complete tangle database, while light node will only connect to a remote mode. It looks like the equivalent of nodes and gateways found in any IoT networks. A few more details here.
I went with the Light Node, and was asked to select a host from list:
The next screen asks you to login. You can do that with your Seed. But how to create one? Easy… just type a random string of 81 characters with uppercase Latin characters and the number 9 only in a text editor, safely save it (you’ll also all your token if you don’t), copy and paste it in the “Seed” filed and login.
Click to Enlarge
You should then able to check your receive address and QR code, which you can share publicly. Just don’t do that with our Seed address, which must remain private. You can insert your receive address in volumes/field.cli/config.ini.
Back to IOTA Full node installation
Time to download the Tangle (database), about 12.5GB large for now:
Shell
1
2
chmod+xdownload_mainnet_db.sh
./download_mainnet_db.sh
The script will also decompress the files after which the download space used by the directory will be 17GB, after the 12.5GB compressed archives are deleted at the end. That means you need a least 29.5GB free space for this to work, and explains why we need to use a hard drive, although I’d assume a 64GB eMMC module or good micro SD card might do too.
You may have to open the following ports for Rock64 IP address in your firewall:
14600 UDP – IOTA/IRI UDP connection port
15600 TCP – IOTA/IRI TCP connection port
16600 TCP – Nelson.cli TCP connection port
21310 TCP – Field.cli TCP connection port
We can now start our IOTA full node in docker:
Shell
1
sudo docker-compose up-d
The first time many files will be downloaded, and extracted.
Once all the update are done, we’ll be brought back to the command line, where we can check the status of the container:
Shell
1
2
3
4
5
6
sudo docker ps
CONTAINER IDIMAGE COMMANDCREATED STATUS PORTS NAMES
e91bf54bc17b muxxer/rock64_nelson.gui:latest"/usr/local/bin/nels…"About an hour ago Up About an hour0.0.0.0:5000->5000/tcp iota_nelson.gui
3d38cdaff1d4muxxer/rock64_field.cli:latest"/usr/local/bin/fiel…"About an hour ago Up About an hour0.0.0.0:21310->21310/tcp iota_field.cli
3e255409e7d2muxxer/rock64_nelson.cli:latest"/usr/local/bin/nels…"About an hour ago Up About an hour0.0.0.0:16600->16600/tcp,0.0.0.0:18600->18600/tcp iota_nelson.cli
bc7f2cd457b5 muxxer/rock64_iota_iri:latest"/usr/bin/java -XX:+…"About an hour ago Up About an hour0.0.0.0:14265->14265/tcp,0.0.0.0:15600->15600/tcp,0.0.0.0:14600->14600/udp iota_iri
We can also access the Nelson GUI in a web browser using http://rock64_ip:5000.
Click to Enlarge
This is what it looks like with a few (2) peers connected.
Click to Enlarge
A full IOTA node is not exactly designed to run on ultra low end hardware:
Shell
1
2
3
4
free-mh
total used free shared buff/cache available
Mem:920M802M37M3.0M81M101M
Swap:2.0G2.0G2.9M
All my 1GB of RAM and 2GB of swap were quickly filled up, which must be why the instructions where for a Rock64 with 4GB RAM with 8GB swap space setup on a SSD… Sometimes while logging with SSH I could also see the following message:
System information disabled due to load higher than 4.0
At this point , I restarted the IOTA Wallet on my computer, edited the Node Configuration to see if it would connected to my full node.
Click to Enlarge
And it did, you just need to use the API port in the address / URL.
Some of the use cases are discussed on Medium here and there with benefits including:
Tamper-proof, quantum resistant and fast
No fees involved
IOTA tokens are not needed to transfer the data – the data is packed into the transaction and can be sent to whatever recipient is chosen. So you can send 0 IOTA and still deliver the datafor free
IOTA will be able to handle thousands of transactions per second with each transaction containing valuable data without fees involved
Based the answer to Reddit post, the Tangle does not actually store sensor data, but instead establish a connection and verifies integrity. So you’d still have your own database to store the data, so I understand IOTA just makes it easier to share securely with or without payment.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
This website uses cookies to improve your experience. We'll assume you're ok with this, but if you don't like these, you can remove them Accept
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.