Skip to main content

Installation

Update your server to get the latest version

sudo apt update && sudo apt upgrade -y

Install dependencies

sudo apt install git curl wget tar lz4 unzip jq build-essential pkg-config clang bsdmainutils make ncdu -y

Install Go and Cosmovisor

Install Go

Go is a programming language allowing each node of the Cosmos ecosystem to operate.

cd $HOME
version="1.20.4"
wget "https://golang.org/dl/go$version.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$version.linux-amd64.tar.gz"
rm "go$version.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile

Check GO version, it must return : go version go1.20.4 linux/amd6

go version

Install Cosmovisor

go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest

Install Node

Install the current version of node binary.

cd $HOME
git clone https://github.com/provenance-io/provenance.git
cd provenance
git checkout v1.17.0
make install

Configure Node

Initialize Node

Please replace 'YOUR_MONIKER' with your own moniker.

provenanced init YOUR_MONIKER --chain-id pio-mainnet-1 --home $HOME/.provenanced

Download Genesis

wget -O $HOME/.provenanced/config/genesis.json "https://raw.githubusercontent.com/provenance-io/mainnet/main/pio-mainnet-1/genesis.json"

Configure Seed

Using a seed node to bootstrap is usually the best practice. Alternatively, you can use addrbook or persistent_peers.

SEEDS="40f9493fa7ab4259159240e9a8ba12f90743079b@seed.provenance.io:26656"
sed -i -e "s|^seeds *=.*|seeds = \"$SEEDS\"|" $HOME/.provenanced/config/config.toml

Download Snapshot

We provide instructions for installing with our snapshot. Alternatively you can use State-sync.

Install lz4 if needed

sudo apt update
sudo apt install snapd -y
sudo snap install lz4

Download the snapshot

curl -L  https://snap.blockval.io/provenance/pio-mainnet-1_latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.provenanced

Launch Node

Configure Cosmovisor Folder

Create Cosmovisor folders and load the node binary.

# Create Cosmovisor Folders
mkdir -p ~/.provenanced/cosmovisor/genesis/bin
mkdir -p ~/.provenanced/cosmovisor/upgrades

# Load Node Binary into Cosmovisor Folder
cp ~/go/bin/provenanced ~/.provenanced/cosmovisor/genesis/bin

Create Service File

Create a provenance.service file in the /etc/systemd/system folder with the following code snippet. Make sure to replace USER with your Linux user name. You need sudo previlege to do this step.

[Unit]
Description="provenance node"
After=network-online.target

[Service]
User=USER
ExecStart=/home/USER/go/bin/cosmovisor run start --home /home/USER/.provenanced/
Restart=always
RestartSec=3
LimitNOFILE=4096
Environment="DAEMON_NAME=provenanced"
Environment="DAEMON_HOME=/home/USER/.provenanced"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target

Start Node Service

# Enable service
sudo systemctl enable provenance.service

# Start service
sudo service provenance start

# Check logs
sudo journalctl -fu provenance