Hi! if you have a small VPS and want to contribute to Grin by running a public node… I wrote a small python script to download the latest Grin++ release and extract the binary file of the node into a desired folder. The bash script can be find here. You will need python3 to run the script. You can run it like this:
# python3 grinpp_downloader.py --help
usage: grinpp_downloader.py [-h] [--prelease] -d DESTINATION -b BINARY
Grin++ Downloader
optional arguments:
-h, --help show this help message and exit
--prelease Download prelease if the prelease is the latest release (default: false)
required named arguments:
-d DESTINATION, --destination DESTINATION
Destination folder
-b BINARY, --binary BINARY
Name of the binary
Let’s make sure you have what you need:
$ sudo apt install -y curl jq python3
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version (3.8.2-0ubuntu2).
curl is already the newest version (7.68.0-1ubuntu2.7).
jq is already the newest version (1.6-1ubuntu0.20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$
To get the script you can use curl. The URL of the raw file might change, so I do recommend to double check the url:
$ curl --silent -O https://gist.githubusercontent.com/davidtavarez/38714c9b5267642d922a809e43ea0822/raw/1ecb0af8edd5f3233e35bb7ea4f6047e17c62754/grinpp_downloader.py
Excellent! Now let’s run the script:
$ python3 grinpp_downloader.py --prelease --destination /usr/bin --binary grin
Getting the latest release...
Getting assets for v1.2.7-beta.1...
Downloading GrinPlusPlus-1.2.7-beta.1.AppImage file...
Extracting Grin node...
Stopping Grin node...
Cleaning up peers database...
Copying GrinNode binary...
Copying tor folder...
Assigning execution permissions...
Removing unnecesary files...
Done.
Tip: Start Grin node in brackground by executing the next command:
nohup /usr/bin/grin > /dev/null 2>&1 &
To run the node in background you could run it like this:
$ nohup /usr/bin/grin > /dev/null 2>&1 &
With nohup
we make sure that the node will remain running after we logout.
The last step is to make sure that the node is running:
$ ps -ax | grep grin && curl -s http://127.0.0.1:3413/v1/status | jq
748 ? Sl 6:41 /usr/bin/grin
47308 pts/0 S+ 0:00 grep grin
{
"chain": {
"hash": "0001255cf5ddf2d6ea6cd7c3366e4f619a4271efa2b1f4bbf77ac9a983ce2b1d",
"height": 1575018,
"previous_hash": "0001b128a386eb979926fedb76cd47ef2023afdab0da9078057a8b2f9ae2f1a1",
"total_difficulty": 1876778791393289
},
"header_height": 1575018,
"network": {
"height": 1575018,
"num_inbound": 50,
"num_outbound": 10,
"total_difficulty": 1876778791393289
},
"protocol_version": 1000,
"state": {
"download_size": 0,
"downloaded": 0,
"processing_status": 0
},
"sync_status": "FULLY_SYNCED",
"user_agent": "Grin++ 1.2.7"
}
Make sure to allow incoming transactions on port 3414 to serve others. Example:
If you want to manage the number of peers, open the config file here: ~/.GrinPP/MAINNET/server_config.json
and set the MAX_PEERS
, and MIN_PEERS
values. Example:
{
"P2P":{
"MAX_PEERS":60,
"MIN_PEERS":10
},
"WALLET":{
"DATABASE":"SQLITE",
"MIN_CONFIRMATIONS":10
}
}