How to Setup a COTI Testnet node on Vultr

Wolf Crypto
Wolf Crypto
Published in
11 min readOct 17, 2019

--

A detailed guide showing you how to setup a COTI Testnet node on Vultr.

Note, since this is a Testnet server, COTI coins are not yet required as a stake to run a Testnet node. These will be required once nodes are live on Mainnet in December.

IMPORTANT UPDATE — We have created a script to do most of the hard work for you. After Step 7, you can run these commands as the root user when you first login to your VPS instead of doing Steps 8 — 13.

wget https://raw.githubusercontent.com/wolfcryptogroup/cotinode/master/install.shchmod +x install.sh./install.sh

You will be asked for an email address, server name, key and seed. The script will do the rest of the install for you!

However, we do recommend that you read through the manual process so you can see how it all works.

TL;DR Requirements —

  • A COTI Testnet Wallet
    You’ll need the node seed and private key from this wallet to enter into the fullnode.properties configuration file later on
  • A domain name, we’ve used Namecheap in the guide below
  • A Vultr Account
  • A Vultr $80 per month Ubuntu 18.04 LTS x64 server
    (320 GB SSD, 6 CPU, 16 GB, 5 TB)
  • PuTTY
  • 30–45 minutes to set the node up from start to finish

Step 1

Firstly, you’ll need to register a domain to use for your COTI node.

The easiest way to do this is to follow the guide from Namecheap.

You can choose whatever TLD you prefer, however .net is typically the cheapest to purchase.

For the purposes of this guide, we’ve registered the wolfcrypto.io domain name and have used cnode1.wolfcrypto.io for our COTI node DNS name.

Step 2

To run a node on COTI Mainnet or Testnet, you’ll need a COTI wallet, along with the wallets node seed and private key.

2a. To create a COTI wallet, you’ll need to register for a wallet if you don’t have one already. You can do this at via https://cps.coti.io/signup.

2b. Once you can login to your COTI Payment System account, you can head over to https://crypto-wallet.coti.io/connect to generate a seed for your Testnet wallet. Click on the Generate New Seed button to create a new wallet.

2c. On the following page, make sure you select Testnet from the dropdown, enter in a secret key (that you make special note of and write down somewhere) and then hit the Generate Seed button. Your secret key should be different than your login password for the COTI Payment System!

Note down the Seed generated and use this to login to your Testnet wallet.

2d. Once logged into your wallet, click on Account keys and copy the Private key for your wallet.

Now you have both your Seed and Private key phrases that you’ll need to enter into the fullnode.properties file later on in the guide.

2e. You’ll also need to upgrade your COTI wallet to “Full Node Operator” status. You can do this by clicking on Upgrade and then Full Node Operator from within the testnet wallet

Step 3

Head to https://www.vultr.com and create a Vultr account.

Step 4

Once you have created your account, you will need to fund it to pay for a server to host your COTI node.

Choose a funding source from the options below.

The server we’ll be using for the COTI node will be the $80 per month server option so make sure you’ve funded your account for at least $80.

You’ll also need to verify your email address to create a server.

Step 5

5a. Select a server location. Typically the server location closest to you is the best option to choose.

5b. Choose a server type. For this guide we will be using Ubuntu 18.04 x64.

5c. Choose a server size. The $80 per month server is sufficient to run a single COTI node.

5d. Give your server a logical hostname/label and click Deploy Now. This will begin the setup process for your server. It should only take 5–10 mins

Step 6

6a. Once your server has been provisioned, you will be able to access the server details via the Products tab in the Vultr management panel.

6b. Click on the server name. This will take you through to the management page for that specific server. It is on this page we can get the required details to log onto the server to set it up.

6c. To connect to the COTI node server from Windows, you will require a program called PuTTY.

If you haven’t already download PuTTY, you can download it here.

If you’re using a Mac or Linux, you can connect to the server using Terminal by using the following command —

ssh root@SERVER IP ADDRESS

6d. Open Putty and enter in the server IP address and click Open. Click Yes to the Security Alert pop up.

6e. Enter in root as the username and the preset password from your Vultr account.

If you have entered in everything correctly, you should now be connected to your Vultr server and ready to setup the COTI node!

Step 7

Now is a good time to use the server IP address from the step above to create an DNS A record for the domain you have registered. This is used in the fullnode.properties file you’ll need to setup in Step 10 and to generate an SSL certificate in Step 11.

Since DNS sometimes takes a few minutes to update, it’s a good idea to do this now. If your DNS is not setup correctly, you will not be able to generate a SSL certificate, so make sure this is all correct before moving on!

7a. In your Namecheap domain console, select the domain you have registered and click on the Advanced DNS tab.

7b. Remove all existing records by clicking the red X next to each one and then click on Add New Record.

7c. Enter in the hostname for the node. We’ve called this cnode1.

7d. Enter in the Vultr server IP address in the Value field.

7e. Set the TTL to 1 min so it updates quickly and then click the green tick to save the record.

Your COTI server DNS is now setup!

In this example our node is called cnode1.wolfcrypto.io. We’ll use that as our COTI node server name for the rest of the guide.

Step 8

Now you’re ready to setup the COTI node server. Switch back to your PuTTY window and start entering in the following commands.

8a. Create a new user to run the COTI node services. Enter a secure password for your user when prompted.

adduser coti

8b. Add your new user to the sudo’ers group (so it has the required permissions to run privileged commands).

adduser coti sudo

8c. Log in as your new user.

su - coti

8d. Add the certbot repository to assist with SSL setup later on.

sudo add-apt-repository ppa:certbot/certbot -y

8e. Update and upgrade the server. This may take 5–10 mins.

sudo apt-get update -y && sudo apt-get upgrade -y

8f. Install the server requirements to setup and run the COTI node.

sudo apt install software-properties-common default-jdk maven nginx certbot python-certbot-nginx ufw nano git -y

8g. Check that everything is installed correctly by running the following commands.

java -version

The output for this command should read as such —

mvn -version

The output for this command should read as such —

8h. Before moving onto setting up the node itself, we’re going to quickly secure the node by using the ufw firewall.

Enter in the following commands, one by one.

sudo ufw allow 22sudo ufw allow 80sudo ufw allow 443sudo ufw allow 7070

These commands allow SSH, HTTP, HTTPS and the COTI Node server ports access through the firewall. All other traffic will be blocked.

Finally enable the firewall by entering in the following command.

sudo ufw enable

Step 9

Now you should be ready to setup the actual COTI node software!

9a. This command makes sure you’re in the coti users home directory.

cd ~

9b. Download the COTI node source code.

git clone https://github.com/coti-io/coti-fullnode.git

9c. Navigate into the COTI full node directory.

cd ~/coti-fullnode/

9d. Download and compile the necessary maven resources to run the COTI node.

mvn initialize && mvn clean compile && mvn -Dmaven.test.skip=true package

Once this command completes, you should see an output like the below —

Step 10

Now you are ready to set up the configuration file for your node.

10a. Enter the following command.

nano ~/coti-fullnode/fullnode.properties

This will open up a blank file in nano in which you’ll need to enter the below text. The text that has been marked in bold is text you will need to edit to fit your particular configuration.

network=TestNet
server.ip=SERVER IP ADDRESS
server.port=7070
server.url=https://cnode1.wolfcrypto.io
#example: server.url=mainnet-fullnode1.coti.io
application.name=FullNode
logging.file.name=FullNode1
database.folder.name=rocksDB1
resetDatabase=false
global.private.key=TESTNETWALLET PRIVATE KEY
fullnode.seed=TESTNETWALLET SEED

minimumFee=0.01
maximumFee=100
fee.percentage=1
zero.fee.user.hashes=9c37d52ae10e6b42d3bb707ca237dd150165daca32bf8ef67f73d1e79ee609a9f88df0d437a5ba5a6cf7c68d63c077fa2c63a21a91fc192dfd9c1fe4b64bb959
kycserver.public.key=c10052a39b023c8d4a3fc406a74df1742599a387c58bcea2a2093bd85103f3bd22816fa45bbfb26c1f88a112f0c0b007755eb1be1fad3b45f153adbac4752638
kycserver.url=https://cca.coti.io
node.manager.ip=52.59.142.53
node.manager.port=7090
node.manager.propagation.port=10001
allow.transaction.monitoring=true
whitelist.ips=127.0.0.1,0:0:0:0:0:0:0:1

10b. Once this information is entered, hit CTRL + O and then ENTER to save the file and CTRL + X to exit nano.

Step 11

We now need to setup SSL so communication between the COTI network and your COTI node is secure.

11a. Run the following command to generate an SSL certificate via LetsEncrypt using the certbot tool.

sudo certbot --nginx

11b. On this step, make sure you enter in your COTI node DNS name that you’ve created on Step 7 (in our example it’s cnode1.wolfycrypto.io).

11c. Make sure you choose option 2 here, as this will redirect all non secure (HTTP) traffic through to the more secure HTTPS.

Note, you may need to enter an email address and accept some disclaimers before seeing the above.

11d. Now we’ve setup the SSL certificates, we’ll need to create a nginx config file specifically for the COTI node to use.

Firstly we’ll need to grab the SSL certificate details from the default nginx config file.

Get these details by entering in the following command.

cat /etc/nginx/sites-enabled/default

Copy the following lines from this file.

11e. Now we can create the COTI node nginx file.

Create this file by entering in the following command.

sudo nano /etc/nginx/sites-enabled/coti_fullnode.conf

Copy and paste the following into this file. You’ll need to modify the two sections in bold below to fit your specific config.

server {
listen 80;
return 301 https://$host$request_uri;
}server {
listen 443 ssl;
listen [::]:443;
server_name [your server name here];
#example: server_name mainnet-fullnode1.coti.io;
ssl_certificate /etc/ssl/private/cert.pem;
ssl_certificate_key /etc/ssl/private/privkey1.pem;

ssl_session_timeout 5m;
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
text/css
application/json
application/x-javascript
text/javascript
application/javascript
image/png
image/jpg
image/jpeg
image/svg+xml
image/gif
image/svg;location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:7070;
}
}

This is what the full version of our file looks like.

Once you have entered and edited the relevant details, save this file by hitting CTRL + O and ENTER and then CTRL + X to exit nano.

11f. Restart nginx so it picks up the configuration changes.

sudo service nginx restart

Step 12

We’re almost done now, we just need to check the node runs successfully before creating a system service for it (which means the node will start and run whenever your server boots and you won’t need to manually start the node).

12a. Navigate to the full node directory.

cd ~/coti-fullnode

12b. Start the node using the following command.

java -jar fullnode/target/fullnode-1.4.0.RELEASE.jar --spring.config.additional-location=fullnode.properties

12c. If your node successfully starts, you should see something like the terminal output below.

If this does run correctly, hit CTRL + C to kill the process so we can set up a system service instead.

Step 13

Now we know the node runs correctly, we can create a system service for it.

13a. Create the system service file for your COTI node by running the following command.

sudo nano /etc/systemd/system/cnode.service

13b. Since this is an empty file, you’ll need to fill this in. Enter the below text exactly as it is.

[Unit]
Description=COTI Fullnode Service
[Service]
WorkingDirectory=/home/coti/coti-fullnode/
ExecStart=/usr/bin/java -Xmx256m -jar /home/coti/coti-fullnode/fullnode/target/fullnode-1.4.0.RELEASE.jar --spring.config.additional-location=fullnode.properties
SuccessExitStatus=143
User=coti
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target

Hit CTRL + O and ENTER to save the file and CTRL + X to exit nano.

13c. You’ll need to let Ubuntu know you’ve created a new system file by reloading systemd. You can do this by entering the following command.

sudo systemctl daemon-reload

To set the node to run on boot, enter the following command.

sudo systemctl enable cnode.service

13d. Now this is done, you can start your COTI node system service file by running…

sudo systemctl start cnode.service

You can check that the node has started correctly by entering the following command.

sudo systemctl status cnode.service

If everything is running correctly, you should see output similar to this.

That’s it. You now have a fully working COTI Testnet node that will run on your Vultr server 24/7!

If you encounter any issues with your server or following this guide, you can join the COTI Developer Discord channel by using this link — https://discord.gg/B2qakZ

You can also check in at the Wolf Crypto Telegram channel here — https://t.me/WolfCryptoPub

Wolf Crypto Resources

Public Group: https://t.me/WolfCryptoPub
News Channel: https://t.me/WolfCryptoAnnounce
Twitter: https://twitter.com/WolfCryptoGroup

--

--

Wolf Crypto
Wolf Crypto

Wolf Crypto is a place for ETH & BTC TA, ICO discussion, altcoin roulette & memes.