Step by Step guide to setup SPK Claim chain node
On the first week of January, there was an airdrop snapshot planned for LARYNX tokens by the SPK team. Today I was wondering what happened to that and how the claiming would happen. When I came across a few posts, I found out that the SPK community is calling node operators to decentralize the LARYNX token claim. This post explains more details on the same and there is also a video out there explaining how we can run a node. Thanks to @disregardfiat for the video guide. They call this a HoneyComb node.
I wanted to make a note of the step-by-step procedure so that I can write and share the details in the form of an article. I was also struck in the video tutorial a little bit which I wanted to keep a note of in this article so that if I reference this article later, I should be able to understand.
I usually write step-by-step guides for running nodes. I did one for running a Hive Engine witness node and many people found it useful. I wanted to do the same for this as well. It is more like documenting what I learn here. It appears to be very easy to operate the node and the technical server requirements are also very low. Let's get started.
It is an assumption that the users who are trying to set up the witness server are familiar with the below topics:
- Connecting to a Linux server, either with a password or through SSH. (SSH is recommended)
- Basic troubleshooting
- Securing your server
- Hive account with a minimum of 100 HP
At the current state, it is enough to run a small server with the below specs. As the requirement grows, we might have to run a bigger server. I personally recommend ordering servers from @privex. I personally have had good experiences with them and the best part I like the most is that we can pay the server cost with Crypto especially Hive and HBD instead of FIAT. The below specifications should be sufficient to run the node.
You get the above specs for 5$ a month which is affordable I think. I will also be using the above server specs from Privex for this guide. You can feel free to use my referral link when you are ordering servers from Privex. After ordering, you will get an email confirmation from them with the server details. Mostly it will happen in just a few minutes from the time of ordering a server.
Note: This node that we are setting up will run IPFS. Please make sure you choose a region appropriate for that on Privex. SWEDEN or USA should be fine. Privex has some policies on that. It is good to read them before setting up the server.
Step 1: Initial server setup
There are some basic utilities that need to be installed to make the server suitable. Below are the commands that can be used to set up these utilities. You can google each one of them to understand why they are required.
sudo apt-get update -y sudo apt-get upgrade -y sudo apt install git -y sudo apt-get install -y fail2ban
Mostly when you order a new server, all these above are already done and you get a server with an updated package. But it is good to make sure that it is the case. In my case, I had to just reboot the server once after logging in.
Step 2: Docker Installation
The below will install docker and docker-compose. Docker is a cool tool for containerizing your app. It reduces many setup-related complications.
sudo apt install docker docker-compose
This will possibly take some time. Once it is done, we can move to the next step.
Step 3: Get the latest code
GIT should already be available on the server but if it is not available, you can install GIT first and then proceed. Use the below command to get the latest code and navigate inside that directory.
git clone https://github.com/3speaknetwork/honeycomb-spkcc.git
If you navigate inside that folder and do
ls you should be above to see all the files inside that folder.
Step 4: Create a .env file and update it
The next thing would be to create a .env file and add the configuration inside that. The below command itself would create a file if it is not already available.
sudo nano .env
Inside the file we have to add the following details:
account="hiveaccount" active=5JactivePrivateKey msowner=5KadditionalPrivateKey mspublic=STMpublickey
account would be the hive account you would be using to run the node.
active would be the active key of the Hive account you are using.
msowner is a new private key that we would need to setup for the dex account and
mspublic is the associated public key for that private key. We can easily get a new key from the below page of https://hivetasks.com/account-creator and copy the Private Active Key and Public Active key and keep it safe.
Another alternative method to get keys would be to go to peakd and try to create a claimed account. That will also generate keys that we can pick up. I would recommend using hivetasks because it will give us both private and the associated Public Key too as we need both in the config.
Now that we have updated the .env file, we can save the file with
ctrl + o and press enter. And then
ctrl + x to exit.
Step 5: Build and run the app with docker
The next step would be to build the application with docker using the below command. No additional task would be required as the docker file in the project will usually take care of the dependencies that this project would need.
sudo docker-compose build
The above command will build the docker environment. The above command will usually take a few minutes depending on the network speed. Once that is done, we can go ahead and run Honeycomb (that's what they call it apparently)
sudo docker-compose up
This should be it and it should show a message similar to below. It should say "At real time" and the below custom_json.
In addition to that if we go to this page. https://spktoken.dlux.io/markets, we should be able to see our node listed there.
Even in spite of that we are not fully done yet. But we can say that the node is running successfully.
Step 6: Claiming LARYNX tokens
Before we enter consensus it is required that we have to claim our LARYNX tokens. The below website has an option to claim the LARYNX tokens. We can also do it with a custom_json too.
Not all the features on the website are working yet. But at least the claim button is working. The gift box that we see on top of the page is the claim button. The transaction can take about 1 minute to reflect. There is currently a channel on dlux discord that streams the updates. If you don't find it there, you can also find it on this page. https://spktoken.dlux.io/feed
Step 7: Locking LARYNX tokens for governance operations and bringing the node to consensus
The next important step is to lock the tokens for governance operations. If you look at this page, you will be able to see the list of nodes. 1. https://hiveuprss.github.io/spkccmonitor/. If you still don't see your node in that list, you have to Lock up some LARYNX tokens on your node account to start participating in consensus.
The current web interface is still not ready and unfortunately, we can do this task only with the help of a custom_json operation. This is when I wished there was an option available to send custom_jsons directly with keychain. I had to first transfer the token to my node account using the below JSON structure.
After the transfer was done, I had to then use another custom_json to lock it up for governance operation.
JSON Doctor - https://jsondoctor.github.io/ is a handy tool if you want to publish custom JSON manually.
I'm leaving a screenshot from JSON Doctor so that people don't get confused with that as well.
The above screenshot is for transferring the funds.
The above screenshot is for locking the tokens to governance ops.
Final Optional steps
We are already done with running the node successfully. There is two additional optional steps. One is to get the latest code as and when there is a new update and the next is to associate a domain with our node. If you are getting the updated code from the repo, the below commands should be used to pull, stop and start the app.
git pull sudo docker-compose down sudo docker-compose build sudo docker-compose --compatibility up -d
For associating a domain with our node, we can use whichever is preferable. The other documentations use NGINX but I'm going to try it with Caddy and make a separate post for the same.
If you have any further questions, you can reach out in dlux discord server.
If you like what I'm doing on Hive, you can vote me as a witness with the links below.
Posted with STEMGeeks