Masternode setup guide for Social SEND on a remote VPS

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@voxcon·
0.000 HBD
Masternode 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>&nbsp;
  <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 &gt; Debug console"</strong> and enter the following command: "<code>masternode genkey</code>".&nbsp;</p>
<img src="https://cdn.steemitimages.com/DQmebQvYA2wFbrW3UJDGE2Tp9xG2EA8VrArVZ36rLCsT6xV/tools-debug-console.png"></br>&nbsp;
<p>The output should look something like this:&nbsp;</p>
<img src="https://cdn.steemitimages.com/DQmZSqNMvGVjQoWgneZJho8MNF9J5Jv3my2jATbuyHThVxV/Masternode-Genkey.PNG"></br>&nbsp;
<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.&nbsp;</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>.&nbsp;</p>
<img src="https://cdn.steemitimages.com/DQmWA7b6LCpyrfGdahspNwWQDCqTyXEnfvkJCTKvMoeT6yo/Generate-new-Address.PNG"></br>&nbsp;
<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.&nbsp;</p>
<img src="https://cdn.steemitimages.com/DQmScesmVZkA6ehr2hJPv1HEp1Lfbq3qDhZk1vD4EZRoKL4/Send-Collateral-to-address.PNG"></br>&nbsp;
<p>Afterwards head over to <strong>"Tools &gt; Debug console"</strong> again and enter the following command: "<code>masternode outputs</code>". The output should look similar to this:&nbsp;</p>
<img src="https://cdn.steemitimages.com/DQmShihkLakzFXpzHUCQDZ4F5aFvkYrEzEkM5f3d3o4ooPj/Masternode-outputs.PNG"></br>&nbsp;
<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>&nbsp;</p>
<p>---</p>
<p><strong>Step 2.3 - </strong>(Optional, but recommended) - Configure the firewall</p>
<p><code>sudo ufw default deny incoming</code>&nbsp;</p>
<p><code>sudo ufw default allow outgoing</code>&nbsp;</p>
<p><code>sudo ufw allow ssh/tcp</code>&nbsp;</p>
<p><code>sudo ufw limit ssh/tcp</code>&nbsp;</p>
<p><code>sudo ufw allow 50050/tcp</code>&nbsp;</p>
<p><code>sudo ufw logging on</code>&nbsp;</p>
<p><code>sudo ufw --force enable</code>&nbsp;</p>
<p><code>sudo reboot</code>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</p>
<p><code>fallocate -l 3G /swapfile</code>&nbsp;</p>
<p><code>chmod 600 /swapfile</code>&nbsp;</p>
<p><code>mkswap /swapfile</code>&nbsp;</p>
<p><code>swapon /swapfile</code>&nbsp;</p>
<p><code>echo -e "/swapfile none swap sw 0 0 \n" &gt;&gt; /etc/fstab</code>&nbsp;</p>
<p>---</p>
<p><strong>Step 2.7 - </strong>Install dependencies (as send user)</p>
<p><code>su send</code>&nbsp;</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>&nbsp;
<p><code>sudo add-apt-repository ppa:bitcoin/bitcoin</code>&nbsp;</p>
<p><code>sudo apt-get update</code>&nbsp;</p>
<p><code>sudo apt-get install libdb4.8-dev libdb4.8++-dev -y</code>&nbsp;</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>&nbsp;</p>
<p><code>sudo git clone https://github.com/SocialSend/SocialSend.git</code>&nbsp;</p>
<p>---</p>
<p><strong>Step 3.2 - </strong>Make the installation scripts executable</p>
<p><code>cd SocialSend</code>&nbsp;</p>
<p><code>sudo chmod +x share/genbuild.sh</code>&nbsp;</p>
<p><code>sudo chmod +x autogen.sh</code>&nbsp;</p>
<p><code>sudo chmod 755 src/leveldb/build_detect_platform</code>&nbsp;</p>
<p>---</p>
<p><strong>Step 3.3 - </strong>Preconfigure the Social SEND installation</p>
<p><code>sudo ./autogen.sh</code>&nbsp;</p>
<p><code>sudo ./configure</code>&nbsp;</p>
<p>---</p>
<p><strong>Step 3.4 - </strong>Install the Social SEND daemon and client</p>
<p><code>sudo make</code>&nbsp;</p>
<p><code>sudo make install</code>&nbsp;</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>&nbsp;</p>
<p><code>sudo cp ./SocialSend/src/sendd /bin</code>&nbsp;</p>
<p><code>sudo cp ./SocialSend/src/send-cli /bin</code>&nbsp;</p>
<p>---</p>
<p><strong>Step 3.6 - </strong>Test the SEND daemon and client</p>
<p><code>sendd -daemon -txindex</code>&nbsp;</p>
<p><code>send-cli getinfo</code>&nbsp;(The first time you run this code you might get an error saying: "<code>error: {"code":-28,"message":"Loading wallet... (50.25 %)"}</code>" -&gt; 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>&nbsp;</p>
<p><code>cd</code>&nbsp;</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&amp;_notify_domain=www.dropbox.com&amp;dl=1' --output-document 'bootstrap.zip'</code></pre>&nbsp;
<p><code>unzip ./bootstrap.zip -d ./bootstrap</code>&nbsp;</p>
<p><code>sudo rm -rf ~/.send/blocks</code>&nbsp;</p>
<p><code>sudo rm -rf ~/.send/chainstate</code>&nbsp;</p>
<p><code>sudo rm ~/.send/peers.dat</code>&nbsp;(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>&nbsp;</p>
<p><code>sudo cp ./bootstrap/chainstate ~/.send</code>&nbsp;</p>
<p><code>sudo cp ./bootstrap/peers.dat ~/.send</code>&nbsp;</p>
<p><code>sendd -daemon -txindex</code>&nbsp;</p>
<p><code>watch send-cli getinfo</code>&nbsp;(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>&nbsp;
<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>&nbsp;</p>
<p><code>sudo nano ~/.send/send.conf</code>&nbsp;</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 &nbsp;(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>&nbsp;</p>
<p><code>watch send-cli getinfo</code>&nbsp;(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 &gt; 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>&nbsp;
<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 &gt; 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>&nbsp;
<p>Save the changes and close your local wallet.&nbsp;</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>&nbsp;
<p>You should see the following message:</p>
<img src="https://cdn.steemitimages.com/DQmWA8RYtqq3FsHrxJSf4tiWfuY5WdPeGVdu1xZPp88dhXf/Alias-successfully-started.PNG"></br>&nbsp;
<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>&nbsp;
<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 :-)&nbsp;</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&nbsp;</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>&nbsp;
<a href="https://www.vultr.com/?ref=7238145"><img src="https://i.imgur.com/nDd9O0x.png"></a></br>&nbsp;
</html>
👍 , , ,