Previously, we did a tutorial on how to set up a ZooBC node on the Ubuntu machine and virtual private server or VPS. In today’s tutorial, I’m going to help you learn how to install the ZooBC node on the Raspberry Pi. Theoretically, it should be identical, yet somebody tells me some of the processes might go differently, so without further ado, let’s just start the demonstration, shall we?
- Make sure the Raspberry Pi is connected to WiFi. After we have the internet connection in place, let’s open our terminal and access our SSH by using the following command:
$ ssh root@IPAddress
This has automatically turned the Raspberry Pi as a system root.
- First, make a new directory by using command:
$ mkdir zoobc
Then, go inside the directory :
$ cd zoobc
- Now, we need to Install the installer:
- Next, we need to make turn the file into an executable one by running this command below:
$ chmod +x zbcsetup.sh
- Now, let’s launch the server:
$ ./zbcsetup.sh mainnet
Now that the script is already up and running, it will recognize that we are running on a Raspberry Pi and, in response, downloading the correct binary.
- Similar to the one that we did on a Linux server, once the script has finished downloading, it will then ask you to provide information on the PORT. Yet, because we are still going to use the default setting, for now we can just click “enter”.
- Now, the system will ask you for inputs using a certificate or owner address, same as the last one, we are going to use the second option,: the account address.
On the other hand, let’s go to ZooBC.one and let’s create a new ZooBC account for this tutorial and call it “RasPi”, same like before, using the same account address; you just need tocopy the address to input it to our terminal, and enter.
- At this point we’re gonna check whether the software has already been up and running. In order to check the activity status of the software, we can just type the following commands:
$ sudo /root/zoobc.setup/zoobc.mainnet/zoobc daemon install
$ sudo /root/zoobc.setup/zoobc.mainnet/zoobc daemon start
To see the activity status of the software, use the following command:
$ sudo /root/zoobc.setup/zoobc.mainnet/zoobc daemon status
Once you’ve verified that the status is already running, so in theory at least, there should be no problems with the node.
- Next let’s go inside the ZooBC mainnet directory by using the following command:
Then, we’ll list all the files down inside the directory using the following command line:
$ ls -alsh
Here, we have our configuration files and resources in two binaries.
- Let’s test it again with the following command:
$ ./zcmd -h
Then we have all different functionalities to interact with the nodes,
- And if we enter the command into the directory resource, you can find all the database which has been created
$ cd resource/
Then, to see all the files in the database, use the following command
$ ls -alsh
- If we go inside the log directory, we will see the following…
$ cd .log
You can see some logs have already been recorded there. And let’s go back into the resource using the following command:
$ cd ..
- Let’s test the site now; you can access it using the following command:
And you can see that using the command written above has resulted in a system error. This happens because we have not installed the system yet, so, for starter, we need to install it first with an apt-get command line:
$ apt-get install sqlite3
Now, having already installed the system, let’s try again using the following command:
As you can see, we have successfully installed it!
- Next, let’s try to opening the table. But, before we do that, first of all we need to connect to the database, using the following command:
sqlite> .open /root/zoobc/zoobc.mainnet/resource/zoobc.db
As you can see, by now we have been able to successfully access the database. As you can see from the image above: all the tables in the database have already appeared there.
- To see what fields are available in the database, let’s test the schema of the main block
sqlite> .schema main_block
From there, you can see the information about the ID, the block height
- We also can SELECT max (height) FROM the main_block, which shows it still at 0, which means that the node is not updated to the Raspberry Pi. Probably, the router needs to let the port forward the correct internal IP address, but that is for another tutorial!
In this step, we have basically done installing ZooBC nodes in the Raspberry Pi. To see more of the step-by-step process you can check our Youtube video or click link here