1. Ethereum Wallet
Before setting a node, you must own a valid Ethereum wallet with at least 100 ATRAC tokens and at least 0.01 Ethers. If you don’t have Ethers or ATRACs, you can go and fetch some to the https://faucet.rinkeby.io for test Ethers and https://origintrail.io/faucet for ATRAC tokens.
2. Public IP or open communication
It is required to have a public IP address, domain name or open network communication with internet. If behind NAT please manually setup port forwarding to the all node’s ports.
3. Docker installed
The host machine needs to have Docker installed to be able to run the docker commands specified below. You can find instructions on how to install Docker here: https://docs.docker.com/install/.
It is strongly suggested to use the latest official version.
4. Open ports
By default docker container will use 8900, 5278 and 3000 ports. These can be mapped differently in docker container initialization command. Make sure they’re not blocked by firewall and open to the public.
Please note: port 8900 is used for REST access which is not available until OT node is fully started. This can be concluded after following log message is displayed.
info - OT Node started
Configuring the node
To properly configure the node you will need to create a config file in JSON format and provide some basic information about how the node should work. This file will then be passed to the Docker container.
Let’s create the file .origintrail_noderc and store all the information about what kind of configuration we want to set up. The bare minimum of settings that needs to be provided is a valid Ethereum wallet and public address or domain name.
We create the .origintrail_noderc file with following content:
"node_wallet": "your wallet address here",
"node_private_key": "your wallet's private key here",
"hostname": "your external IP or domain name here"
node_wallet and node_private_key - Ethereum wallet address and its private key.
hostname is the public network address or hostname that will be used in P2P communication with other nodes for node’s self identification.
Running a Docker container
Everything is prepared for the Docker to create and run a container. Let’s just point Docker to the right image and configuration file with the following command:
sudo docker run -i --name=otnode -p 8900:8900 -p 5278:5278 -p 3000:3000 -v ~/.origintrail_noderc:/ot-node/.origintrail_noderc origintrail/ot-node
NOTE: in this example, our configuration file .origintrail_noderc is placed in to the home folder of the current user (ie. /home/ubuntu).