Took me some time to set up few masternodes. Below is a complete guide how to set them up on Ubuntu VPS and local Windows wallet.
Deploy Ubuntu 16.04 VPS and do the following:
# --------------------------
# 1. Install dependencies
# --------------------------
sudo apt -y update && sudo apt -y install build-essential libssl-dev libdb++-dev libboost-all-dev libcrypto++-dev libqrencode-dev libminiupnpc-dev libgmp-dev libgmp3-dev autoconf autogen automake libtool autotools-dev pkg-config bsdmainutils software-properties-common libzmq3-dev libminiupnpc-dev libssl-dev libevent-dev
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev -y
# --------------------------
# 2. Clone repo
# --------------------------
git clone https://github.com/sucremoneda/SucreCore.git
git clone https://github.com/dashpay/dash.git
To fix the bug remove ~/SucreCore/src/secp256k1:
rm -rf ~/SucreCore/src/secp256k1
Copy secp256k1 from dash repo
cp -r ~/dash/src/secp256k1 ~/SucreCore/src/secp256k1
# --------------------------
# 3. Build sucre
# --------------------------
cd SucreCore
find . -name "*.sh" -exec sudo chmod 755 {} \;
./autogen.sh
./configure
make
# --------------------------
# 4. Run sucrd daemon
# --------------------------
~/SucreCore/src/sucrd -daemon
# --------------------------
# 5. Stop sucrd daemon
# --------------------------
~/SucreCore/src/sucr-cli stop
# --------------------------
# 6. Edit config file
# --------------------------
vi ~/.sucrcore/sucr.conf
rpcuser=USERNAME
rpcpassword=PASSWORD
addnode=45.76.32.90
addnode=188.166.44.128
addnode=128.199.180.97
# --------------------------
# 7. Start sucrd
# --------------------------
~/SucreCore/src/sucrd -daemon
# --------------------------
# 8. Check last block synced
# --------------------------
~/SucreCore/src/sucr-cli getmininginfo
{
"blocks": 0,
"currentblocksize": 0,
"currentblocktx": 0,
"difficulty": 0.000244140625,
"errors": "",
"genproclimit": 1,
"networkhashps": 0,
"pooledtx": 0,
"testnet": false,
"chain": "main",
"generate": false
}
# --------------------------
# 9. Generate private key on VPS
# --------------------------
~/SucreCore/src/sucr-cli masternode genkey
# MASTERNODE_PRIVATE_KEY will be generated
# --------------------------
# 10. On Windows wallet open the console
# --------------------------
getaccountaddress MASTERNODE_1
# --------------------------
# 10. Send 1000 SUCR to the address above and wait for 15 confirmations
# --------------------------
# --------------------------
# 11. Update your sucr.conf file on VPS
# --------------------------
vi ~/.sucrcore/sucr.conf
rpcuser=USERNAME
rpcpassword=PASSWORD
rpcallowip=127.0.0.1
rpcconnect=127.0.0.1
rpcport=9918
port=9336
listen=1
server=1
daemon=1
logtimestamps=1
maxconnections=256
masternode=1
externalip=VPS_IP_ADDRESS
bind=VPS_IP_ADDRESS:9336
masternodeprivkey=MASTERNODE_PRIVATE_KEY
addnode=45.76.32.90
addnode=188.166.44.128
addnode=128.199.180.97
# ------------------------------------------------------------------------------
# 12. Install sentinel
# ------------------------------------------------------------------------------
sudo apt-get install -y virtualenv
cd
cd .sucrcore
git clone https://github.com/dashpay/sentinel.git
cd sentinel
virtualenv venv
venv/bin/pip install -r requirements.txt
Edit sentinel.conf
vi ~/.sucrcore/sentinel/sentinel.conf
PASTE below into sentinel.conf file
dash_conf=~/.sucrcore/sucr.conf
network=mainnet
db_name=database/sentinel.db
db_driver=sqlite
Stop sucrd
~/SucreCore/src/sucr-cli stop
Start sucrd
~/SucreCore/src/sucrd -daemon
If see error: "Error: Cannot obtain a lock on data directory ~/.sucrcore. Sucr Core is probably already running.":
ps axwuu | grep sucr
sudo kill -9 23511
~/SucreCore/src/sucr-cli getinfo
~/SucreCore/src/sucr-cli masternode status
# {
# "outpoint": "0000000000000000000000000000000000000000000000000000000000000000-xxxxxx",
# "service": "[::]:0",
# "status": "Node just started, not yet activated"
# }
~/SucreCore/src/sucr-cli mnsync status # UNTIL SYNCS LIKE BELOW
{
"AssetID": 999,
"AssetName": "MASTERNODE_SYNC_FINISHED",
"AssetStartTime": 1512118746,
"Attempt": 0,
"IsBlockchainSynced": true,
"IsMasternodeListSynced": true,
"IsWinnersListSynced": true,
"IsSynced": true,
"IsFailed": false
}
Run sentinel
~/.sucrcore/sentinel/venv/bin/python ~/.sucrcore/sentinel/bin/sentinel.py
Set up cronjob
crontab -e
# PASTE to the file
* * * * * cd ~/.sucrcore/sentinel && ./venv/bin/python bin/sentinel.py >/dev/null 2>&1
# --------------------------
# 13. On Windows Wallet console
# --------------------------
masternode outputs
{
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1": "1", # MASTERNODE_1
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2": "0" # MASTERNODE_2
}
On Windows edit masternode.conf file:
#LABEL PUBLICIP:PORT MASTERNODEKEY COLLATERALTX INDEX
MASTERNODE VPS_IP_ADDRESS:14520 MASTERNODE_PRIVATE_KEY TX 1
MASTERNODE01 VPS_1_IP_ADDRESS:9336 MASTERNODE_1_PRIVATE_KEY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1 1
MASTERNODE02 VPS_1_IP_ADDRESS:9336 MASTERNODE_2_PRIVATE_KEY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2 0
On Windows wallet console start masternode:
walletpassphrase "your wallet passphrase" 120
masternode start-alias MASTERNODE_1
masternode start-alias MASTERNODE_2
root@ubuntu:~/.sucrcore/sentinel# Error: Cannot obtain a lock on data directory /root/.sucrcore. Sucr Core is probably already running.
root 8243 5.7 4.3 1302132 90368 ? SLsl 03:10 1:04 /root/SucreCore/src/sucrd -daemon
root 8754 0.0 0.0 12948 932 pts/0 S+ 03:29 0:00 grep --color=auto sucr
root@ubuntu:~/.sucrcore/sentinel# Error: Cannot obtain a lock on data directory /root/.sucrcore. Sucr Core is probably already running.