Exploring IOTA #ICT-1, testing ICT on a cloud computer

IOTA Controlled agenT (ICT) has been released for testing in the official discord channel. I will show you how to run it on your f1-micro (small computer) cloud instance.

Jan Bertrand
Coinmonks
Published in
7 min readJun 29, 2018

--

I am not cover here what ICT should solve or what in its final implementation is doing. Simply because i can’t - Its pre alpha testing. There is some speculation about it but until I have not seen it and understood the underlying mechanics that is just guessing or speaking about something someone spoke about. For now, I just let it run :-)

There are six easy bullets explained by Come-from-Beyond how to set up his little java program.

Screenshot from CFB steps for this test

There is further communication that the best hardware for this test should be a raspberry Pi Minus One. I have a raspberry Pi 3b+ and successfully set it up, but my combo modem/router won’t allow me to fwd. the necessary port so I ignored “a little” CFBs advices (“better Raspi only”) — sorry — run the program on a Virtual Private Server VPS how you could call my little computer on google server farms (name: f1-micro).

If you want to follow this tutorial please get yourself a VPS — here i explained how to get yourself a f1-micro cloud instance. Exploring IOTA #1

Lets get some information about the hardware we just created. Open from your webbrowser the SSH web-terminal and type:

:~$ cat/proc/meminfo
MemTotal: 606684 kB
....

Which means have we 606MB of memory. Now we get the cpu information

:~$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 63
model name : Intel(R) Xeon(R) CPU @ 2.30GHz

How can we have 0 processors?

Following a bit research the f1-micro actually has a shared-core which is than 0.2 virtual CPU (a virtual CPU is a single hardware hayperthread on an Intel Xeon E5)

For mor detail info:

Than we could check which linux dist. we have on our system with

:~$ cat /etc/issue
Debian GNU/Linux 9 \n \l

Download the zip file

Edit 30.06.2018: By now the file is not available any longer- i am afraid to mirror it as of disturbing the test — you may want to wait for the next testing phase (and join the official discord channel in between for new news in the #ICT channel)

you can import the zip file by using SSH or the SSH web browser functionality

This uploads the file to your home directory so you may want to move them into a seperate newly created folder

:~$mkdir iota-ict
:~$mv ict-0.1.1.zip iota-ict
:~$cd iota-ict
~/iota-ict$ ls
ict-0.1.1.zip

Create the file ict.properties

~/iota-ict$ vim ict.properties
port = 14265

In order to save the one line you have edit in this file you need to use (:wq) in vim — you dont know how much i love this editor :-)

~/iota-ict$ ls
ict-0.1.1.zip ict.properties

Your two files are prepared for execution

Run java

First thing in order to run java you need to get java.

You can get the Java Runtime Enviroment JRE (which needs approximatly 480MB of disk space)

sudo apt-get update
sudo apt-get install default-jre

Just a short check on what means default

java -version
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-1~deb9u1-b11)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)

And finally start the program

java -cp ict-0.1.1.zip cfb.ict.Ict ict.properties

where -cp indicated the classpath and we can find out more when

$ java -help
java [-options] class [args...]
...
Where options include:
-cp <class search path of directories and zip/jar files>

which means we specifing the main class in cfb.ict.Ict and hand over the main class the file ict.properties (where our UDP port is defined)

After correct execution you should see this

[2018-06-29T11:36:58.620] Ict 0.1.1
2018-06-29T11:36:58.725
Number of transactions = 0
Number of missing transactions = 0

The program is not terminated either is not printing anything else — lets go to the next step

Tell 3–4 IRI neighbors your UDP/IP

User Datagram Protocol UDP is the less known protocol for sending bit packets over the internet. As everyone has heard from TCP/IP which stands for “lets use the” Transmission Control Protocol over the Internet Protocol less people would throw UDP/IP in the room. As far as i can remember UDP does not control much — means the recipient does not check back whether packages have been recieved or not — it basically throws all the error checking stuff out.

Back to CFBs task — break it down to

  • what is my VPS IP known to the world?
$ curl ipecho.net/plain
12.123.123.123
  • can someone else reach my IP via UDP on port 14265?

We can check from outside the google cloud with following command

nc -v -u -z -w 3 12.123.123.123 14265
MySecondInstanceIP [12.123.123.123] 14265 (?) : Connection refused

the command sends UDP packets to port 14265 of 12.123.123.123 and reports when after 3 seconds no ICMP packet recieved.

We need probably to add a rule to our firewall than. There is a VPC network tab in google cloud where you can add those rules to the existing ones

VPC network tab with the rule for allowing UDP traffic on port:14265 fow all IPs

This should work now after executing above rule and check again with netcat as outlined above

  • Tell 3–7 IRI full nodes to add your IP

First make sure you have started ICT again. You might want to run it in the background and log the output in a file (ict.log). In addition it should not stop once you exit the console or shutdown your laptop/pc (nohup)

~/iota-ict$ nohup java -cp ict-0.1.1.zip cfb.ict.Ict ict.properties > ~/ict.log 2>&1 &[1] 27870

Once this is executed get a Process ID PID (27814) and you can see the performance with

$ top -p 27870

Once you are opening ict.log as a “live-stream”

~$ tail -f ict.log
nohup: ignoring input
[2018-06-29T12:55:31.521] Ict 0.1.1
2018-06-29T12:55:31.626
Number of transactions = 0
Number of missing transactions = 0

there is not much happening until you have found IRI nodes adding you

This is the tricky part — you would need to join discord chat and ask in the dedicated ICT channel whether someone likes to add you. I finally managed to get three neighbors who added my IP and I would like to say thank you again for helping me out to figure out all those little traps.

Once they have added you successfully you will get

Number of transactions = 114
Number of missing transactions = 1
2018-06-29T12:59:13.162
/IPaddressFromNode1:14600: 874 / 43 / 1 / 0 / 43
/IPaddressFromNode2:14600: 12 / 1 / 0 / 0 / 1
Number of transactions = 44
Number of missing transactions = 0

Some people decompiled the class files in the zip folder and i followed — once decompiled there could be the following interpretation of the numbers. But this is guessing as I have not understood the code. Maybe next #ICT-2 article

/IPaddressFromNode1:14600: 874 / 43 / 1 / 0 / 43

874 = numberOfAllTransactions

43 = numberOfNewTransactions

1 = numberOfInvalidTransactions

0 = numberOfRequestedTransactions

43 = numberOfSharedTransaction

EDIT 03.07.2018: Running on the f1-micro cloud instance will cost you money once your are out of the free trial time or quota.

With my ICT running two days with 4 neighbors i had 4.5 GiB outbound traffic from America to EMEA (which means the neighbors are in EMEA)

Billing of google cloud account — 4.5 GB outbound

Please make sure you switch of your instance if you dont use it anymore otherwise you will get charged.

Incoming and outgoing traffic of ICT node

Lets assume average 50–60KB/s outgoing traffic which than equals 4–5GiB/day

{50, 60}KB/s * 60s * 60min/h * 24h/day = {4.3, 5.2} GiB/day

Giving this i might have two neighbors in Americas (won’t charge) and two neighbors in EMEA (charge).

In this article we have executed the ICT java application on a f1-micro google cloud instance. We have not covered what what ICT is doing or what it is good for.

This is up for the next episodes of the exploring IOTA #ICT side exploration. Here I’d like to look through the decompiled code and understand what this pre alpha-release is actually doing. The emphasis is on trying — that might get a little embarrassing as I have very little java experience (maybe funny).. From there we can speculate what it might intent to solve or do for the IOTA, tangle and its vision — again at least i can try.

I’d love to see your questions doubts or corrections

Cheers, Jan

If you are interested in using IOTA and understand by exploring it you could start here:

Exploring IOTA #1

--

--