How to setup a Linda masternode on Ubuntu 16 Linux

in #lindacoin7 years ago (edited)

<h1>LINDA <hr /> <p dir="auto">Bitcointalk - <a href="https://bitcointalk.org/index.php?topic=2002111.0" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://bitcointalk.org/index.php?topic=2002111.0<br /> Website - <a href="http://lindacoin.com/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">http://lindacoin.com/<br /> Github - <a href="https://github.com/Lindacoin/Linda" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/Lindacoin/Linda<br /> Explorer - <a href="http://lindachain.com/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">http://lindachain.com/ <p dir="auto"><br /> <p dir="auto">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.   <p dir="auto"><br /> <p dir="auto"><strong>1. Install dependencies: <pre><code>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 <p dir="auto"><br /> <p dir="auto"><strong>2. Create a swapfile: <p dir="auto">Since we will be compiling the <code>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: <pre><code>sudo fallocate -l 2G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile<br /> <p dir="auto">Now let's make this permanent so that if your VPS restarts, the swap will turn on automatically: <pre><code>echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab <p dir="auto"><br /> <p dir="auto"><strong>3. Now let's get the Linda source and compile: <pre><code>cd ~/ git clone https://github.com/Lindacoin/Linda cd Linda/src make -f makefile.unix cp Lindad /usr/local/bin <p dir="auto"><br /> <p dir="auto"><strong>4. Now that we have Lindad compiled, start it up and let it sync: <pre><code>Lindad -daemon <p dir="auto"><br /> <p dir="auto">This will take 2-6 hours to sync depending on your connection and proximity to other peers. <p dir="auto">You can check on the progress of it by typing: <pre><code>Lindad getinfo <p dir="auto"><br /> <p dir="auto">And look for the "blocks" line.  The latest block at the time of writing this was: <pre><code>"blocks" : 83340,  <p dir="auto"><br /> <p dir="auto"><strong>5. While your wallet is syncing, let's create a new account address for address 0, and make a note of it: <pre><code>Lindad getaccountaddress 0 <p dir="auto"><br /> <p dir="auto"><strong>6. Now send exactly 30000000 Linda to the address you just created. <p dir="auto">Wait for 15 confirmations <p dir="auto"><br /> <p dir="auto"><strong>7. While it's confirming, generate a masternode key, and make a note of it: <pre><code>Lindad masternode genkey <p dir="auto"><br /> <p dir="auto"><strong>8. Encrypt your wallet: <pre><code>Lindad encryptwallet "your password" <br /> <p dir="auto">***DO NOT LOSE THIS PASSWORD*** <br /> <p dir="auto"><strong>9. Now stop Linda so you can modify the config. <pre><code>Lindad stop <p dir="auto"><br /> <p dir="auto"><strong>10. Edit your config which you will find here: <pre><code>~/.Linda/Linda.conf <p dir="auto"><br /> <p dir="auto">Your config should be edited to look like this: <pre><code>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 <p dir="auto"><br /> <p dir="auto"><strong>11. Now make sure your VPS firewall has port 33820 open. <pre><code>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 <p dir="auto"><br />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. <p dir="auto"><strong>12. Start Linda again: <pre><code>Lindad -daemon <p dir="auto"><br /> <p dir="auto"><strong>13. Unencrypt your wallet: <pre><code>Lindad walletpassphrase "the password you set above" 999999999 <p dir="auto"><br /> <p dir="auto"><strong>14. Check to make sure your 30000000 transaction has 15 confirmations: <pre><code>Lindad listtransactions <p dir="auto"><br /> <p dir="auto"><strong>15. If it does, start your masternode: <pre><code>Lindad masternode start <p dir="auto"><br /> <p dir="auto">You can check to make sure your MN is enabled: <pre><code>Lindad masternode list|grep <your ip> <p dir="auto"><br /> <p dir="auto">If you see this: <pre><code>"<your vps ip>:33820" : 1 <p dir="auto"><br /> <p dir="auto">Then you successfully installed your new Linda masternode on Ubuntu 16 Linux.   <p dir="auto"><br /> <p dir="auto">Congrats!<br /><br /> <p dir="auto"><strong>16. BONUS STEP: Backup your wallet before you log out of your VPS. <p dir="auto">Use any SFTP or SCP program to connect to your VPS, and backup your <code>wallet.dat file to your local desktop or laptop. That file is located here:<p dir="auto"> <p dir="auto"><code>~/.Linda/wallet.dat <p dir="auto"><br /> <hr /> <p dir="auto">If you feel like you got any value from this, support my efforts:<br /><br /> <p dir="auto">LINDA:   LW6e6Tfda7vEgiwU7cBV4kPYiAyUaJwkiX  <br /><br /> <p dir="auto">Thank you! <p><p>
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.

<p dir="auto">For example: <p dir="auto"><code>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?

<p dir="auto"><code>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.

<p dir="auto">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: <p dir="auto"><code>Lindad walletpassphrase "the password you set above" 600