How to Upgrade Your Dash Masternode to Sentinel 12.1
I really like the Dash Coin. There’s a lot of things it has going for it, and I like the development path and future potential. There’s a saying I’ve heard that I like to quote, “Bitcoin is digital gold, Litecoin is digital silver, and Dash is digital Cash.”
I own a few Dash Masternodes, and have each one of them running on Virtual Private Servers (VPS’s) around the world. VPS’s are amazing! For $5-$10 per month, I can get a linux server with 99.9% uptime, static IP address, in a secure datacenter. I can build a whole business out of VPS’s, whereas when I started my last business in 2002, if I wanted another server I had to buy a $3000 machine. Like I said, amazing!
Anyway, the new version of Dash, 12.1, came out last night. So today I needed to upgrade my Dash Masternodes, as well as my Dash PC client. I’ve been holding off converting my laptop from Windows to Ubuntu, waiting for this upgrade. A few months ago I was still using my trusty Mac notebook, so this Windows environment is a temporary, and somewhat frustrating, interlude.
The 12.1 version of Dash means I can use my laptop client, whether Windows or Ubuntu, with a hardware wallet, and control masternodes with it. Huge improvement! I already use the Nano Ledger S wallets, which have Dash capability, and just got a Keepkey in the mail today, so I know I am going to have to move my Dash over to the hardware wallet, and regenerate the Dash Masternode keys. I may as well do that in conjunction with moving my Dash wallet over to Linux with hardware wallet encryption keys.
It’s a multi step process, of course. First upgrade the Dash Masternodes to 12.1, then move the wallet to hardware keys, then move to Ubuntu.
The Dash team has written some excellent upgrade guides, because they want this to go smoothly. Since I had to put together a multi-Masternode upgrade process, and I have kind of a different way of working with linux VPS’s, I made my own shorthand notes of the process. They are below for anyone who wants to use them, and they will help me when I need to upgrade to next version.
These notes are based off the excellent upgrade guide from Tao of Satoshi, right here:
https://www.dash.org/forum/threads/taos-masternode-setup-guide-for-dummies-updated.2680/#post-25672
Thanks @taoofsatoshi !
Upgrade to the 12.1 Dash-Qt client on your Windows PC
- Stop the Dash-QT program running on your windows PC
- Copy the entire Dash folder to Documents\Dash
- Rename Documents\Dash to Documents\Dashcore
- Navigate to Documents\Dashcore, and create a new folder called Documents\Dashcore\old
- Copy all the .dat files from Documents\Dashcore\ to the Documents\Dashcore\old folder except for wallet.dat
- Download the Dash Core Win64/Zip file from https://www.dash.org/downloads/ to your Download directory
- Extract the dashcore-0.12.1.0-win64.zip file
- Copy the dash-qt.exe file from the bin folder to the Documents/Dashcore folder.
- Double click the dash-qt.exe file that’s in the Documents folder and choose a new custom location for the data directory of Documents/Dashcore
- Let it reindex everything. This will take at least an hour.
Upgrade The Masternodes
SSH to your first node
Upgrade the ubuntu 16.04 LTS operating system packages
sudo apt update sudo apt dist-upgrade
Stop the monit application so it does not restart the dashd daemon
sudo systemctl stop monit
Stop the dashd daemon
cd .dash ./dash-cli stop
go back to your home directory
cd
Create a new directory called old
mkdir old
Make a new .dashcore directory
mkdir .dashcore
Copy two files from .dash directory to .dashcore directory
cp .dash/dash.conf .dashcore/ cp .dash/start_dash.sh .dashcore/
Move the .dash and .cache directories to the old directory
mv .cache/ old/ mv .dash/ old/
Download the new dashcore 12.1 linux file
wget https://www.dash.org/binaries/dashcore-0.12.1.0-linux64.tar.gz
Extract it
tar xf dashcore-0.12.1.0-linux64.tar.gz
Copy dashd and dash-cli to .dashcore
cd dashcore-0.12.1/bin/ cp dashd ~/.dashcore cp dash-cli ~/.dashcore
Edit the old dash.conf file so it looks like this, keeping all your old values in place
#---- rpcuser=XXXXXXXXXXXXX rpcpassword=XXXXXXXXXXXXXXXXXXXXXXXXXXXX rpcallowip=127.0.0.1 #---- listen=1 server=1 daemon=1 maxconnections=24 #-------------------- masternode=1 masternodeprivkey=XXXXXXXXXXXXXXXXXXXXXXX externalip=XXX.XXX.XXX.XXX:9999
Start dashd
~/.dashcore/dashd
Let this update for a while – maybe an hour or so
Install sentinel (Guide for this based on @moocowmoo‘s version)
sudo apt update sudo apt install git python-virtualenv virtualenv
If you are not already there, navigate to your .dashcore folder
cd .dashcore
Clone sentinel, cd to sentinel directory
git clone https://github.com/dashpay/sentinel.git cd sentinel
Create virtual python environment
virtualenv venv
Install sentinel dependencies
venv/bin/pip install -r requirements.txt
Test sentinel is alive and talking to the still sync’ing wallet
venv/bin/python bin/sentinel.py
You should see: “dashd not synced with network! Awaiting full sync before running Sentinel.”
This is exactly what we want to see at this stage
Set up other stuff while the reindex is working
Create a crontab entry to wake sentinel every five minutes with
crontab -e
Paste this at the bottom, making sure there is another blank line below it:
*/5 * * * * cd ~/.dashcore/sentinel && ./venv/bin/python bin/sentinel.py 2&>1 >sentinel-cron.log
OK, we’ve got Sential taken care of. Now let’s make sure dashd keeps running with monit. Install it.
sudo apt install monit
Create a file in the .dashcore directory
cd ~/.dashcore/ vim start_dashd.sh
Paste this into the file, substituting your username for dashuser
#!/bin/bash /bin/su dashuser -c '/home/dashuser/.dashcore/dashd 2>&1 >> /home/dashuser/.dashcore/rc.local.log'
Make it executable
chmod +x start_dashd.sh
Edit the file /etc/monit/monitrc
sudo vim /etc/monit/monitrc
Edit the file as follows:
Uncomment these lines at about line 149
set httpd port 2812 and use address localhost # only accept connection from localhost allow localhost # allow localhost to connect to the server and
Add this to bottom – change dashuser to your username
check process dashd with pidfile /home/dashuser/.dashcore/dashd.pid start program = "/home/dashuser/.dashcore/start_dashd.sh" with timeout 60 seconds stop program = "/bin/su dash -c /home/dashuser/.dashcore/dash-cli stop"
Load the new configuration
sudo systemctl start monit
Enable the watchdog
sudo monit start dashd
Check monit’s status
sudo monit status
After everything is done, you could kill the dashd process and see if monit starts it. But don’t do that now!
Keep checking masternode sync status until it’s complete
~/.dashcore/dash-cli mnsync status
This is what you’re waiting to see:
AssetId 999, all trues, one false, and a FINISHED. Keep checking until it looks like this:
{ "AssetID": 999, "AssetName": "MASTERNODE_SYNC_FINISHED", "Attempt": 0, "IsBlockchainSynced": true, "IsMasternodeListSynced": true, "IsWinnersListSynced": true, "IsSynced": true, "IsFailed": false }
Start your masternode on the Dash-QT wallet on your PC
At this point, your remote masternode is synchronized and chatting with the network but is not accepted as a masternode because it hasn’t been introduced to the network by your collateral.
The Dash-QT wallet in 12.1 is fancy, with a whole new Masternode Tab. Select the tab, right click over the Masternode you want to start, and choose Start Alias. Enter your wallet passphrase, and it will go through it’s startup process. That takes about 30 minutes.
When you think everything is going, return to the command line on your VPS and test sentinel has nothing to say by running
~/.dashcore/sentinel/venv/bin/python ~/.dashcore/sentinel/bin/sentinel.py
There should be no output from this command. That is it’s indication it’s working.
Now make sure the masternode is working and it’s happy
~/.dashcore/dash-cli masternode debug
Look for a success message, something like this:
Masternode successfully started
That means your done!
Keep your Dash-QT wallet open on your desktop. You’ll see your masternodes go through some different status indicators. At the end of it, each Masternode will say Enabled.
If not, try starting it from the Dash-QT wallet again.
Now, the good news is, if you use Dash Central to monitor your Masternodes, you don’t have to do anything to keep that working. It just keeps chugging along. Here’s my status after I upgraded my Masternodes today:
How about that!
Now you will need to upgrade your dashman application if you use it. It’s fairly painless. Navigate to ~/dashman/ and enter this command
./dashman sync
It should look like this:
dashuser@masternode:~/dashman$ ./dashman sync dashman version 0.1.20 (3-gf8cf0fb) - Wed Feb 8 19:09:01 EST 2017 remote: Counting objects: 15, done. remote: Compressing objects: 100% (14/14), done. remote: Total 15 (delta 1), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (15/15), done. From https://github.com/moocowmoo/dashman * [new tag] 0.1.21 -> 0.1.21 Fetching origin remote: Counting objects: 17, done. remote: Compressing objects: 100% (13/13), done. remote: Total 17 (delta 9), reused 3 (delta 3), pack-reused 1 Unpacking objects: 100% (17/17), done. From https://github.com/moocowmoo/dashman f8cf0fb..a15c444 master -> origin/master * [new branch] 12.1 -> origin/12.1 * [new branch] cloudflare -> origin/cloudflare No local changes to save Already on 'master' Your branch is behind 'origin/master' by 5 commits, and can be fast-forwarded. (use "git pull" to update your local branch) HEAD is now at a15c444 config - include virtualenv in deps for some platforms Up to date. dashuser@masternode:~/dashman$
All set. Now we just need to move everything over to a hardware wallet…