Setting up a Masternode
1. In the wallet software “DMS Core” on your local computer
- You will need a DMS address in your wallet with a balance of at least 5000.1 DMS. This is required for the masternode collateral and transaction fees. Copy the address to the clipboard.
- Please open the Masternodes tab page. If it is not visible, first select the menu command and activate Wallet | Show Masternode Tab.
- Click on the Deploy Masternode mouse button.
- Activate the Create Collateral Transaction option, to create the payout address and transfer 5,000 DMS collateral to it.
- Please confirm by clicking Yes.
- In the following dialog the masternode IP is requested. Enter the IPv4 with port, for example “220.127.116.11:41319”. Click on OK.
- As the fund address, paste the previously copied address with min. 5,000.1 DMS and click OK.
- Confirm the final prompt “send protx”, the provider transaction will now be sent.
- In the confirmation dialog, check Show dms.conf suggestion and click OK.
- Please leave the last dialog box with the dms.conf open or copy the content to a text file.
Open the Github website and copy the link to the latest Linux release to the clipboard. This will be used at “wget” below.
2. On the VPS
Connect with an SSH client to your Virtual Private Server and enter the following commands into the Linux console:
- mkdir dms
- cd dms
- wget https://github.com/Krekeler/documentchain/releases/download/v0.17.0.3/dmscore-0.17.0-x86_64-linux-gnu.tar.gz (replace the URL with the latest release)
If a certificate error occurs: apt-get install ca-certificates
- tar -xzf dmscore-0.17.0-x86_64-linux-gnu.tar.gz
- rm dmscore-0.17.0-x86_64-linux-gnu.tar.gz
- ./dmsd -daemon
- Wait a moment, the data directory ~/.dmscore is created.
- killall dmsd
- Check the firewall status: ufw status
- If you are running a firewall, please open port 41319: ufw allow 41319/tcp
Adapt the configuration file dms.conf. For this, note the last dialog in your local wallet: the lower block is the proposal for your dms.conf. “rpcuser” and “rpcpassword” you should change. “externalip” is the IP of the VPS followed by port 41319. “addnode” is possible, but not required. The addresses of some masternodes are hard-coded.
- nano ~/.dmscore/dms.conf
As a template, you can copy the example file to the clipboard and paste it into nano with the right mouse button. Save the file with Ctrl+O and close nano with Ctrl+X. Of course you can also use another editor than nano.
- Tip: download option for faster synchronization of the blockchain.
- ./dmsd -daemon
- ./dms-cli getinfo to verify that the daemon is running.
- The daemon is now syncing with the blockchain, which may takes some time. Initially only the headers will be synchronized, you will not see any progress for the first two or three hours. You can enter ./dms-cli mnsync status to get the synchronization status.
3. Set up automatic service start on VPS (optional)
Your provider will probably restart the VPS occasionally. To run dmsd automatically afterwards, you can create a service unit or set a cron job:
- crontab -e
- Add the line:
* * * * * pidof ~/dms/dmsd || ~/dms/dmsd –daemon
4. Set up fail2ban on VPS (optional)
For security reasons you should install fail2ban. This will prevent mass login attempts with randomly guessed passwords.
- apt install fail2ban
- vi /etc/fail2ban/jail.local
- Adapt the sample file shown below and copy the content to the editor. Save and exit editor.
- systemctl restart fail2ban
- systemctl enable fail2ban
enabled = true
port = 22
filter = sshd
logpath = /var/log/fail2ban.log
maxretry = 5
5. Possibly mining
Does the computer have at least 2 virtual CPU and sufficient system resources? If so, then you can use the wallet to mine coins:
dms/dms-cli setgenerate true 1
For a rented server, please check if the provider agrees. If you renting an expensive server, mining on 1 or 2 CPU will probably be ok. At a VPS for $1 each month, the provider will not calculate with a 100% CPU usage. Often, mining is even explicitly disallowed.
Tip: Weak mining. The parameter setgenerate true -2 or -3 pauses after each calculation. The system uses only a small part of one virtual CPU.
Check the masternode status in your local wallet regularly. Reactivate it when the status is “POSE_BAN”:
- Check the VPS, is it online and is dmsd running (enter pgrep dmsd)?
- Send a Provider Update Service Transaction: In the local wallet, right-click on the corresponding mastenode and select the menu command of the same name.