Masternode setup guide for Social SEND on a remote VPS
crypto·@voxcon·
0.000 HBDMasternode setup guide for Social SEND on a remote VPS
<html> <p>This is a guide to show you how to setup a remote masternode for Social SEND on a linux based VPS (Virtual Private Server).</p> <h2><strong>Prerequisites:</strong></h2> <ul> <li>A linux based VPS with at least 512 MB of RAM, 5 GB of free space. For this guide we will use a cheap <a href="https://www.vultr.com/?ref=7238145">Vultr </a>VPS with Ubuntu Linux 14.04 preinstalled. (Will also work with Ubuntu 16.04, 18.04 hasn't been tested yet).</li> <a href="https://www.vultr.com/?ref=7238145"><img src="https://i.imgur.com/nDd9O0x.png"></a></br> <li>A ssh client to log into your VPS (I'm using <a href="https://www.putty.org/">PuTTY</a>).</li> <li>A fully synced, local Social SEND wallet with at least 12.500 spendable coins in it.</li> </ul> <h2><strong>Step 1. - Prepare your local Wallet</strong></h2> <p><strong>---</strong></p> <p><strong>Step 1.1 - </strong>Open your local SEND wallet and go to: <strong>"Tools > Debug console"</strong> and enter the following command: "<code>masternode genkey</code>". </p> <img src="https://cdn.steemitimages.com/DQmebQvYA2wFbrW3UJDGE2Tp9xG2EA8VrArVZ36rLCsT6xV/tools-debug-console.png"></br> <p>The output should look something like this: </p> <img src="https://cdn.steemitimages.com/DQmZSqNMvGVjQoWgneZJho8MNF9J5Jv3my2jATbuyHThVxV/Masternode-Genkey.PNG"></br> <p>Save this information into a seperate File called <strong>"SEND-MN-Setup-Info.txt"</strong>.</p> <p>---</p> <p><strong>Step 1.2 - </strong>Within you local SEND wallet create a new receiving address for your masternode. </p> <p>To do so go to: <strong>"Receive"</strong>, enter a name for your MN-addres into the inputbox called <strong>"Label"</strong>, e.g. <strong>"Masternode1"</strong> (without the <strong>"</strong>) and click on <strong>"Request payment"</strong>. </p> <img src="https://cdn.steemitimages.com/DQmWA7b6LCpyrfGdahspNwWQDCqTyXEnfvkJCTKvMoeT6yo/Generate-new-Address.PNG"></br> <p>Your new receiving address should now be visible within the <strong>"Requested payments history"</strong> box. Double click on your new address and copy it.</p> <p>---</p> <p><strong>Step 1.3 - </strong>Now send exactly 12.500 SEND to your newly created MN-receiving address and wait for at least 15 confirmations. </p> <img src="https://cdn.steemitimages.com/DQmScesmVZkA6ehr2hJPv1HEp1Lfbq3qDhZk1vD4EZRoKL4/Send-Collateral-to-address.PNG"></br> <p>Afterwards head over to <strong>"Tools > Debug console"</strong> again and enter the following command: "<code>masternode outputs</code>". The output should look similar to this: </p> <img src="https://cdn.steemitimages.com/DQmShihkLakzFXpzHUCQDZ4F5aFvkYrEzEkM5f3d3o4ooPj/Masternode-outputs.PNG"></br> <p>Save the output to your <strong>"SEND-MN-Setup-Info.txt"</strong> (we will need it later on).</p> <p>---</p> <h2><strong>Step 2. - Prepare your VPS</strong></h2> <h2><strong>---</strong></h2> <p><strong>Step 2.1 - </strong>Get your VPS up to date</p> <p>Log into your VPS via SSH.<p> <p><code>sudo apt-get update</code></p> <p><code>sudo apt-get upgrade -y</code></p> <p><code>sudo apt-get autoremove -y</code></p> <p>---</p> <p><strong>Step 2.2 - </strong>Create a new send user</p> <p><code>sudo adduser send</code> (set the UNIX password for the send user, additional information like name etc. is optinal)</p> <p><code>sudo adduser send sudo</code> </p> <p>---</p> <p><strong>Step 2.3 - </strong>(Optional, but recommended) - Configure the firewall</p> <p><code>sudo ufw default deny incoming</code> </p> <p><code>sudo ufw default allow outgoing</code> </p> <p><code>sudo ufw allow ssh/tcp</code> </p> <p><code>sudo ufw limit ssh/tcp</code> </p> <p><code>sudo ufw allow 50050/tcp</code> </p> <p><code>sudo ufw logging on</code> </p> <p><code>sudo ufw --force enable</code> </p> <p><code>sudo reboot</code> </p> <p>---</p> <p><strong>Step 2.4 - </strong>(Optional, but recommended) - Additional security through fail2ban</p> <p><code>sudo apt-get install fail2ban -y</code> </p> <p>---</p> <p><strong>Step 2.5 - </strong>(Optional, but recommended) - Permit root login</p> <p><code>sudo nano /etc/ssh/sshd_config</code> </p> <p>Search for the line: "<code>PermitRootLogin yes</code>" or "<code>PermitRootLogin without-password</code>" and change it to "<code>PermitRootLogin no</code>" (CTRL+X, Y, Enter to save your changes).</p> <p>After you have saved your changes restart the ssh daemon with: "<code>sudo service ssh restart</code>".</p> <p>---</p> <p><strong>Step 2.6 - </strong>Set up swap space (as root user)</p> <p><code>sudo su</code> </p> <p><code>fallocate -l 3G /swapfile</code> </p> <p><code>chmod 600 /swapfile</code> </p> <p><code>mkswap /swapfile</code> </p> <p><code>swapon /swapfile</code> </p> <p><code>echo -e "/swapfile none swap sw 0 0 \n" >> /etc/fstab</code> </p> <p>---</p> <p><strong>Step 2.7 - </strong>Install dependencies (as send user)</p> <p><code>su send</code> </p> <pre><code>sudo apt-get install pkg-config build-essential autoconf automake libtool libboost-all-dev libgmp-dev libssl-dev libcurl4-openssl-dev git software-properties-common unzip -y</code></pre> <p><code>sudo add-apt-repository ppa:bitcoin/bitcoin</code> </p> <p><code>sudo apt-get update</code> </p> <p><code>sudo apt-get install libdb4.8-dev libdb4.8++-dev -y</code> </p> <p>---</p> <h2><strong>Step 3. - Install the Social SEND daemon and client to your VPS</strong></h2> <h2><strong>---</strong></h2> <p><strong>Step 3.1 - </strong>Clone the Social SEND github repo</p> <p><code>cd</code> </p> <p><code>sudo git clone https://github.com/SocialSend/SocialSend.git</code> </p> <p>---</p> <p><strong>Step 3.2 - </strong>Make the installation scripts executable</p> <p><code>cd SocialSend</code> </p> <p><code>sudo chmod +x share/genbuild.sh</code> </p> <p><code>sudo chmod +x autogen.sh</code> </p> <p><code>sudo chmod 755 src/leveldb/build_detect_platform</code> </p> <p>---</p> <p><strong>Step 3.3 - </strong>Preconfigure the Social SEND installation</p> <p><code>sudo ./autogen.sh</code> </p> <p><code>sudo ./configure</code> </p> <p>---</p> <p><strong>Step 3.4 - </strong>Install the Social SEND daemon and client</p> <p><code>sudo make</code> </p> <p><code>sudo make install</code> </p> <p>---</p> <p><strong>Step 3.5 - </strong>Make the SEND daemon and client globally accessible on your VPS</p> <p><code>cd</code> </p> <p><code>sudo cp ./SocialSend/src/sendd /bin</code> </p> <p><code>sudo cp ./SocialSend/src/send-cli /bin</code> </p> <p>---</p> <p><strong>Step 3.6 - </strong>Test the SEND daemon and client</p> <p><code>sendd -daemon -txindex</code> </p> <p><code>send-cli getinfo</code> (The first time you run this code you might get an error saying: "<code>error: {"code":-28,"message":"Loading wallet... (50.25 %)"}</code>" -> This only means that your wallet hasn't been loaded yet. Give it a few more seconds and rerun the command.</p> <p>---</p> <p><strong>Step 3.7 - </strong>Get the Socials SEND wallet to sync and install the latest bootstrap</p> <p><code>send-cli stop</code> </p> <p><code>cd</code> </p> <p>Now get the downloadlink for the latest bootstrap from <a href="https://socialsend.io">SocialSend.io</a> or from me (Voxcon) in our <a href="https://discord.gg/xKdw4E2">Discord channel</a>. The current download command is (09/07/2018):</p> <pre><code>wget --header 'Host: uc1b76f399101a682ceadacf263b.dl.dropboxusercontent.com' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --referer 'https://www.dropbox.com/' --header 'Upgrade-Insecure-Requests: 1' 'https://uc1b76f399101a682ceadacf263b.dl.dropboxusercontent.com/cd/0/get/AP0vP5iaQICppBf2uNCXGlD9n5Okm9e62I69Dm_Aws3c9lbto1HcLPfFfqA3573fNvtt9R5QSoV4Rc3iY-_TPodQnyo3wOtpRawXJoYmB9VTW8qhIP7DCrHod7U4-HIEJ8nnUXcrKgzZN6rrf_pXeKrDK0cWd_B-dViQnOM-dvLXZ4IS_jUiMAHv54lvPL45Vxk/file?_download_id=86035074198974732975068810561815808133861356315339787518060399774&_notify_domain=www.dropbox.com&dl=1' --output-document 'bootstrap.zip'</code></pre> <p><code>unzip ./bootstrap.zip -d ./bootstrap</code> </p> <p><code>sudo rm -rf ~/.send/blocks</code> </p> <p><code>sudo rm -rf ~/.send/chainstate</code> </p> <p><code>sudo rm ~/.send/peers.dat</code> (Don't worry if you get an error saying: "No such file or directory". This only means the file does not yet exist)</p> <p><code>sudo cp ./bootstrap/blocks ~/.send</code> </p> <p><code>sudo cp ./bootstrap/chainstate ~/.send</code> </p> <p><code>sudo cp ./bootstrap/peers.dat ~/.send</code> </p> <p><code>sendd -daemon -txindex</code> </p> <p><code>watch send-cli getinfo</code> (Have a look at the blockheight and compare it to the blockheight of your local wallet or our block explorer and let your VPS daemon sync. Use CTRL+C to stop watching)</p> <img src="https://cdn.steemitimages.com/DQmY1ESBcN1nKQSJq9swwrsCWQuk43v3uJay7attm9wEF18/send-cli-getinfo.PNG"></br> <p>---</p> <h2><strong>Step 4. - Configure SEND on your VPS</strong></h2> <h2><strong>---</strong></h2> <p><strong>Step 4.1 - </strong>Configure SEND on your VPS</p> <p><code>send-cli stop</code> </p> <p><code>sudo nano ~/.send/send.conf</code> </p> <p>---</p> <p><strong>Step 4.2 - </strong>Post the following lines into your <strong>send.conf</strong> and adjust them to fit your settings (CTRL+X, Y, Enter to save your changes)</p> <pre><code>rpsuser=CHOOSE-ANY-RPCUSERNAME-YOU-WANT-EXCEPT-"send" rpcpassword=CHOOSE-ANY-PASSWORD-YOU-WANT rpcallowip=127.0.0.1 listen=1 server=1 staking=1 daemon=1 logtimestamps=1 maxconnections=256 masternode=1 masternodeprivkey=THE-OUTPUT-OF-MASTERNODE-GENKEY-FROM-STEP-1.1-GOES-HERE externalip=YOUR-VPS-IP-GOES-HERE</code></pre> <p>---</p> <p><strong>Step 4.3 - </strong>Restart the SEND daemon</p> <p><code>sendd -daemon -txindex</code> </p> <p><code>watch send-cli getinfo</code> (Let the daemon sync and close the watch command with CTRL+C)</p> <p>---</p> <h2><strong>Step 5. - Configure your local wallet</strong></h2> <h2><strong>---</strong></h2> <p><strong>Step 5.1 - </strong>Configure the masternodes.conf on your local machine</p> <p>Open your local wallet and go to: "<strong>Tools > Open Masternode Cofiguration File</strong>" and enter the following line at the bottom of the file and adjust the values according to your settings:</p> <pre><code>Masternode1 YOUR-VPS-IP-GOES-HERE:50050 OUTPUT-OF-MASTERNODE-GENKEY-GOES-HERE-FROM-STEP-1.1 TXHASH-FROM-MASTERNODE-OUTPUTS-GOES-HERE-FROM-STEP-1.3 OUTPUTINDEX-FROM-MASTERNODE-OUTPUTS-GOES-HERE-FROM-STEP-1.3</code></pre> <p>When you have adjusted your values correctly, the last line of your masternode configuration file should look something like this:</p> <pre><code>Masternode1 45.32.155.138:50050 88ZXmAF8is6XnfD6z7LnCZrHxishnnzzyuSeYQz4KYib9AvjmMT 7337a48d396798cf61a124eed5c619a29a998ba533650839edb2bd7fdbbd42e9 0</code></pre> <p>---</p> <p><strong>Step 5.3 - </strong>Configure the send.conf on your local machine</p> <p>Open your local wallet and go to: "<strong>Tools > Open Wallet Cofiguration File</strong>" and enter your rpcusername and rpcpassword form step 4.2 as follows:</p> <pre><code>rpsuser=THE-RPCUSER-YOU-HAVE-ENTERED-IN-STEP-4.2 rpcpassword=THE-RPCPASSWORD-YOU-HAVE-ENTERED-IN-STEP-4.2</code></pre> <p>Save the changes and close your local wallet. </p> <p>---</p> <p><strong>Step 5.4 - </strong>Sart Alias</p> <p>Reopen your local wallet and enable your masternode within the "<strong>Masternodes</strong>" tab by clicking on "<strong>Start alias</strong>".</p> <img src="https://cdn.steemitimages.com/DQmXzunv6uhetCKEqZVY9Ww2i4Maj2sT2WwDBAzgJ1moVDh/Enable-Alias.PNG"></br> <p>You should see the following message:</p> <img src="https://cdn.steemitimages.com/DQmWA8RYtqq3FsHrxJSf4tiWfuY5WdPeGVdu1xZPp88dhXf/Alias-successfully-started.PNG"></br> <p>---</p> <h2><strong>Step 6. - Check if your masternde is running correctly</strong></h2> <h2><strong>---</strong></h2> <p><strong>Step 6.1 -</strong>VPS check</p> <p>Switch to your VPS and execute the following command: <code>send-cli getmasternodestatus</code></p> <img src="https://cdn.steemitimages.com/DQmZtbzTbrNyNkBfi2SrwQ1dG79XfSrDUwyi7SATkXgKumV/send-cli-getmasternodestatus.PNG"></br> <p>---</p> <h2><strong>Step 7. (Optional) - Automatically restart the SEND daemon when your VPS restarts</strong></h2> <h2><strong>---</strong></h2> <p><strong>Step 7.1 - </strong>SSH into your VPS as user "<strong>send</strong>" or change your current user to "<strong>send</strong>" with the command "<code>su send</code>"</p> <p>---</p> <p><strong>Step 7.2 - </strong>Add a cronjob to the bootprocedure of your VPS</p> <p><code>crontab -e</code> (choose nano as the editor to open the crontab file)</p> <p>Add the following line to the bottom of your crontab file:</p> <p><code>@reboot sleep 15; sendd -daemon -txindex</code> (CTRL+X, Y, Enter to save your changes)</p> <p>---</p> <p>Awesome, now you have successfully setup your Social SEND masternode :-) </p> <p>If you have run into any problems, please let me know and i'll try to help you.</p> <p>---</p> <p>With best regards,</p> <p>Voxcon </p> <p>PS: A simple masternode setup script is already in the making, but it needs a little more tweaking here and there. Please be a bit patient.<br></p> <a href="https://www.vultr.com/?ref=7238145"><img src="https://i.imgur.com/nDd9O0x.png"></a></br> </html>