Curium masternode setup – Cold wallet Windows and Linux

Masternode setups can be tricky. With this cold wallet setup, we run going to run the masternode with an empty wallet. The wallet with the actual collateral coins will be located on a different computer (this can be your Windows, Mac or Linux workstation. Anywhere else but the masternode itself will do).

This how-to will help you set-up a Curium masternode. The masternode on Linux and the wallet on Windows. Before we start, I’m assuming you have a vps server up and running somewhere, with enough disk-space, memory and root access.

Preparing the master node

First become root user, then continue.

Memory management

If you have 1GB of memory (or even less) on your VPS, you need to create a swap file. Else building the core wallet will fail. You can create a swapfile with these commands:

fallocate -l 3G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo -e "/swapfile none swap sw 0 0 \n" >> /etc/fstab

Now you have a file “/swapfile” which functions as extra memory in case your vps needs more then 512MB.

Setup firewall

If you already have firewall software up and running, make sure to allow incoming TCP traffic on port 18745. If you do not have a firewall, it’s highly recommended to set one up.

Here are the basics for just SSH and the masternode connection:

If you have CentOS:

yum install ufw

If you have Ubuntu/Debian:

apt-get install ufw

Now execute the following command in this exact order, else you might lock yourself out of the vps.

ufw allow ssh/tcp
ufw limit ssh/tcp
ufw allow 18745/tcp
ufw logging on
ufw enable

Press “y” when a confirmation is asked.

Install libraries

If you have CentOS:

yum upgrade
yum install epel-release
yum install autoconf automake gcc-c++ libdb4-cxx libdb4-cxx-devel boost-devel openssl-devel wget

If you have Ubuntu/Debian:

add-apt-repository ppa:bitcoin/bitcoin
apt-get update
apt-get install pkg-config build-essential autoconf automake libtool libboost-all-dev libevent-dev libgmp-dev libssl-dev libcurl4-openssl-dev libdb4.8-dev libdb4.8++-dev wget

Create user

Create a user to run the daemon with:

adduser curium

Install core wallet

Become user curium and download the latest “Source code (tar.gz)” from GitHub here.

su - curium
wget https://github.com/curiumofficial/curium/releases/download/v1.0.1/curium-1.0.1.tar.gz

Extract the tarball:

tar zxf curium-1.0.1.tar.gz
cd curium-1.0.1

Prepare some files and build the core client:

./autogen.sh
./configure --prefix=$HOME --disable-tests --disable-gui
make
make install

The curium core client is now installed in the homedir of the user curium and we can continue on preparing the masternode.

We’ve installed curium in ~/bin, to add this to the path, Ubuntu already made preparations, run:

source ~/.profile

Run the daemon with the following command:

curiumnd

It will show a message that it’s missing the initial curium.conf file.

“Error: To use curiumnd, or the -server option to curiumn-qt, you must set an rpcpassword in the configuration file:
/home/curium/.curiumcru/curium.conf”

Copy the “rpcuser” and “rpcpassword”, you need them in a few other steps.

Create the file ~/.curiumcru/curium.conf with an editor:

vi ~/.curiumcru/curium.conf

Add the following lines:

rpcuser=RPCUSER_FROM_PREVIOUS_STEP
rpcpassword=RPCPASSWORD_FROM_PREVIOUS_STEP
rpcallowip=127.0.0.1
rpcport=11772
listen=1
server=1
daemon=1
port=18745
maxconnections=256
masternode=0
masternodeprivkey=

To save and close the file, type “:wq”.

Start the daemon so it can being synchronizing the block-chain, run:

curiumnd

Leave it running and in the mean time we’re going to set-up the cold wallet containing the collateral on your Windows desktop.

Creating the cold wallet on Windows

Installation of the wallet

Download the latest version of the windows client from GitHub here.

Extract the zip file on your computer, whatever place you prefer.

Open the client (it’s in the “bin” folder), by double clicking the executable. You might see this screen after double clicking:

Press “More info” and then click “Run anyway“. (This is only needed once)

Start the client. Leave default datadir location.

The wallet is being loaded. After some time, you’ll see the main window:

Synchronizing the block-chain

On the bottom of the window, you’ll see a message saying the wallet is synchronizing with the network. It’s synchronizing the block-chain information with your local wallet, so it is up to date with the rest of the network. Depending on your network speed, this will take 10 to 30 minutes.

When the check-sign is shown in the bottom right corner, the synchronization is completed.

Initial wallet configuration

Go to:

File -> Receiving addresses…

Double click on “(no label)” and give your local wallet address a name. Press “OK” when ready. (This can be anything you want so you know which wallet this is. This wallet will be your “default use” wallet (not your MN wallet).)

Safety first! So we’re going to encrypt this wallet, go to:

Settings -> Encrypt Wallet…

Enter a strong password. The best would be a so called “mnemonic passphrase” (a list of words). Save your passphrase in a password manager, or print it on paper and keep it somewhere safe. If you lose this passphrase, you’ll lose access to your wallet and all your coins are lost.

Press “OK“.

Press “Yes“.

Encryption is taking place. The wallet may become unresponsive for several seconds. This is perfectly normal, so don’t start mashing buttons. Please wait until the application closes itself.

Create the masternode wallet

Start the wallet again and go to:

Tools -> Debug console

Create a new wallet address to hold the collateral:

getnewaddress "MN1"

Send exactly 10000 CRU (ten thousand) collateral to the address you’ve just created and wait for at least 15 confirmations. (Take into consideration that you’re paying a small fee, so make sure you send enough CRU to pay the fee and still have exactly 10000 CRU left.)

Generate a masternode key:

masternode genkey

Write down the masternode key, you need it later.

Retrieve the transaction Id and output Id:

masternode outputs

It will show you something like this:

{
b8298be868216507ae23c10440cfa9b699018f0bc043b91c6d96fe1d2c41bae7“: 0
}

Write down the transaction Id and the output Id, you need it later.

!!!! If you get an empty response, do this, else skip !!!!

Create a new wallet address and re-send 10000 CRU, like so:

getnewaddress "MN2"

(Use this label in all future steps where a label is needed.)

walletpassphrase "passphrase" 30
sendtoaddress NEW_WALLET_ADDRESS 10000

The application will say something like making a “Payment to yourself”. Wait for 1 confirmation, then check outputs again with:

masternode outputs

You should now see the transaction Id and output Id, write it down, you need it later.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

If done correctly, we have the following data collected:

  • RpcUser – From the vps curium.conf.
  • RpcPassword – From the vps curium.conf.
  • MasterNodePrivKey – a masternode private key
  • TxId – a transaction Id (txid)
  • OutputId – the output Id
  • We have a wallet containing 10000 CRU collateral

Go to:

Tools -> Open Wallet Configuration File

Copy paste the RpcUser and RpcPassword lines into the file:

rpcuser=RPCUSER_FROM_PREVIOUS_STEP
rpcpassword=RPCPASSWORD_FROM_PREVIOUS_STEP

Save the file and close it.

Go to:

Tools -> Open Masternode Configuration File

MN1 IP:18745 MasterNodePrivKey TxID OutputId

Where:

  • MN1 – The label I gave the collateral wallet in the “getnewaddress” command.
  • IP:18745 – The external IP address of your vps and the port number.
  • MasterNodePrivKey – The private key from the “masternode genkey” command.
  • TxId – The transaction Id from the “masternode outputs” command.
  • OutputId – The output Id from the “masternode outputs” command.

Save and close the file.

Restart your wallet.

Tying it all together

Go back to your VPS and open the file ~/.curiumcru/curium.conf.

vi ~/.curiumcru/curium.conf

Change the “masternode” and “masternodeprivkey” line, like so:

masternode=1
masternodeprivkey=THE_MASTERNODE_PRIVATE_KEY

Where:

  • THE_MASTERNODE_PRIVATE_KEY – The private key from the “masternode genkey” command.

To save and close the file, type “:wq”.

Stop the daemon with:

curiumn-cli stop

And start it again with:

curiumnd

The masternode is now ready.

Start the Windows wallet application and go to the debug console, in it type:

startmasternode alias 0 <alias>

You should receive a confirmation that 1 masternode was started.

(Note: Yes, there are start buttons in the masternode tab, but those turn out to be buggy, so start the node via the debug console)

Go to the masternodes tab, your masternode should now have status “ENABLED”.

Congratulations, you now have a masternode running.

Verifying if it all works

In the windows wallet:

In the masternodes tab, your node should show status “ENABLED”.

On the VPS masternode:

curiumn-cli masternode status

It should return something that looks like this:

{
 "vin" : "CTxIn(COutPoint(TxId, OutputId), scriptSig=)",
 "service" : "IP:18745",
 "pubkey" : "Your collateral wallet address",
 "status" : "Masternode successfully started"
}

Your masternode has knowledge of your collateral wallet, whilst we didn’t even gave it the wallet address anywhere on the vps, that’s a good sign. This means it received that information from your windows client, because of the matching masternode private key.

curiumn-cli masternode list | grep TxId

This should return a line containing your TxId and followed by “ENABLED”.

Possible issues

The command “curium-cli masternode status” shows all zeros in the vin parameter.

"vin" : "CTxIn(COutPoint(TxId, OutputId), scriptSig=)",

Most likely you’ve started the masternode to soon. There need to be at least 15 confirmations on the blockchain before you can start the masternode.

Donate

Did you find this guide helpful? Show some appreciation by sending some coins to:

CRU (new): RFvcV9goU4AM11eeVdQ78yoiKevL6vTg85

Thank you!

External links

Leave a Reply

Your email address will not be published.

*