[How to] Create your own Peercoin Full Active Node running on Debian with Online Labs cloud!


#1

TUTORIAL: Create your own Peercoin Full Active Node

This tutorial is about how to setup a Debian server running ppcoind, a Linux client daemon for the Proof-of-Stake crypto currency Peercoin or (ppcoin). This Peercoin client daemon will be running in Full Active Node (port 9901 open) via Online Labs cloud platform. Setting up full active nodes contributes to the Peercoin’s network strength and security.

IMPORTANT: FOR OBVIOUS SECURITY REASONS, IT IS STRONGLY DISCOURAGED TO STORE A LARGE AMOUNT OF PEERCOINS ON ANY ONLINE SERVERS. ALWAYS STORE YOUR PEERCOINS ON YOUR OWN COMPUTER WITH PEERUNITY, PEERBOX, OR PAPERWALLET.

This guide will describe how to setup ppcoind (the official Linux Peercoin daemon) on Online Labs’ cloud platform with Debian. If you wish to install it on your own Debian you can skip the PART 1 of this tutorial.

PART 1 (Setup a Debian server)

Once you receive your invite by email, click on “Create your account”

Create a password (can be changed later, but make sure to remember this one!):

Once logged in, you will receive welcome email (that you can ignore). Next step is to add a valid mobile phone number to receive your activation code:

Edit your profile info and add your phone number:


Activate your account once you’ve received the activation code by text:

Congratulation, your account has been activated, you can now create a server. Click on the “CREATE SERVER” button:

Create a SSH key pair on your local machine that will be used to access any servers you create on this cloud platform. Then add the public key (usually id_rsa.pub) content in this text box:

Configure your server. Choose a name, select “Debian Wheezy” and the click on “CREATE SERVER” at the bottom of the page:



Wait a few minutes for your server to be automatically configured:

Click on the “Servers” tab to check the status and get the dynamic IP that was allocated (you also have the possibility to use a reserved static IP, check Online’s documentation for this):

Once started, connect to your server via SSH (if you are on Windows, follow this tutorial: http://www.wikihow.com/Use-SSH):

From now on, everything that you do in command line will only affect your remote server:

PART 2 (Configure your Debian server)

Choose your own username which will be used for all commands you’ll type:

USERNAME='thireus'

Then, perform the following actions (always one after the other, DO NOT COPY/PASTE EVERYTHING!!):

apt-get update && apt-get upgrade --yes
apt-get install git secure-delete rkhunter pax-utils screen nano build-essential autoconf libssl-dev libboost-all-dev libdb++-dev libdb-dev --yes
adduser "$USERNAME" # Replace $USERNAME by your username
passwd -d "$USERNAME" && passwd -l "$USERNAME" && echo OK # Disable password for $USERNAME
chmod 700 /home/"$USERNAME" && mv ~/.ssh /home/"$USERNAME"/ && chown -R "$USERNAME":"$USERNAME" /home/"$USERNAME"/.ssh

[OPTIONAL] Secure your SSH access (disable root for example):

nano -w /etc/ssh/sshd_config # c.f. below:

Add at the end of your /etc/ssh/sshd_config file (and save the changes; how to save a file using nano):

### START - SSH Hardening by Thireus 1.1.1, NSA-Proof? ###

AddressFamily inet
AuthorizedKeysFile %h/.ssh/authorized_keys
HostbasedAuthentication no
IgnoreRhosts yes
PasswordAuthentication no
PermitEmptyPasswords no
PermitRootLogin no
Protocol 2
PubkeyAuthentication yes
ServerKeyBits 2048
StrictModes yes
UsePrivilegeSeparation yes

# MACs ULTRA SECURITY!
#MACs hmac-sha2-512-etm@openssh.com
# MACs ULTRA SECURITY (Compat)!
MACs  hmac-sha2-512
## MACs STRONG (Compat)
#MACs hmac-sha2-512,hmac-sha2-256
# MACs Compat (i.e. Debian 6, Putty)
#MACs hmac-sha2-512,hmac-sha2-256,hmac-sha1

# Ciphers ULTRA SECURITY (only new versions)!
#Ciphers chacha20-poly1305@openssh.com
# Ciphers STRONG (only new versions)!
#Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com
# Ciphers Compat
Ciphers aes256-ctr

# KexAlgorithms ULTRA SECURITY!
KexAlgorithms diffie-hellman-group-exchange-sha256
# KexAlgorithms Compat
#KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1

### END ###

Setup a root password (because we won’t login with root via SSH anymore):

passwd && service ssh restart # Create a strong password for root, because we will not ssh to root anymore, but via our $USERNAME with "su"
halt # This halts your server, so you will have to start it again (reboot doesn't seem to work properly)

PART 3 (Build ppcoind)

GO BACK TO CLOUD.ONLINE.NET AND START OR HARD RESET YOUR SERVER AND WAIT TILL IT BOOTS… (for some reasons you need to hard reset after the halt command)




Execute the following commands:

screen # Just press Space or Return to accept
mkdir ~/peercoins && chmod 700 ~/peercoins
cd ~/peercoins && git clone https://github.com/ppcoin/ppcoin.git && cd ppcoin
#Optional, switch to the dev branch: git checkout develop
cd src
make -f makefile.unix clean
make -f makefile.unix USE_UPNP=- -e PIE=1 # Compile ppcoind without UPNP because we don't need it. Grab a coffee, it will take a while to compile.

Check that everything went well and that you have your ppcoind ready:

scanelf -e ./ppcoind # Should return: ET_DYN RW- R-- RW- ./ppcoind 
cd && mkdir ~/bin && chmod 700 ~/bin && ln -s ~/peercoins/ppcoin/src/ppcoind ~/bin/ && exit
exit

PART 4 (Configure and launch ppcoind)

** LOG BACK IN VIA SSH **

Execute ppcoind for the first time will prove you with rpcuser and a random rpcpassword:

screen # Just press Space or Return to accept
ppcoind # Copy the two lines: rpcuser= and rpcpassword=

Configure your ppcoin.conf file (which doesn’t exist) via nano (and save the changes; how to save a file using nano):

nano -w ~/.ppcoin/ppcoin.conf && chmod 400 ~/.ppcoin/ppcoin.conf # Paste the rcpuser and rpcpassword lines in that file

Launch ppcoind:

ppcoind > /dev/null 2>&1 & # Launch ppcoind FULL NODE
exit
exit

PART 5 (Check ppcoind status)

** LOG BACK IN VIA SSH **

Check that ppcoind is working correctly with the following commands (more commands at: https://www.peercointalk.org/index.php?topic=3789):

ppcoind addnode 62.210.141.185 add # Add [member=32109]Thireus[/member]'s trusted node
ppcoind addnode 107.170.43.92 add # Add [member=31330]MatthewLM[/member]'s trusted node
ppcoind getconnectioncount # Get number of active connections, after a few minutes you should have more than 8 connections
ppcoind getblockcount # Get number of blocks (should be increasing)

These numbers should increase:

Voilà, well done, you’ve just setup a Peercoin full active node! :slight_smile:

Notes:

  • If anything goes wrong during the process you can still delete your server via the Online Labs Web Interface and create a new one.
  • If you get disconnected from your server, you can always resume your work via the command ‘screen -r’ (unless your server has crashed).
  • You can choose another distribution with a desktop interface so that you can install and use Peerunity instead.

List of useful links:

(This tutorial was also posted on Peercoin’s official Forum)