Setup
Install dependencies
-
Add the Golang PPA repository to get the latest version of Golang
sudo add-apt-repository ppa:longsleep/golang-backports
-
Update the packages list
sudo apt-get update
-
Install Golang and other required packages
sudo apt-get install --yes curl git golang-go jq make unzip
-
Export Golang environment variables
Tip
Append the below lines to the file
${HOME}/.bashrc
and execute the commandsource ${HOME}/.bashrc
to reflect in the current Terminal sessionexport GOROOT=/usr/lib/go export GOPATH=${HOME}/go export GOBIN=${GOPATH}/bin export PATH=${PATH}:${GOROOT}/bin:${GOBIN}
Install sentinelhub software
git clone https://github.com/sentinel-official/hub.git "${HOME}/sentinelhub"
cd "${HOME}/sentinelhub"
git checkout <ENTER_TAG>
make install
sudo ln -s "${GOBIN}/sentinelhub" /usr/local/bin/sentinelhub
Initialize the Sentinel Hub
sentinelhub init --chain-id sentinelhub-2 "<SET_MONIKER>"
curl -fsLS -o "${HOME}/genesis.zip" "https://raw.githubusercontent.com/sentinel-official/networks/main/sentinelhub-2/genesis.zip"
unzip -d "${HOME}/.sentinelhub/config/" "${HOME}/genesis.zip"
rm "${HOME}/genesis.zip"
Update the node config
-
Open
config.toml
file with a text editorvim ${HOME}/.sentinelhub/config/config.toml
-
Get the peers and seeds from here and set them
[p2p] persistent_peers = "<SET_PEERS>" seeds = "<SET_SEEDS>"
-
Open
app.toml
file with a text editorvim "${HOME}/.sentinelhub/config/app.toml"
-
Get minimum gas prices from here and set it
minimum-gas-prices = "<SET_MINIMUM_GAS_PRICES>"
Add a systemd unit file
-
Open the
sentinelhub.service
file with a text editorsudo vim /etc/systemd/system/sentinelhub.service
-
Paste the below text
[Unit] Description=Sentinel Hub Daemon After=network.target [Service] Type=simple ExecStart=sentinelhub start Restart=on-failure StartLimitInterval=0 RestartSec=5 LimitNOFILE=1048576 LimitMEMLOCK=2048132 [Install] WantedBy=multi-user.target
-
Reload the systemd Daemon
sudo systemctl daemon-reload
-
Enable autostart of Sentinel Hub service
sudo systemctl enable sentinelhub.service