Time Allotment:
- 15min-2hr to execute (depending on skill level and snags)
The following steps are a combination of the two great following resources mixed in with notes
Important: SKIP This Step UNLESS you boot from the SD Card: You'll want to start out in the /mnt/hd1
as your "home" directory, this is the external ssd hard drive, with the tons of memory for the ergo-node. It is not mentioned in the rest of the tutorial because it assumes directly mounting.
cd /mnt/hd1
Important: Whether or not you boot from the SD Card, complete the rest of these steps The node is built with Scala but is run by Java, thus we'll need to install package dependencies Java Development Kit.
Preparation, update and upgrade the rpi. Check Java SDK.
sudo apt update && sudo apt upgrade -y
sudo apt install default-jdk -y
Install the Java JDK
sudo apt install default-jdk
To check java installed properly check the version
java -version
The following steps will setup the ergo node's configuration, download the node software ".jar" file, setup and run the node.
We will then check the node is syncing with the Ergo Node Explorer site in the browser.
First, ssh back into the pi
Then once inside the rpi, change directory to the external hard drive location very important /mnt/hd1 and setup a new ergo folder.
mkdir ergo-node
cd ergo-node
From the Ergo Platform Github Release, check the latest release version.
Next, copy and paste the following line into a text file. Remove VERSION and insert the latest.
wget https://github.com/ergoplatform/ergo/releases/download/v<VERSION>/ergo-<VERSION>.jar
Note: Update the version in the above file. For copy and paste ease:
wget https://github.com/ergoplatform/ergo/releases/download/v5.0.18/ergo-5.0.18.jar
This will take a few minutes.
Note: GNU Wget is a free utility for non-interactive download of files from the Web. more
Next, setup the ergo node configuration file
nano ergo.conf
Note: sudo is super user do (admin privileges). Nano is command line to touch and edit the ergo.conf file. You will now be inside the ergo.conf file. If the file didn't exist, it was just now created.
Copy and paste the contents of the Reference ergo.conf example file into a separate text file:
ergo {
node {
mining = false
extraIndex = false
utxo {
# Download and apply UTxO set snapshot and full-blocks after that
utxoBootstrap = false
# How many utxo set snapshots to store, 0 means that they are not stored at all
storingUtxoSnapshots = 2
# How many utxo set snapshots for a height with the same id we need to find in p2p network
# in order to start downloading it
p2pUtxoSnapshots = 2
}
# Settings releated to headers-chain bootstrapping via NiPoPows
nipopow {
# Download PoPoW proof on node utxoBootstrap
nipopowBootstrap = false
#how many different proofs we are downloading from other peers
# and compare with each other, before choosing the best one
p2pNipopows = 2
}
}
}
scorex {
restApi {
# node which exposes restApi in firewall should define publicly accessible URL of it
# you will need to enable port forwarding from logging into your router for 9053
# publicUrl = "http://xxx.xxx.xxx.xxx:9053"
# apiKeyHash = "CHANGE_ME_HASH"
}
network {
# For below declared address do not include "http://"!
# you will need to enable port forwarding from logging into your router for 9030
# declaredAddress = "xxx.xxx.xxx.xxx:9030"
# nodeName = "my-ergo-node"
}
}
You'll need to make the following updates:
- extraIndex ?: If true, will basically store extra blockchain data
- Under scorex
- publicUrl - update
- apiKeyHash - update per Set API Key
- declared address - update
- nodeName - update
For light weight full node using bootstrapping and NiPoPow, see example_ergo_config_file_light.txt
Ctrl+X to overwrite config file and Yes, then enter to save.
Give it a go and run it by using the command below:
java -jar -Xmx2g ergo-<NODE>.jar --mainnet -c ergo.conf
Note: Update the version in the command above. e.g
java -jar -Xmx2g ergo-5.0.14.jar --mainnet -c ergo.conf
There's two ways to do this. Use what you feel more comfortable with:
So Swagger is a GUI to help you run commands from your full node. Before the node is up and running, use this site http://128.253.41.49:9053/swagger#/utils/hashBlake2b to generate hash. Note you can change this anytime.
- Click 'Try Out' top right.
- Enter your made up API key password (like an email password you'll need to remember)
- Make sure to type the password in between the " "
- Click 'Execute' -
- Copy your apiKeyHash, the 64 character hash in the parenthesis Response - copy and include quotes " " ergo.config file.
In terminal, copy the below command, but update hello
in the command below with a custom API password. Where instead of hello insert custom password! Keep all the quotes and backslashes. Here's an example "\"custom_password_example\""
.
curl -X POST "http://213.239.193.208:9053/utils/hash/blake2b" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "\"hello\""
Now in your node panel http://headless.local:9053/panel. click the top left "Set API Key" button and type in your password. If it matches the hash, it will work.
Type in the password in the browser node panel under "API Key". It should work.
Congrats!! You should see the node syncing now on the Ergo Node Explorer panel.