

Welcome to the masternode setup guide, in this guide we will explain all the steps necessary to install a LUX masternode. We recommend everyone to install their masternode “cold” which means that the masternode collateral is not online and therefore much safer.
Disclaimer
When performed correctly, this should pose no risk to your virtual coins. Luxcore will not be responsible for any incorrectly performed actions or steps that may result in any losses of any kind. Please refer Luxcore Terms &Conditions here
Help needed ?
If you need any assistance executing this guide, please visit us on Discord here. We have moderators on 24/7 that will assist you.
VPS initial setup
Prerequisites:
- Ubuntu v16.04.x VPS with 1 CPU / 1GB MEM / 25gb SSD
- Putty SSH Client (https://www.putty.org/)
Reset root password
Log into the VPS with root and change the root password for your own protection.
passwd root


Create luxadmin user
Create the luxadmin user. Do NOT use the same password as root !!
adduser luxadmin


Give the luxadmin user sudo permissions
The luxadmin user needs sudo permissions.
usermod -aG sudo luxadmin


Update the Operating System
Make sure the Operating System is updated properly.
apt update


apt upgrade -y


Now reboot the VPS
reboot


Login as luxadmin and install fail2ban
Login to your VPS using putty (ssh) and install fail2ban, this protects your VPS against brute force attacks.
sudo apt install fail2ban -y




Disable SSH login for root
In this step we disable SSH access for the root account
sudo nano /etc/ssh/sshd_config


Change “PermitRootLogin” from “prohibit-password” to “no”
Press “ctrl-x” and answer “y” to save the configuration.
Restart sshd and test root login
Now we restart sshd to activate the configuration.
sudo systemctl reload sshd


To verify we have changed the configuration successfully, try to login with root through SSH using putty. This should fail.


Install & Configure firewall
To protect the system from attacks, we will only open the ports we need and firewall all other ports.
sudo apt install ufw && sudo ufw allow ssh && sudo ufw allow 26969 && sudo ufw deny 26868 && sudo ufw deny 16969 && sudo ufw deny 26888 && sudo ufw deny 16868 && sudo ufw deny 16120 && sudo ufw enable


Add swapfile
To ensure we have enough memory to compile the daemon, we add 4gb swap.
sudo fallocate -l 4G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile && sudo cp /etc/fstab /etc/fstab.bak && echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab && free –h


Now reboot the VPS again.
reboot
![f08281d-image012[1].png](https://files.readme.io/5c33fc4-f08281d-image0121.png)

Installing dependencies and compiling daemon
In this chapter we will install the required dependencies and compile the LUX daemon.
Download and unpack the source code
Browse to https://github.com/LUX-Core/lux/releases to copy the link to the latest source code.


Now login to your vps and download the source code.
wget copiedgithublink


Unpack the source code:
mkdir -p lux && tar xf tarfilename -C ./lux --strip-components=1


Make files executable and install dependencies
First step is to make all the .sh files executable:
sudo find lux/ -type f -iname "*.sh" -exec chmod +x {} ;


Now enter the lux directory:
cd lux/


Now we need to install the dependencies (this will take a few minutes):
sudo sh ./depends/install-dependencies.sh




Compile the executables
Now we need to compile the executables, depending on your VPS speed, this can take a while (1-5 hours).
sudo ./autogen.sh && sudo ./configure --disable-tests --without-gui && sudo make clean && sudo make -j$(nproc)




Place the executables in your home directory
Now we place the executables we just compiled in the root of the luxadmin home directory
cd /home/luxadmin


cp lux/src/luxd .


cp lux/src/lux-cli .


Create lux.conf
Now we will setup the lux.conf, on linux this is done in the .lux directory (comparable to %appdata%\lux on windows).
mkdir ~/.lux


nano ~/.lux/lux.conf
Copy paste the below configuration:
#--------------------LUXCORE--------------------------------------------------------------------------------
rpcuser=pleaseuseacomplexusername #please use a complex username
rpcpassword=pleaseusealongcomplexpassword #please use a long complex password
rpcallowip=127.0.0.1
#--------------------LUXCORE--------------------------------------------------------------------------------
listen=1
server=1
daemon=1
maxconnections=100
#--------------------LUXCORE--------------------------------------------------------------------------------
externalip=x.x.x.x #this is your vps external ip address
#masternodeprivkey=YOU-WILL-REPLACE-THIS-LATER
staking=0
#masternode=1
bind=x.x.x.x #this is your vps external ip address
masternodeaddr=x.x.x.x:26969 #please replace the x.x.x.x with your vps external ip
port=26969
#--------------------LUXCORE--------------------------------------------------------------------------------


Change the x.x.x.x with the external IP address of your VPS
Change the rpcuser/rpcpassword to a unique and complex username and password
Save the file by pressing “ctrl-x” and answering “y” when asked to save the file
Start the LUX daemon
Now we start the LUX daemon and have it sync fully.
./luxd


Use the following command to check progress:
./lux-cli getinfo| grep blocks


We will wait for the sync to complete and will return to it later. Refer to https://explorer.luxcore.io/ for the latest block number.
Setup Windows QT wallet
In this chapter we will setup your Windows QT cold staking wallet, this guide assumes you have a QT wallet installed/encrypted and fully synched with the network. If you do not, please refer to the Windows QT user guide here
Generate masternode key and address
In this step we generate the key that will tell your daemon that the cold MN address collateral exists. This key does not allow anyone to touch the collateral.
Go to the debug console


masternode genkey


Save this key in a notepad, now generate the MN address:
getaccountaddress luxcoldmn1


Save the masternode address in a notepad aswell. This is your masternode public address and all masternode rewards will be send to this address. This is also the address you will send the 16120 LUX collateral to.
BACKUP !!
Now take your time to backup the wallet.dat (preferable to multiple locations) and save the private key of the masternode address we just generated securely (and preferably offline).
Dump the private key of the luxcoldmn1 address we just generated:
dumpprivkey
![38c44ab-QT_Wallet_dumpprivkey[1].png](https://files.readme.io/dd171f3-38c44ab-QT_Wallet_dumpprivkey1.png)

Configure QT wallet lux.conf
Now we will configure the QT wallet to disable staking to avoid accidental staking (this would stop your masternode from functioning).
Open the Wallet Configuration File


This opens the lux.conf, it should be completely empty. Add “staking=0”.


Now save and close notepad


Fund the masternode address
Now we will fund the address we created (AND BACKED UP !) earlier. The funding has to be done in 1 transaction of 16120 LUX.


Confirmation screen:


If you funded the masternode from the same wallet, the transaction looks like this:


Wait for the transactions to have a few confirmations, then proceed.
Get masternode transaction hash
Open the debug console again and type
masternode outputs


This is the txid of your masternode collateral, this is confirmation your masternode is funded. Save the output to notepad.
Complete the masternode configuration (QT)
Go to tools -> Open Masternode Configuration File


Now we configure the masternode file:


Alias: the alias used (luxcoldmn1)
x.x.x.x: external IP address of your masternode
masternodeprivkey: This is the key we generated with masternode genkey
collateral_output_txid: The large string we generated with masternode outputs
collateral_output_index: The number we generated with masternode outputs (can be 0 or 1)
After completing the configuration, save and close notepad. And restart the QT wallet.
Finalizing the masternode setup
In this chapter we finish the configuration and start the masternode.
Check daemon progress
Open your putty (reconnect if needed) and check progress on the vps:
./lux-cli getinfo| grep blocks


Verify on the explorer if your masternode is in sync:


In this example the masternode is in sync, if it is behind, please wait.
Configure the lux.conf on the VPS
Now we configure the lux.conf on the vps:
./lux-cli stop


nano ~/.lux/lux.conf
and edit the following lines


(remove the # in front of the lines)
masternode=1
masternodeprivkey= This is the key we generated here with masternode genkey
Now we start the LUX daemon again.
./luxd


Finalize the Windows wallet configuration
Enable coin control, go to tools -> options


Enable coin control features.


Go to the send tab and select inputs.


You might see the 16120 coins are locked.


If it is locked, you can right click and select “unlock unspent”


The coins are now unlocked


You can now close the send window.
Start the masternode
To start the masternode, go to tools -> debug console


Unlock your wallet for 1 minute
walletpassphrase "YOURPASSPHRASE" 60


Start the masternode
masternode start-alias luxcoldmn1


Close the debug console
Verify the masternode is running
Your masternode should appear in the masternodes tab.


Succes !
You can now close your QT wallet and SSH session to your VPS. Congratulations, you are now running a LUX masternode !
Updated 5 months ago