How to Install DIVI CLI on Digital Ocean

For those of you itching to install the DIVI CLI on your Digital Ocean Ubuntu Droplets, we have created this quick and easy guide to get you started.

Following this tutorial will get you all set up with your very own DIVI node and wallet address on your remote Digital Ocean Droplet.

To be clear, this node differs from a masternode in that it is only a peer, and cannot process masternode blocks for rewards.

How to use the terminal

It is important that you have a terminal window open on your local machine for this process.

On Windows
If you have an updated version of Windows, you can use the CMD Prompt as follows: Press the Windows button. Type cmd. Right click and run as Administrator. If there's a security prompt, click 'Yes' to accept.

On Mac
Type command + spacebar then type terminal. Press enter.

On Linux
Search for terminal.

Digital Ocean setup

The next few steps will take you through the safest way to setup your Digital Ocean Droplet to run a new masternode.

Register for a new Digital Ocean plan

You’ll need to confirm your email address and give them your credit card or PayPal acct, then fund the account for at least $10.

Click "Create Droplet." The $10/mo. Droplet plan is adequate.

Use these Settings:

  1. Choose an Image

    • Ubuntu 18.04.4 x64
  2. Choose a Size (Standard Droplet)

    • 2 GB - 1 vCPU - 50 GB - 2 TB - $10/mo - $0.015/hr
  3. Add Backups

    • ENABLE BACKUPS
  4. Add Block Storage

    • Ignore
  5. Choose a Datacenter Region

    • Choose one close to you
  6. Select Additional Options

    • Private Networking - YES
    • IPv6 - YES
    • User Data - no
    • Monitoring - YES
  7. Add Your SSH Keys

    • Not absolutely necessary, but if you are familiar with SSH select this option. If you'd like to setup SSH but are unfamiliar, see this tutorial.
  8. Finalize and Create

    • How Many Droplets: 1 Droplet
    • Choose a Hostname: whatevernameyouwant
  9. Click CREATE

You now have a droplet!

Although not absolutely necessary, it's recommended that you use SSH to connect to your droplet, but in the event that you are not:

Now you can log in to your Digital Ocean account using the info sent to you in email, and come back here to continue.

How to create an SSH key

An SSH keypair will be necessary to access your Droplet securely.

Windows
Official Digital Ocean PuTTY instructions.

Instructions about how to enable SSH on Windows 10 (Powershell) are here: Using SSH from CMD Line

Another option is to download ZOC: ZOC Download for Windows

Your username and password will be sent to you in an email after you set up your Droplet, so to log in to ZOC you can use those credentials.

Linux/Mac
These instructions should help you set up an SSH Key on Digital Ocean.

1. Access your Droplet

Find your Droplet's IP by going to your Digital Ocean dashboard and clicking the IP address. It will automatically be copied to your clipboard.

ip-1

To access your droplet via SSH, simply type

ssh [email protected]

You will be asked for your SSH password, assuming you set one up. Enter it.

If this is your first time accessing your droplet, you may be asked to create a password.

2. Retrieve the binary

Once you are connected, you can get the CLI binary.

sudo apt-get install unzip
wget https://github.com/Divicoin/Divi/releases/download/CLI/divi_ubuntu.zip
unzip divi_ubuntu.zip

3. Install

Once the binary is downloaded to your Droplet, you can begin the installation process.

cd divi_ubuntu
chmod 777 *
./divid

The final command will return something like this, don't worry, this is expected:

Error: To use divid, or the -server option to divi-qt, you must set an rpcpassword in the configuration file:
/root/.divi/divi.conf
It is recommended you use the following random password:
rpcuser=divirpc
rpcpassword=ARandomlyGeneratedSuperSecretPassword
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %s | mail -s "DIVI Alert" [email protected]

The values you'll need to copy are

rpcuser=divirpc
rpcpassword=ARandomlyGeneratedSuperSecretPassword

4. Configure

Next you will need to configure your node to connect to the network.

First, copy your divi.conf file to the .divi directory.

cp divi.conf ~/.divi
sudo nano ~/.divi/divi.conf

Replace rpcuser and rpcpassword with the values returned in step 3. Your divi.conf should look something like this:

##
## divi.conf configuration file. Lines beginning with # are comments.
##

addnode=divd.westus.cloudapp.azure.com
addnode=divp.westus.cloudapp.azure.com
addnode=divg.westus.cloudapp.azure.com
addnode=divs.westus.cloudapp.azure.com
addnode=divc.westus.cloudapp.azure.com
addnode=div1.westus.cloudapp.azure.com
addnode=div2.westus.cloudapp.azure.com
addnode=div3.westus.cloudapp.azure.com

rpcuser=divirpc
rpcpassword=ARandomlyGeneratedSuperSecretPassword
rpcport=51473
rpcallowip=127.0.0.1
rpcconnect=127.0.0.1
daemon=1

## mndiviaddress=D97SEoJDksK1NieZuuFP85JGpFkzPY1rnj

Save and close the configuration file by executing the following key combinations.

ctrl + O
ctrl + X

5. Start divid

Now that you've configured your node, you can run it.

./divid -debug

You will see a log that says DIVI Server starting.

Open your debug log to check the node's sync progress.

tail -f ~/.divi/debug.log

To exit the log, simply type the key combination.

ctrl + C

Check the current block count by typing

./divi-cli getblockcount

6. Get your Divi address

Get a new Divi address.

./divi-cli getnewaddress "account-name"

Where account name is the identifying name for your account.

Pro tip: You can also use "" as the account name to add a new address to the default account.

View your addresses any time by typing

./divi-cli getaddressesbyaccount "account-name"

Where account name is the name of the account you want to check the addresses of.

Pro tip: If you forget your account names simply type

./divi-cli listaccounts

Optional: Stop divid

If you don't want to keep divid running you can stop it by typing

./divi-cli stop