O
O
Otnode
Search…
Docker installation
Below is a end-to-end step-by-step guide with the most important steps.

Create a VPS server

You need to rent a VPS server to host your node on. There are several companies on the market. I have been using Netcup for the past few months and so far they have a great specs/price ratio.
Their VPS 500 G8 for 5.29 Euro/month server is sufficient for our needs. They have 10% off with vouchers, which unfortunately have one time use, so I have created another page with such vouchers which you can find by clicking on this LINK.
Another option is more renowned company Digital Ocean (click on the link to get $100 free referral credit for 2 months) is on the higher price range but with great support and reliability (starting from $10/month with 2 GB).
Netcup:
Once you place the order, you will get a callback to confirm the order and you will get your login details. With Netcup you have account control panel and server control panel. Login to your server contorl panel, select your server from the right corner, select Media on the left, then Images on the right:
Then select Ubuntu 20.04 LTS on the next screen:
Then click on "Minimal / minimal system with ssh preinstalled" and then enter again your password for the Server Control page. You will receive an e-mail once the server is ready, and proceed further with the guide.
Digital Ocean:
Select the Marketplace and choose docker on the top right corner, Shared CPU Basic, and the $10/month server.
Digital Ocean
Once the server is setup, you will receive an e-mail (see it within the VPS interface) with the login instructions and server IP, which we will use later.
Video guide will be coming up shortly with the updated instructions for xDAI. In the meantime you can follow the previous one I made for Ethereum, it is pretty much the same, though some of the steps on the guide are not needed for xDAI (Infura, config file is different, etc.). Use it as reference, but don’t follow it step by step.
OriginTrail is integrated with a number of blockchains and each requires slightly different setup. The guide will break down here separately for each Blockchain – xDAI, Ethereum, StarFleetChain (once live in Q4 2021) etc.

I. Obtain xDAI and xTRAC

xDAI
xDAI is the gas fee currency on the xDAI chain. Given that the gas fees there are very low, 1-2 xDAI will last you a long time. There are multiple ways to obtain it:
xTRAC
xTRAC is wrapped TRAC on other chains. You can convert TRAC tokens to xTRAC using the Omni Bridge. Go to https://omni.xdaichain.com/ Instructions how to use the bridge can be found here: https://docs.tokenbridge.net/eth-xdai-amb-bridge/multi-token-extension/ui-to-transfer-tokens/transfer-erc20
The custom token contract to see xTRAC on your Metamask on xDAI is:
1
0xEddd81E0792E764501AaE206EB432399a0268DB5
Copied!
Once you have sorted out your xDAI and xTRAC, you need to add the Custom RPC for xDAI, so you can switch your Metamask to the xDAI network. Easiest way to do it is to go to: https://chainlist.org/ , click on Connect Wallet in the top right corner and then click “Add me to metamask” button on xDAI section.
Then you will see on your Metamask xDAI entry when you click on the dropdown on the top where it says Ethereum Mainnet:

II. Prepare the wallets

Create operational wallet and management wallets
Create a new wallet using Mycrypto or Metamask and export the private key, which we will use for the operational wallet for the node. Deposit the amount of xTRAC you want to have on your node, which is minimum 3000 xTRAC to secure the network + additional xTRAC to be able to accept jobs. Currently around 5-6k total xTRAC is recommended. Also send 0.1 xDAI for gas fees during installation and litigation responses. For your management wallet, best approach is to use a hardware wallet like Ledger Nano S or Trezor.

III. Configure the server

Download Termius (or any other terminal client like Kitty) and configure it with the details you received from the VPS hosting (IP, username, password). Click on Hosts, Select New host, Choose a Label for the node and add the IP address from the confirmation e-mail from Netcup or Digital Ocean that the node is created, choose root as username and input the password, and click on Save on the right top corner.
Once you login follow the configuration logic below. Click on the COPY button after each command and right click into the terminal window to paste it. Then confirm with Enter

1. Update the server programs:

1
apt update && apt upgrade -y
Copied!
If you see this notice, choose the first option:

2. Reboot server with below command, close the window and login again

1
reboot
Copied!

3. Install docker (skip this step if you selected the Digital Ocean Server with Docker installation).

The official installation commands for docker can be found here, should the ones in this section become outdated: https://docs.docker.com/engine/install/ubuntu/
1
apt-get install apt-transport-https ca-certificates curl software-properties-common
Copied!
1
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Copied!
1
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Copied!
1
apt-get update
Copied!
1
apt-get install docker-ce
Copied!

4. Setup the firewall

1
ufw allow 8900 && ufw allow 5278 && ufw allow 3000 && ufw allow 22/tcp
Copied!
Activate and double check the firewall is properly configured:
1
ufw enable && ufw status
Copied!

5. Setup the configuration file

1
nano /root/.origintrail_noderc
Copied!
For XDAI only:
Paste the below in the text editing tool and update the configuration accordingly:
1
{
2
"blockchain": {
3
"implementations": [
4
{
5
"blockchain_title": "xDai",
6
"network_id": "xdai:mainnet",
7
"identity_filepath": "xdai_erc725_identity.json",
8
"dh_price_factor" : "1",
9
"node_wallet": "xxxxxxxx",
10
"node_private_key": "xxxxxxxx",
11
"management_wallet": "xxxxxxxx"
12
}
13
]
14
},
15
"network": {
16
"hostname": "xxx.xxx.xxx.xxx"
17
},
18
"initial_deposit_amount": "5000000000000000000000",
19
"dh_max_holding_time_in_minutes": 530000,
20
"dh_maximum_dataset_filesize_in_mb": 10,
21
"dataset_pruning": {
22
"enabled": true,
23
"imported_pruning_delay_in_minutes": 1440,
24
"replicated_pruning_delay_in_minutes": 1440,
25
"low_estimated_value_datasets": {
26
"enabled": false,
27
"minimum_free_space_percentage": 30
28
}
29
}
30
}
Copied!
save the file by Ctrl-O and Enter and exit by Ctrl-X
For XDAI and Polygon:
1
{
2
"blockchain": {
3
"implementations": [
4
{
5
"blockchain_title": "xDai",
6
"network_id": "xdai:mainnet",
7
"identity_filepath": "xdai_erc725_identity.json",
8
"dh_price_factor" : "1",
9
"node_wallet": "xxxxxxxx",
10
"node_private_key": "xxxxxxxx",
11
"management_wallet": "xxxxxxxx"
12
},
13
{
14
"blockchain_title": "Polygon",
15
"network_id": "polygon:mainnet",
16
"dh_price_factor" : "1",
17
"node_wallet": "xxxxxxxx",
18
"node_private_key": "xxxxxxxx",
19
"management_wallet": "xxxxxxxx"
20
"rpc_server_url": "xxxxxxxxxxx"
21
}
22
]
23
},
24
"network": {
25
"hostname": "xxx.xxx.xxx.xxx"
26
},
27
"initial_deposit_amount": "5000000000000000000000",
28
"dh_max_holding_time_in_minutes": 530000,
29
"dh_maximum_dataset_filesize_in_mb": 10,
30
"dataset_pruning": {
31
"enabled": true,
32
"imported_pruning_delay_in_minutes": 1440,
33
"replicated_pruning_delay_in_minutes": 1440,
34
"low_estimated_value_datasets": {
35
"enabled": false,
36
"minimum_free_space_percentage": 30
37
}
38
}
39
} ]
40
},
41
"network": {
42
"hostname": "xxx.xxx.xxx.xxx"
43
},
44
"initial_deposit_amount": "5000000000000000000000",
45
"dh_max_holding_time_in_minutes": 530000,
46
"dh_maximum_dataset_filesize_in_mb": 10,
47
"dataset_pruning": {
48
"enabled": true,
49
"imported_pruning_delay_in_minutes": 1440,
50
"replicated_pruning_delay_in_minutes": 1440,
51
"low_estimated_value_datasets": {
52
"enabled": false,
53
"minimum_free_space_percentage": 30
54
}
55
}
56
}
Copied!
Explanation:
initial_deposit_amount – amount of xTRAC you want to deposit on your node during the installation (so you skip step 10). (5000000000000000000000 is equal to 5000 xTRAC)
node_wallet – Operational wallet public address
node_private_key – Operational wallet private key. As you will store just 0.1 xDAI there for gas fees, even if server gets compromised, the hacker would have access only to this small amount
Note: If your private key start with 0x, remove these two characters when adding it to the configuration file.
management_wallet – this is your management wallet public address – ideally this should be a wallet on your cold storage (Ledger Nano S, Trezor, etc.)
dh_price_factor – this is the setting of your lambda value – should be less than 1 if you want to accept most of all current jobs. The lower the value, the less paid jobs you are willing to accept.
Hostname – this is your server IP, which you can find in the notification e-mail when you setup the VPS
dh_max_holding_time_in_minutes – the maximum length of jobs you are willing to accept in minutes (for example 550 000 is to accept one year jobs).

6. Install JQ to validate whether the configuration file doesn’t contain any errors

1
apt-get install jq
Copied!
1
jq "." /root/.origintrail_noderc
Copied!
Check the brackets, double quotes and commas. Everything except your data has to be exactly like the example above.

7. Initiate the node installation

Important: Once you run this command, the TRAC will be deposited to the contract and your first task is to copy and back your ERC725 identity and node identity mentioned on Step 8 below, so you can have control over this deposited amount. Should you get an error at this stage, or if the gas setting you used is too low, do not delete the container or destroy the VPS. Instead join the discord channel or the Official Telegram group to ask for assistance
1
sudo docker run -i --log-driver json-file --log-opt max-size=1g --name=otnode -p 8900:8900 -p 5278:5278 -p 3000:3000 -v ~/.origintrail_noderc:/ot-node/.origintrail_noderc origintrail/ot-node:release_mainnet
Copied!
Once completed and node has joined the network (Make sure you wait and see it), exit the log with CTRL +C. If you interrupt the process before the node connecting to the network, you will need to spend some extra time fixing it so please be patient.
The first installation runs in interactive mode, and when you click CTRL + C, you both exit the log and stop the node. Thus one additional start command is required.
1
docker restart otnode
Copied!

8. Create identities into files on the root directory

ERC725 identity
1
docker cp otnode:/ot-node/data/xdai_erc725_identity.json ~/xdai_erc725_identity.json
Copied!
Node ID
1
docker cp otnode:/ot-node/data/identity.json ~/identity.json
Copied!

9. Read erc725 and node id and copy/paste them in secure document

1
more xdai_erc725_identity.json
Copied!
1
more identity.json
Copied!
Or Login to the server using WINSCP or any other FTP application, go to the root folder and download these two files on your local server and archive them with a password.

10. Deposit additional xTRAC from your management wallet to the node

If you want to deposit more than the initial amount, you can deposit the amount of xTRAC which will be available for jobs through the node profile management page at this URL: https://node-profile.origintrail.io/
The current recommended amount is 2000-3000 xTRAC in addition to the 3000 xTRAC required to secure the network, and they have to be present on your management wallet, which should be on a cold storage device like Ledger Nano S or Trezor. If you have not secured your crypto holdings on cold storage, please do so now as this is the best way to keep your funds secure.
Login with your XDAI ERC725 Identity which you extracted above and the operational wallet public address and follow the instructions on the page. You need metamask to initiate the deposit.
Then on the top left section “Deposit TRAC to Your Node”, enter the amount of TRAC present on your management wallet, to be deposited to the contract for your node, and a set of 2 transactions have to be processed. Metamask popup will show up for you to confirm you want to process the transaction. Once the first transaction is processed, a second popup will show for the second transaction.
Once the deposit is completed, restart your node.
1
docker restart otnode
Copied!

11. Enable auto restart and follow the log to monitor the operation of the node

1
docker update --restart=always otnode
Copied!
1
docker logs -f otnode
Copied!

12. Monitor your node

You can add your node to the OT Hub and monitor how many jobs has the node won, initiate manual payouts and quickly check if your node is online. The OT Hub can be found on the link below:
Also in the Node Maintenance section (menu on the right) you can find how to setup notifications on your mobile.

13. Add swap space

Swap space is dedicated space on your hard drive, which is used as RAM should the hardware RAM is fully utilized. This usually slows down the server as the hard drive is slower than the RAM, however the swap would ensure the node will continue operation. I highly recommend to enable 1 GB Swap space on your server.
  • check if there is swap space already enabled (SWAP line should show 0)
1
free -h
Copied!
  • Add 1 GB Swap space
1
fallocate -l 1G /swapfile
Copied!
  • enable the swap file
1
chmod 600 /swapfile
Copied!
  • mark the space as swap file
1
mkswap /swapfile
Copied!
  • enable for utilisation
1
swapon /swapfile
Copied!
  • confirm it is setup (SWAP line should show 1)
1
free -h
Copied!
  • make it permanent
1
cp /etc/fstab /etc/fstab.bak
Copied!
1
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Copied!

14. Install Fail2ban

This tool allows you to ban any user who failed to login successfully to the server after three attempts. This ensures your server cannot be bruteforced by automated bots, running millions of combinations to try to guess your password.
1
apt install -y fail2ban
Copied!
1
systemctl start fail2ban
Copied!
1
systemctl enable fail2ban
Copied!
Configure the application
1
nano /etc/fail2ban/jail.local
Copied!
Paste the following content in the file editor
1
[sshd]
2
enabled = true
3
port = 22
4
filter = sshd
5
logpath = /var/log/auth.log
6
maxretry = 3
Copied!
Save with CTRL + O and Enter and exit with Ctrl + X. Then restart the process with
1
systemctl restart fail2ban
Copied!
Last modified 25d ago