This guide will walk you through the process of setting up a dash masternode using a Mac OS X local machine and your own remote Linux virtual private server (VPS). It is adapted from the following guides:
- https://www.dash.org/forum/threads/masternode-setup-guide-using-os-x-local-linux-remote.1776/
- https://www.dash.org/forum/threads/taos-masternode-setup-guide-for-dummies-updated.2680/
- Basic terminal usage
- This basic terminal reference page may help if you are new to using terminal/shell/bash
- Command prompt legend
- This guide uses the command prompts below to indicate which machine you are running commands on:
Local$ sample command
- run on your local Mac OS X terminalVPS$ sample command
- run on your remote virtual private server's terminalDash$ sample command
- run on your local DashCore's console
The following steps will help you install a dash wallet on your Mac OS X. Although it is a bit dated, this video may help as well.
- From a browser on your Mac, go to https://www.dash.org/downloads
- Find and click the DashCore, Mac OS X dmg download link
- Click the downloaded dmg file to open up its contents
- Drag the DashCore.app file into the Applications folder
- Open the Applications folder and press control while clicking DashCore
- From the menu shown, click 'Open', then confirm by clicking 'Open' again
- Press 'OK' to install the app into the default directory
- Select 'Deny' or 'Allow' depending on your preference
- Note the status of the network sync shown at the bottom; this may take hours to complete but you can move on
- While syncing, and before depositing any dash, encrypt your wallet and back it up
This step (done properly) requires a lot of steps, so there is a link below to a separate guide for this step. Once complete, come back to this guide and continue on with step 3.
- Create and secure a virtual private server (VPS) to host your masternode
- You may use your own hardware, or any 3rd party hosting service you like (e.g. AWS, Digital Ocean, Vultr, etc)
- This comprehensive VPS setup guide walks you through this process, using Vultr as your VPS host
- Your machine should have sufficient storage, bandwidth, and RAM, and be properly configured (ssh, ports, etc)
- Open DashCore
- Get a new masternode private key and address
- Menu: Tools > Debug console
- A new window should appear with the "Console" tab selected at the top
- Enter the following command in the input field at the bottom:
Dash$ masternode genkey
# Dash will output the result
Dash$ getaccountaddress <masternodeLabel> # <masternodeLabel> is a name of your choice, e.g. "masternode1", "MN01", etc.
# Dash will output the result
- Copy and label the two outputted strings of characters in the notes page you created for your IP address
- These will be referred to as <masternode-privkey> and <masternode-address> in later steps
You may fund your masternode address by sending dash from any wallet (e.g. Jaxx, Electrum, Poloniex, etc). These steps assume you are funding from DashCore itself. Either way, the wallet you are sourcing funds from must have 1000 DASH plus a little extra (~0.01 DASH) to cover the dash network fee.
- Open the 'Receiving addresses' dialog box (file > Receiving addresses)
- Click the Receiving address you made in step 3 (e.g. "MN01") and click the 'copy' button
- Click the Send tab on the main DashCore window (or your wallet of choice)
- Paste the address you copied on the 'Pay To' field, it should populate your label
- Enter '1000' in the 'Amount' field
- Don't include any miner fee in this amount; the wallet will automatically cover it
- The amount you actually send must be one transaction of exactly 1000 DASH
- No, you may not send more than 1000 DASH
- No, you may not send 999.99 DASH
- No, you may not put in 1 DASH first and then 999 DASH. It must be all at once. You may test the address first, but you will still need to send 1000 DASH later, all in one transaction
- No, even if you have 1000 DASH in the wallet already, that doesn't count. You must send 1000 DASH to your
<masternodeLabel>
address
- Click 'Send' to fund your masternode (you may use/check InstantSend for this)
- Click 'Transactions' in the main DashCore window. Your transaction should show "Payment to yourself"
While we are waiting for the needed 6 confirmations of our 1000 DASH transaction, we can now prepare the remote server.
- Log in to your VPS
Local$ ssh <login-user>@<ip.add.re.ss>
<password> # if needed
- If you changed your SSH port in step 3.5 of securing your VPS you may need to:
Local$ ssh -p <ssh-port-number> <login-user>@<ip.add.re.ss>
- You may also log in from your VPS cloud provider's console
- Optionally, create a new user on your VPS for all dash-related files and functions
VPS$ su <super-user>
<password>
VPS$ sudo adduser <dash-user> # this will be the assumed target for '~' from now on (cd ~ == cd /home/<dash-user>)
<super-users-password>
<newPassword>
<newPassword>
<otherFieldsAsDesired>
- Download, unpack, copy, and permission the needed applications/files on your VPS
VPS$ su <dash-user> # whatever user you want; <dash-user> if you created it above
VPS$ cd ~
VPS$ wget https://www.dash.org/binaries/dashcore-0.12.1.5-linux64.tar.gz
VPS$ tar xfvz dashcore-0.12.1.5-linux64.tar.gz # unpack files
VPS$ cp dashcore-0.12.1/bin/dashd dashd
VPS$ cp dashcore-0.12.1/bin/dash-cli dash-cli
VPS$ chmod 755 dashd # set permissions
- Create
dash.conf
file on your VPS
VPS$ cd ~
VPS$ mkdir .dashcore
VPS$ cd .dashcore
VPS$ nano dash.conf
# once open, insert the following text. Note: rpcuser and rpcpassword can be anything, you will not have to remember them later, feel free to go nuts on your keyboard
< # start of file contents
rpcuser=<anything-like-random-numbers-and-letters>
rpcpassword=<anything-like-random-numbers-and-letters>
rpcport=9998
rpcallowip=127.0.0.1
listen=1
server=1
daemon=1
maxconnections=24
masternode=1
masternodeprivkey=<masternode-privkey>
externalip=<ip.add.re.ss>
> # end of file contents, ctrl+x to exit, save as "dash.conf"
- Launch dashd on your VPS
VPS$ cd ~
VPS$ ./dashd # enter command, then wait ~15 seconds -- to stop dashd issue the command ./dash-cli stop
VPS$ ./dash-cli getinfo
- If you run the "getinfo" command several times you should see that the number of blocks is increasing
- The number of blocks must eventually catch up to the current blockchain before your masternode is active
- You can check if the number of blocks is up to the current height by comparing to the current number of blocks reported on one of the many Dash blockchain explorers (several are listed on the dash.org website)
- You don't need to wait for the blocks to completely sync; we may move on to the next step
We are done with the installation files, so those can be removed.
- Remove files as follows:
VPS$ cd ~
VPS$ ls
VPS$ rm dashcore-0.12.1.5-linux64.tar.gz
VPS$ exit # repeat to exit all the way out of VPS (into your local machine)
- Obtain data for
masternode.conf
- Open DashCore
- From the menu: Tools > Debug Console, then type the command:
Dash$ masternode outputs # values are listed as "hash":"index", copy them into your notes
- Create
masternode.conf
Local$ cd ~/Library/Application\ Support/Dashcore
Local$ nano masternode.conf
# this file may already exist
# if it does not nano will create it
# either way you will need to select a name/alias (e.g. "MNO1"
# reminder: your masternode/VPS ip address can be found using 'nano ~/.ssh/config'
# populate the file with the data obtained above in the following format:
< # start of file contents
MN01 <masternode-ip-address>:9999 <masternode-privkey> <txn-hash> <txn-output-index>
> # end of file contents, exit with ctrl+x, save the file
- You will need a separate line for each masternode in
masternode.conf
- You may add as many masternodes to the same wallet and
masternode.conf
as you wish
- Close DashCore
- Install prerequisites
VPS$ sudo apt-get update
VPS$ sudo apt-get install -y git python-virtualenv
- Install Sentinel
VPS$ cd .dashcore
VPS$ git clone https://github.com/dashpay/sentinel.git
VPS$ cd sentinel
VPS$ virtualenv venv # create virtual python environment. If this command fails try `sudo apt-get install -y virtualenv'
- Install dependencies, test setup
VPS$ venv/bin/pip install -r requirements.txt
VPS$ venv/bin/python bin/sentinel.py
If you see "dashd not synced with network! Awaiting full sync before running Sentinel", run dash-cli mnsync status
until you see:
{
"AssetID": 999,
"AssetName": "MASTERNODE_SYNC_FINISHED",
"Attempt": 0,
"IsBlockchainSynced": true,
"IsMasternodeListSynced": true,
"IsWinnersListSynced": true,
"IsSynced": true,
"IsFailed": false
}
-
Launch DashCore (this will use the new
masternode.conf
settings from step 7) -
Open a DashCore console session (Tools > Debug console)
-
Enter the following to activate your remote masternode
Dash$ walletpassphrase <your-wallet-passphrase> 120 # alternatively, Settings > Unlock Wallet. Password is the same you created to encrypt your wallet, also used when spending Dash. Dash$ masternode start-alias <alias-of-masternode-you-want-to-start>
-
You should get a response similar to:
Dash$ { "alias" : "MN01", "result" : "successful" }
-
Check your work by going back to your remote server and enter the following
Local$ ssh <login-user>@<ip.add.re.ss> VPS$ ./dash-cli masternode debug # look for success message VPS$ ./dash-cli masternode list full | grep <your MN IP address> # look for "ENABLED" in the returned text
- If it doesn't show "ENABLED", don't panic; the blockchain must fully download on the remote server before it becomes active
- You can check the status of the blockchain download by running
./dash-cli getinfo
until it's caught up to the current number of blocks - Once caught up, give it a minute and try again to see if it shows as "ENABLED"
If you still don't see "ENABLED" check your settings from your local DashCore wallet
Dash$ masternode list-conf # to see your masternode alias(es), make sure all settings are correct (see step 7)
Dash$ walletpassphrase <yourwalletpassphrase> 120
Dash$ masternode start-alias <alias>
Dash$ walletlock # to lock your wallet back up
Your masternode is set up and sentinel is installed. Now you just need to configure Sentinel to periodically run to keep your masternode alive, proving to the network that you are performing your job as required.
- Test Sentinel again
VPS$ cd .dashcore/sentinel
VPS$ venv/bin/python bin/sentinel.py # should return nothing but silence. This is how you know it's working.
- Create Cron job
VPS$ crontab -e
# add the following to the end of this file:
< # start of text to add
* * * * * cd /home/YOURUSERNAME/.dashcore/sentinel && ./venv/bin/python bin/sentinel.py 2>&1 >> sentinel-cron.log
> # end of text to add, exit with ctrl+x, save the file
- Final Test
Local$ ssh <login-user>@<ip.add.re.ss>
VPS$ ./dash-cli masternode debug # look for success message
VPS$ ./dash-cli masternode list full | grep <your MN IP address>
If you see ENABLED
still then you're done. Celebrate!