Everything happened so fast in these last few days that I'm losing track of time!
I see this post pops up on my feed 3 days ago and I read that the SPK team needs some help to run the Larynx claim in a decentralized way using the D.lux HoneyComb technology!
Do you remember the Snapshot that has been taken on the 6th of January? Super, now the team is working on the best decentralised way to get the users started in claiming those Larynx tokens every month for a total duration of 12 months! Everyone that had some HIVE or HP at the time of the Snapshot will be eligible for these claims!
I immediately say to myself "Cool, I'm on it, I want to participate in the new SPK Network and setting up this Claim Chain node is a great opportunity for me to get familiarity with the process of setting up nodes, I joined Hive in March 2021 but I'm eager to start actively supporting this chain and its development!"
After reading the post I went to check here and here and started checking out the video by @disregardfiat, It was late so I tried to gather as much info as possible ready to do it the next day, I also joined the D.lux Discord where I found additional info and I saw some peeps already trying to install and asking for some support, I immediately joined them and started asking questions here and there, everyone in the Discord was friendly and helpful and if you too are thinking about running a SPK Clain Chain node I strongly advice you to go there to meet the team and get some help 😎
Some Informations + Links + Guides
When I started working on my node the materials available were the 2 posts I linked at the start of my post (The HoneyComb overview and the SPK Claim Node setup Video Guide, both great guides provided by @disregardfiat).
As I started working on it I was getting lost in the video and I really appreciated the written commands provided in the post, they really helped me to keep everything together, I then felt a need to write a quick guide with a written step-by-step and noob-friendly procedure to help people that may start getting confused as I was when watching the video, and I have an IT background and work in the industry so I thought if I'm getting lost here a newbie is just gonna give up lol 🤣
And I could see the guys in D.lux Discord talking about the exact same thing, I was busy setting up the node so I prioritized that rather than the post and after few hours as I was finally getting ready to install everything after the initial setups (server, ssh-keys, domain, dns, etc...) this great Step by Step SPK Claim Chain node setup guide by @balaz popped up! You're the man! Your guide came at the right moment for me, it helped me a lot and it was a wonderful add to the 2 great guides linked by @disregardfiat
The @balaz step by step guide was so good and thorough that I did not feel anymore the need to do a guide myself, @balaz is a developer and has much more knowledge that me on the matter so a guide from me at this point would only be redundant and I do not want to spam the blockchain!
But I still want to contribute to this project in more ways than just running a node, I noticed that some parts were left out of the guide (for various reasons, security being one of them!) and I also noticed that some people on the Discord were having some issues with exactly those parts so I thought that instead of writing another Step by Step guide I could write some quick tutorials for those parts. Hopefully you appreciate and it helps someone!
The quick-guides I wanted to write about:
- Setting up SSH keys (before ordering the server so you can share the public SSH keys with the server providers to have SSH Key Based Authentication already enabled on the server)
- Disabling SSH Password Authentication (pretty straightforward, but It may save you a google research and some clicks 😄)
- Adding the DNS records to point to your Domain
Setting up SSH keys
The procedure is pretty much the same on both Windows and Linux, I will show only on one OS for the sake of this guide.
- Open a Terminal (cmd for Windows)
- Navigate to the Folder where you want to save you key in with
cd <folder_path>
- Type in the command
ssh-keygen
- You will be prompted to enter the name you want for your ssh key file (in my example is KEY)
- It will prompt asking for a passphrase - Leave blank here (hit enter)
- It will prompt asking for the same passphrase again - Leave blank here (hit enter)
- It will prompt the feedback of a successful identification (private key) and public key being created and saved in the local folder, as well as the key fingerprint and a randomart image, pretty cool!
- Type
more <key-file-name>.pub
and it will prompt you with your public ssh key (Highlighted in my picture)
Copy this! It will be used when ordering your @privex server to have SSH Authentication enabled for that key!Be very careful, you want to copy the KEY.pub here!
When you will be ordering the @privex server in the order page you will have to paste your KEY.pub (public ssh key), like in this picture:
This is the key that I generated for this example and obviously I'm not going to use it nor order a server with it, even if it's safe because is public, but it was just for the sake of this guide to show you guys how to do it! (I did setup my node 2 days ago)
If you set your SSH Key like this you will already have SSH Key Based Authentication working on the server with that key!
To login in your server using the SSH Key run this command in the terminal (make sure to run it from the folder where your Key is located!) :
ssh -i "KEY" <your-server-username>@<server-IP-address>
Where KEY is your private identification ssh file key
i.e. ssh -i "KEY' ubuntu@x.x.x.x
In this way you can disable Password Login on the server on your first access and have a safer way to access it thanks to the SSH Key!
Disabling SSH Password Authentication
A good rule of a thumb is to disable password login only after the ssh key login works, double check all the time, if you're locked with no keys and password authentication disabled that's it, you're done! Bye Bye Server 😅
So once we've got our SSH Key Based Authentication working (and double checked!) we can disable the Password Authentication:
- We need to edit a config file for ssh which is located in
/etc/ssh/sshd_config
- Type
more /etc/ssh/sshd_config
to see the content of the config file
- Search for the line
#PasswordAuthentication yes
- Edit the file with
sudo nano /etc/ssh/sshd_config
Uncomment the line removing # and change yes to no
Save with (Ctrl+O & Ctrl+X) or (Ctrl+X & Y & Enter) - Run
sudo systemctl reload ssh
- Reboot and test. Now when I try to connect through SSH to my server and try to login with the username I get this message
Mission accomplished, Password Login through SSH is now disabled on the server! We can now access the server through SSH only using our KEY!
Adding the DNS records to point to your Domain
Last thing that people got some problems with was how to correctly add the DNS records to the domain to point it to the IP address of the server (I figured how to configure this correctly checking the D.lux Discord.
I personally registered a domain with namecheap and found a pretty cool deal for 10$ for 2 years time! I personally think is a very cool domain name lol
Once we have our Domain registered we need to add an A record listing to point it to our server and before building the HoneyComb with the docker-compose we're going to edit the .env file and specify our domain in this line domain=https://api.yourdomain.com
Here is where it can get confusing for some, when you add your A Record DNS to your domain you need to give it a host name and IP address (which is the IP address of your server), for the hostname I just put in api so when I add the code domain=https://api.yourdomain.com
to my .env file it works without problems, if you call your host let's say spk then you will need to update the code accordingly to domain=https://spk.yourdomain.com
Basically the IP address on the DNS A record needs to match the IP address of your server, which is the one that you input here ssh hostname@ip-address
when connecting to your server!
If you order with @privex and get the ubuntu OS the default hostname will be ubuntu.
You can see here my settings:
My host is api and my domain is trippymane.xyz so in my case my code was domain=https://api.trippymane.xyz
Hope this helps to clarify some confusion. 😁
Last cool tip, from our great @disregardfiat
If you have already a server running and you just want to update the .env file you can do so simply by restarting the service and it will automatically sync with the network.
To do so just run the following commands on your server:
sudo git pull
sudo docker-compose build
sudo docker-compose up
This will update the .env file and rebuild the HoneyComb to the latest updated version while our old version is still running in the background, so with this method we have minimum downtime, pretty efficient! 😎
An even better method to do this is using a slightly different variant of the sudo docker-compose up
command, this will restart the service and impose some memory limit on the IPFS:
sudo git pull
sudo docker-compose build
sudo docker-compose --compatibility up
As you see pretty simple, it just adds the --compatibility
modifier!
I was today years old when I learned this 😎
Everyday I spend in the D.lux Discord is a day that I learn something new! Mind Explosion! Happy to be part of the Network! 🙏 Also great vibes in the chat guys, every member is super helpful and it's a cool place to be!
@disregardfiat Thanks for all the help you gave me this days man, for this last minute tip before I was publishing my post and for the great chat on Discord 😁 You're the man! One day I may write you an official Thank You letter in Russian cursive to boost your language learning! 😂
Celebration!
I'm really happy I managed to do this one without too many problems and really happy to have joined the Revolution that is happening here on Hive!
You can check who is participating in the network here: https://hiveuprss.github.io/spkccmonitor/
Pretty cool to see my account in the list!
My node is running on the account @trippy-spkcc and I bought a pretty sick trippymane.xyz domain for the api for only 10$ for 2 years.
I'm at the last v1.0.0b11 update and always checking D.lux Discord ready to push any new update that gets released by the team!
You can also see that my api seems working correctly here: https://api.trippymane.xyz/