Create a masternode for crypto currency BEAR - voytek

Posted on Sun 24 February 2019 in cryptocurrency

Prepare the server

Prerequisites

We start with a VPS server recently installed unser CentOS 7 minimal version.

Server installation

We update the operating system:

yum update

We install EPEL :

yum install epel-release
yum update

We install the dependencies required by voytek:

yum install zeromq boost libdb4-cxx miniupnpc openssl net-tools

We get the 3 files voytek compilated on CentOS 7 (See article https://david.durieux.family/compile_cryptocurrency_bear_voytek_centos7_masternode.html)

You can get the files for CentOS 7 (version 1.1.1) on my server with commands:

wget "https://david.durieux.family/voytek-cli"
wget "https://david.durieux.family/voytek-tx"
wget "https://david.durieux.family/voytekd"

Verify the checksum of these 3 files are same than:

# sha512sum voytek-cli 
81508fa95d31b41975569aa9adc71b10ae33252d009248ce99a7b8f89162ed54f14d62910bd9549bed698e3018c05a867603a04cac60ed400f8f8052ce6f8225  voytek-cli
# sha512sum voytek-tx  
bc204aca93179edb7fe00ad495973cbcabe010e674fe6cc710d1a81a03303b3fe706b4859e903324ba8a163a0bf248189316fa4f2c4efe74b17d71f796b805fc  voytek-tx
# sha512sum voytekd  
ace5d9dccab5e0cd5d6b2644afacf14a73bf473b93187ec7f815e515f9720b5ce71b393ecb7823123a9ae7173df6756fcc9637564a864f11426c6831cea71f60  voytekd

We start the daemon voytekd and it will create the tree structure in folder ~/.voytek/:

./voytekd

This command return a message like:

/root/.voytek/voytek.conf
It is recommended you use the following random password:
rpcuser=voytekrpc
rpcpassword=9sSfNL1ofXcyHdujb8JKSG86nkz2SzyfQeLWvbkePic1
(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 "Voytek Alert" admin@foo.com

Open the file ~/.voytek/voytek.conf and put inside:

server=1
listen=1
daemon=1
#masternode=1
rpcuser=voytekrpc
rpcpassword=9sSfNL1ofXcyHdujb8JKSG86nkz2SzyfQeLWvbkePic1
rpcallowip=127.0.0.1
#externalip=
#masternodeaddr=:17171
#masternodeprivkey=

Next, we restart voytekd:

./voytekd

If all is ok, we have the message:

Voytek server starting

Now, we're waiting the blockchain is uptodate, to see that, we must have the key verificationprogress with a value > 0.99990000 with the command:

./voytek-cli getblockchaininfo

Start voytekd when the server VPS start

To have voytekd started when the server start, we create a file /etc/systemd/system/voytekd.service and put inside:

[Unit]
Description=Voytek crypto currency daemon
After=network.target

[Service]
User=root
Group=root
ExecStart=/root/voytekd -conf=/root/.voytek/voytek.conf -pid=/run/voytekd/voytekd.pid
Type=forking
PIDFile=/run/voytekd/voytekd.pid
#Restart=on-failure

# Provide a private /tmp and /var/tmp.
PrivateTmp=true

# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full

# Disallow the process and all of its children to gain
# new privileges through execve().
NoNewPrivileges=true

# Use a new /dev namespace only populated with API pseudo devices
# such as /dev/null, /dev/zero and /dev/random.
PrivateDevices=true

# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true


[Install]
WantedBy=multi-user.target

And we reload systemd:

systemctl daemon-reload

And to finish, we activate the service at startup:

systemctl enable voytekd

The server is ready.

Create and configure a masternode

Prerequisites

We have 2 instances called:

  • vpsmns : masternode voytek on the VPS
  • mywallet : wallet voytek on your computer

Configuration on the wallet

We configure our masternode on mywallet.

We generate a masternode key:

./voytek-cli masternode genkey

We generate a wallet address for our masternode (with the name of your masternode, here we use mn1):

./voytek-cli getaccountaddress "mn1"

We backup the outputs:

./voytek-cli masternode outputs > out1

We transfer 10000 BEARs to the masternode wallet address (created above):

./voytek-cli sendtoaddress xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 10000

We backup the outputs:

./voytek-cli masternode outputs > out2

We get the output of our masternode:

diff -u out1 out2

This command give use something like:

+        "txhash" : "hpz6pou8pyqiq2h3ty5mefxtxs2aub47o2vixtznz2ryrsnd6c6pukfdhijtpady",
+        "outputidx" : 0
+    },
+    {

We open the file ~/.voytek/masternode.conf and add on it:

mn1 54.37.124.23:17171 32pi9pjf4qe6v6rh4gmurmgmajqmbefvgz89urwd6hc72een832 hpz6pou8pyqiq2h3ty5mefxtxs2aub47o2vixtznz2ryrsnd6c6pukfdhijtpady 0

either:

masternodename ipaddress:17171 masternodekey txhash outputidx

We stop voytekd:

./voytek-cli stop

And after some seconds, we restart:

./voytekd

Masternode configuration

We will configure our masternode on vpsmns.

We edit the file ~/.voytek/voytek.conf, and the lines:

#masternode=1
#externalip=
#masternodeaddr=:17171
#masternodeprivkey=

to replace by (replace the IP 4.5.6.7 by the public IP of your VPS server)

masternode=1
externalip=4.5.6.7
masternodeaddr=4.5.6.7:17171
masternodeprivkey=32pi9pjf4qe6v6rh4gmurmgmajqmbefvgz89urwd6hc72een832

We stop voytekd:

./voytek-cli stop

And after some seconds, we restart:

./voytekd

Activation of the masternode from your wallet

We will activate the masternode on mywallet.

./voytek-cli startmasternode alias false "mn1"

Final start of the masternode

We start our masternode on vpsmns.

It can make time (many minutes) before the command works:

./voytek-cli startmasternode local false

To check if our masternode is started:

./voytek-cli masternode status

Need a second masternode?

If you need to have a second masternode (or more), you need follow this article from the beginning and change the name of the masternode.