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.

Note: Ubuntu 17.10 (Artful Aardvark) doesn’t seem to work as of this moment, needs more testing. (thanks CryptoTony3 for reporting!) So use CentOS7 or Ubuntu 16.04.

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 9999. 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 9999/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 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-Official/archive/v1.12.0.62.tar.gz

Extract the tarball:

tar zxf v1.12.0.62.tar.gz
cd Curium-Official-1.12.0.62

Prepare some files and build the core client:

chmod +x share/genbuild.sh autogen.sh src/leveldb/build_detect_platform
./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:

curiumd

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

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

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

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

vi ~/.curium/curium.conf

Add the following lines:

rpcuser=RPCUSER_FROM_PREVIOUS_STEP
rpcpassword=RPCPASSWORD_FROM_PREVIOUS_STEP
rpcallowip=127.0.0.1
rpcport=9998
listen=1
server=1
daemon=1
port=9999
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:

curiumd

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 (curium-qt-1.12.0.61-windows.exe) from GitHub here.

Create a folder called “Curium” anywhere on your computer, whatever place you prefer and move the windows client to that folder.

Open the client, by double clicking the executable. You might see this screen after double clicking:

unknown.png (534×499)

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

Start the client. When it’s the first time, it will show you this screen:

Select “Use a custom data directory” and fill in “.\data” as shown in the image above, then click “OK“. (All wallet related files will be saved in here)

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 1000 CRU (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 1000 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 1000 CRU, like so:

getnewaddress "MN2"

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

walletpassphrase "passphrase" 30
sendtoaddress NEW_WALLET_ADDRESS 1000

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 1000 CRU collateral

Close the Windows wallet and Open the file curium.conf in the curium data folder, and copy paste the RpcUser and RpcPassword lines into the file:

rpcuser=RPCUSER_FROM_PREVIOUS_STEP
rpcpassword=RPCPASSWORD_FROM_PREVIOUS_STEP

Save the file.

Create a file masternode.conf in the curium data folder, and add this line:

MN1 IP:9999 MasterNodePrivKey TxID OutputId

Where:

  • MN1 – The label I gave the collateral wallet in the “getnewaddress” command.
  • IP:9999 – 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 the file.

Tying it all together

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

vi ~/.curium/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:

curium-cli stop

And start it again with:

curiumd

The masternode is now ready.

Start the Windows wallet application and unlock your wallet:

Settings -> Unlock Wallet…

Then go to your debug console:

Tools -> Debug console

Type the command:

masternode start-alias MN1

Note: “MN1” is the label of the masternode we gave it in the masternode.conf file.

The command should return:

{

“alias” : “MN1”,

“result” : “successful”

}

In the debug console, type:

masternode list

Your node should be in the list, you should see your txId in the list.

Congratulations, you now have a masternode running.

For good measure, this is what you should now have set up:

Verifying if it all works

On the windows wallet, in the debug console, type:

masternode list-conf

It should show the config and “status” should be set to “ENABLED”.

masternode list

Your TxId should be in that list, followed by “ENABLED”.

On the VPS masternode, type:

curium-cli masternode status

It should return something that looks like this:

{
 "vin" : "CTxIn(COutPoint(TxId, OutputId), scriptSig=)",
 "service" : "IP:9999",
 "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.

curium-cli masternode list | grep TxId

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

What doesn’t work (and often people think works):

  • Typing “masternode debug” on the windows wallet. It’s not a masternode!
  • Using any of the “masternode start-*” command on the vps. The masternode is started remotely, by the windows wallet!

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 30 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: CfmDs6G9niJ7ntkPcWwtnozUna7EGAtyhQ
BTC: 14DoaCLsaPr1GoA8UsF7a9tRzVWeJvbHWQ
ETH: 0x8b1accec02abe410ca7fed485a39f5ba9868cf60
BTC: qrmjrfqel34drtpkesj67mux3xeuefvk550fjfgwtt
LTC: LVepk1RjtwEHEMUYKMkGsKKzYaK2U7MPzb

Thank you!

External links

Leave a Reply

Your email address will not be published.

*