How to setup a Linda masternode on Ubuntu 16 Linux

in #lindacoin7 years ago (edited)

LINDA


Bitcointalk - https://bitcointalk.org/index.php?topic=2002111.0
Website - http://lindacoin.com/
Github - https://github.com/Lindacoin/Linda
Explorer - http://lindachain.com/


Linda is a new hybrid masternode coin that promises a great ROI, and supports PoW(Proof of Work) and PoS(Proof of Stake).  I didn't see any guides for running a Linda masternode on linux, so I thought I'd write one up.  


1. Install dependencies:

sudo apt-get install build-essential libtool automake autotools-dev autoconf pkg-config libssl-dev libgmp3-dev libevent-dev bsdmainutils
sudo apt-get install libboost-all-dev
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev


2. Create a swapfile:

Since we will be compiling the Lindad command line daemon, we will need a swapfile, or the compile process will run out of memory. This example will create a 2G sized swapfile which is optimal for a 1G VPS, but will also work for a 512MB VPS as well. This is how we create one:

sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Now let's make this permanent so that if your VPS restarts, the swap will turn on automatically:

echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab


3. Now let's get the Linda source and compile:

cd ~/
git clone https://github.com/Lindacoin/Linda
cd Linda/src
make -f makefile.unix
cp Lindad /usr/local/bin


4. Now that we have Lindad compiled, start it up and let it sync:

Lindad -daemon


This will take 2-6 hours to sync depending on your connection and proximity to other peers.

You can check on the progress of it by typing:

Lindad getinfo


And look for the "blocks" line.  The latest block at the time of writing this was:

"blocks" : 83340, 


5. While your wallet is syncing, let's create a new account address for address 0, and make a note of it:

Lindad getaccountaddress 0


6. Now send exactly 30000000 Linda to the address you just created.

Wait for 15 confirmations


7. While it's confirming, generate a masternode key, and make a note of it:

Lindad masternode genkey


8. Encrypt your wallet:

Lindad encryptwallet "your password"

***DO NOT LOSE THIS PASSWORD***


9. Now stop Linda so you can modify the config.

Lindad stop


10. Edit your config which you will find here:

~/.Linda/Linda.conf


Your config should be edited to look like this:

rpcuser=put-your-rpc-user-here
rpcpassword=put-your-rpc-password-here
rpcport=33821
rpcallowip=127.0.0.1
daemon=1
server=1
staking=0
listenonion=0
masternode=1
masternodeprivkey=put-your-masternode-key-that-you-generated-here
masternodeaddr=put-your-ip-address-of-vps-here:33820
addnode=104.238.159.161
addnode=45.32.77.164


11. Now make sure your VPS firewall has port 33820 open.

sudo apt-get install ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow 33820
sudo ufw enable


A warning will prompt you saying that your SSH connection will be disrupted. Since we allowed ssh above, you don't have to worry, but DO NOT forget to allow ssh or you will lock yourself out of your VM.

12. Start Linda again:

Lindad -daemon


13. Unencrypt your wallet:

Lindad walletpassphrase "the password you set above" 999999999


14. Check to make sure your 30000000 transaction has 15 confirmations:

Lindad listtransactions


15. If it does, start your masternode:

Lindad masternode start


You can check to make sure your MN is enabled:

Lindad masternode list|grep <your ip>


If you see this:

"<your vps ip>:33820" : 1


Then you successfully installed your new Linda masternode on Ubuntu 16 Linux.  


Congrats!

16. BONUS STEP: Backup your wallet before you log out of your VPS.

Use any SFTP or SCP program to connect to your VPS, and backup your wallet.dat file to your local desktop or laptop. That file is located here:

~/.Linda/wallet.dat



If you feel like you got any value from this, support my efforts:

LINDA:   LW6e6Tfda7vEgiwU7cBV4kPYiAyUaJwkiX 



Thank you!

Sort:  

great article. i'm getting setup now with it. perhaps there are slight errors in the doc though because in step 3 is says to 'cd src' but you can't because you need to 'cd /Linda/src'

Also, the config file is missing data to be replaced. It should not be empty for everything like it says

rpcuser=your-rpc-user-goes-here
rpcpassword=your-rpc-pwd-goes-here
......
masternodeprivkey= your-master-node-private-key-goes-here
masternodeaddr=your-ip-goes-here:33820

maybe there are other edits, but i'm at this point so far.

Thank you cryptobabies, this is great feedback. I noticed some users in slack were having that exact issue with the cd src. I updated the doc, and also my other one about staking in linux so that it isn't as confusing. I also updated the config so that it reflects the text you suggested. It's weird that your browser wasn't getting the original text, but this way is much better. Thanks for helping make the guide better. Cheers!

does the wallet holding the 30M need to be on the same machine? Can it be on some other machine instead and does the wallet need to be online at all or can it be offline?

I'm not sure if it can be on another machine, or if it's possible with Linda. I only know how to set it up with the 30M coins in the same wallet as the masternode. So in my experience, yes it needs to be on the same machine.

Hello!
I saw it well.

I have an error while setting up the master node. Could you tell me the cause and the solution?

CActiveMasternode::ManageStatus() - Checking inbound connection to '45.76.77.240:33820'
CActiveMasternode::GetMasterNodeVin - Could not locate specified vin from possible list
CActiveMasternode::ManageStatus() - Could not find suitable coins!
CActiveMasternode::Dseep() - Error: masternode is not in a running status
CActiveMasternode::ManageStatus() - Error on Ping: masternode is not in a running statusconnected to self at 45.76.77.240:34372, disconnecting

Looks like you don't have the right amount of coins to start your masternode. In step 6 above, you need to send exactly 30000000 Linda to your masternode. You'll have to add the transfer fee to your transaction to make sure that the amount that is sent is exactly 30000000.

thanks, this is much needed!

No problem!

Does this guide require Putty? I can't get it work.

Hi Geeearmoe, I didn't cover that in this guide, but yes, if you are using Windows you will need Putty to connect to your VPS.

I would suggest adjusting the firewall rule to only allow ssh from your specific IP.

For example:

sudo ufw allow from 15.15.15.15/32 to any port 22

Also, after unlocking the wallet the bash history should be cleared so that the pwd can't be found if the box is compromised. The wallet should also be locked too shouldn't it at some point?

cat /dev/null > ~/.bash_history && history -c && exit

Hey Steve, I was trying to add these suggestions, but looks like I can no longer edit my post. These are good suggestions, and I hope future readers of this will scroll down and see this.

As for locking the wallet after the MN has started, I think we can solve this by lowering the expiration on the walletpassphrase command to something like 600 seconds, which means the wallet will lock after 600 seconds have passed:

Lindad walletpassphrase "the password you set above" 600

Coin Marketplace

STEEM 0.21
TRX 0.20
JST 0.034
BTC 99341.76
ETH 3285.44
USDT 1.00
SBD 3.05