GRIN Full node and Wallet Installation Linux
GRIN is a Privacycoin. It is a cryptocurrency like Bitcoin, but with some features which allow the users to anonymously receive, send and store funds.
This guide is going to explain, how you can install a GRIN Full node and a GRIN wallet on your Linux computer.
Why?
By running your own full node, you can support the GRIN network and help it to get more stable and decentralized. The Wallet software can be used without a local full node — in this case you can connect to a different full node within the GRIN network. But the most secure way is to run your own node. You will have your own blockchain copy and your full node can verify your transactions. If you have a server, you can run the full node 24/7 to support the network. If you have a normal computer or a notebook, you can setup the full node to automatically start after every reboot and to work in the background.
Installation
First you should update your computer and the installed software to the newest version. This procedure depends on your operating system. Additionally, you can also read official GRIN documentation.
When you updated your computer, you need to download the GRIN wallet and the GRIN full node from the GRIN website. You can download the files by simply clicking on them.
After you finished the download, you should use the SHA256-hashed provided on the website to verify the downloads. In theory, your download could be modified by an error or by a malicious party to compromise your computer or lead to problems. We can calculate the SHA256-hash of each of the downloaded files and compare them to the hashes provided on the website. If both hashes are equal, we can be sure that we have downloaded the correct files. For checking the hashes automatically, we create a textfile containing the hashes in the same directory where we stored the downloaded files. We can use the command line for that:
touch SHA256sums.txt
Afterwords, we open the textfile and create two lines. Each line starts with a filehash, followed by a space and the filename. The file content could look like this:
4dd24a03be40e91cefdeb2d95a01e009d1b2b1a473beab6a50281fcbfa576f72 grin-wallet-v5.0.3-linux-amd64.tar.gz
5050879ae5869dd492c28bf38fb1b355594f0bc066b0a1325a762f1fa2d872e7 grin-v5.0.4-linux-amd64.tar.gz
Afterwards, we can run a command line program to verify the hashes
sha256sum -c SHA256sums.txt
This program scans the current directory and calculates the SHA256-hash for each individual file. Afterwards it compares the calculated hashes with the hashes provided in the file. If the files are the correct ones, we should see an output similar to this:
Afterwards, we need to unpack the files. It is recommended to unpack the files into the folder /usr/local/bin because this is the standard directory on Linux for third party software. We can unpack and copy the both files using the following commands:
sudo tar -C /usr/local/bin -xzf grin-wallet-v5.0.3-linux-amd64.tar.gz --strip-components=1
sudo tar -C /usr/local/bin -xzf grin-v5.0.4-linux-amd64.tar.gz --strip-components=1
Afterwards, we can run the GRIN full node by simply typing:
grin
Depending on your operating system, you may receive a error messag caused by a missing library. In this case, you can install the missing library by running:
sudo apt install libncursesw5 -y
Afterwards you should be able to run the GRIN full node. After starting, you should see the full node interface in the command line window. At this point, your node starts to download and verify the blockchain from other connected nodes.
Run GRIN as a background service
Now, you manually need to start the GRIN full node every time you want to run it. We can create a systemd-service to run it in the background and to start if after every reboot of the computer. First you need to edit the GRIN full node configuration file. Navigate to your home directory using your file explorer and press Ctrl + H to show hidden folders. Then go inside the .grin/main folder. This folder holds the GRIN configuration as well as the blockchain. You need to edit the file grin-server.toml. In this file, change the following line to false to enable GRIN to show the text interface after startup:
run_tui = false
Now we need to create a systemd-service file. We can create this file with the following command:
sudo nano /etc/systemd/system/grin.service
This command opens the console-based text editor nano and creates a file called grin.service in the systemd-services directory.
Paste the following code in the file. Be aware that you need to change user and group to the user which should run the GRIN node. In my case, I have a test user called ubuntu which runs the node. You can use your normal user account, or you can create a new user specifically for the GRIN node.
[Unit]
Description=GRIN Full Node background serviceWants=network.target[Service]
Type=simple
User=ubuntu
Group=ubuntu
ExecStart=/usr/local/bin/grin
Restart=on-failure
RestartSec=30
KillMode=mixed[Install]
WantedBy=default.target
Afterwards, you need to run the following lines to reload the systemd-daemon, to enable the automatic start after a reboot and to start the service. With the last command, you can check if the service runs correctly.
# Reload systemd-daemon
sudo systemctl daemon-reload# Automatically start the service after every reboot
sudo systemctl enable grin.service# Start the service
sudo systemctl start grin.service# Check the status of the service
sudo systemctl status grin.service
Finally, we can use nmap to check if the connection to the internet works correctly. nmap is a small command line tool which allows us to do a port scan on our own computer. A port is an identifier used by any application to connect to a application on a different computer over an IP network like the internet. Therefore we run:
nmap localhost -p 3414
to check port 3414 (the standard port used for GRIN) on our own computer (localhost). The port should be displayed as open.
Congratulation! Now your GRIN full node is up an running.
GRIN wallet
We can create a new wallet by running the command
grin-wallet init
Now we are forced to enter a password. This password is necessary to use this specific wallet on this computer. After we created the password, the recovery phrase consisting of 24 words is shown to us. This phrase is extremely important. You should store it in a safe place. If you loose your recovery seed, you cannot recover your wallet in case you forget your password or your computer gets damaged or stolen. If anybody else gets access to this phrase, he can recreate your wallet and steal all your funds.
Afterwards, you can create a address to receive funds by typing
grin-wallet address
You may notice, that you need to enter your password anytime you interact with your wallet. When you want to see your account balance, type
grin-wallet info
This will scan the blockchain on your connected node (in our case, your local node) for transactions linked to your wallet. If your node has not synced the blockchain completely, only the downloaded part of the blockchain will be synced. Therefore you should wait until your node has synced completely.
I hope you liked that tutorial :) In case you have any question, do not hesitate to send me an email to privatepayments1@protonmail.ch.