Skip to content

Instantly share code, notes, and snippets.

@felipesanti
Last active April 3, 2019 13:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save felipesanti/cee7f00e0c7c00e1009d633d5ac1483b to your computer and use it in GitHub Desktop.
Install a IOTA testnet node

How to install a IOTA node in testnet and monitor it

Although there are very good tutorials on the Internet explaining how to set up a node, I missed a tutorial covering every aspect of the installation, configuration and monitoring of the node.

This tutorial is for Ubuntu, it should work in other Unix-like operating systems as well with some modifications.

Requirements :

  • a fixed IP
  • a list of peer nodes to connect to (at least one)

Notes:

  • $ means commands typed in the command line

Steps

Prepare your node

Install IOTA

Instructions provided to install the pre-compiled version of the node, you can compile it as well

  • Create a directory to install the node $ mkdir -p /opt/iota && cd /opt/iota
  • Download in that directory the testnet version of the compiled executable Java library $ wget -O iri-testnet-1-4-0.jar https://github.com/iotaledger/iri/releases/download/v1.4.0-testnet/iri-1.4.0.jar
  • Create a configuration file in the same directory $ touch iota.ini
  • My current configuration (i.e. the content of iota.ini) is:
[IRI]
PORT = 14700
UDP_RECEIVER_PORT = 14600
TCP_RECEIVER_PORT = 14265
NEIGHBORS = tcp://xx.xx.xx.xx:yyyyy udp://xx.xx.xx.xx:yyyyy udp://myhost.net:yyyyy tcp://anotherhost.net:15666
IXI_DIR = ixi
HEADLESS = true 
DEBUG = true 
TESTNET = true
DB_PATH = db
  • Some comments: do not forget to add TESTNET = true; NEIGHBORS is a list of 7-9 nodes, don't make it any longer; go to the IOTA Slack to find neighbors for testnet

Set up a system service to run the node

  • Create a service file $ sudo touch /etc/systemd/system/iota.service
  • Write this into the service file just created

Description=IOTA node 

After=network.target 

[Service] 

WorkingDirectory=/opt/iota 

ExecStart=/usr/bin/java -Xmx4g -Xms246m -jar iri-testnet-1.4.0.jar -c iota.ini --remote-limit-api "removeNeighbors, addNeighbors" --remote 

ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure 

[Install] 

WantedBy=multi-user.target 

Alias=iota.service
  • You have several interesting options here: -Xmx4g -Xms246m is the max/min RAM memory allocated to the node application; -c iota.ini points to the configuration file created above; --remote-limit-api serves to limit API calls to the node, which in this case are the sensitive add/remove neighbors operations.

  • Launch the service  $ systemctl daemon-reload && systemctl restart iota

  • Ensure the service works file $ systemctl status iota

  • Check the node works fine $ curl http://localhost:14700 -X POST -H 'Content-Type: application/json' -d '{"command": "getNodeInfo"}' | python -m json.tool (you get a JSON with lots of node parameters).

Monitor your node

I have installed the monitoring tool in my laptop, but you could do it in your server as well. Follow the instructions in https://github.com/akashgoswami/ipm (link copied below):

  • Install the NPM package $ npm i -g iota-pm

  • Create a directory $ mkdir iota-node-monitor && cd mkdir iota-node-monitor

  • For simplicity, add a start script $ echo 'iota-pm --iri http://YOUR_NODE_IP:14700 -p 127.0.0.1:8888 ' >> node-monitor.sh && chmod +x node-monitor.sh

  • Execute the script $ source node-monitor.sh and connect to http://127.0.0.1:8888/ to see how your node behaves real time :)

Links

@kiahmed
Copy link

kiahmed commented Feb 2, 2018

tried to find some testnet nodes ..couldn't find one.also discord community is super stuck up no one replied even after nagging for couple days. Also how do I test, any active faucets out there?

@alekserok
Copy link

have same issues too! can't find neighbors. can't get testnet tokens...

@MatthiasLohr
Copy link

Same problem here...

@enewhuis
Copy link

enewhuis commented Apr 3, 2019

Dang. Ya know I was just thinking about this. Why even bother with testnet? At GetLoci.com when we added the Bitcoin support we needed it because Bitcoin has fees. But with IOTA since there are no fees and since having extra nodes for testing consumes resources it makes more sense to just partition your address space into development, test, and production. Given that one can test with very small amounts that have very little value this is a cheaper total cost solution for developing with IOTA that you don't have with other cryptos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment