Script to automate setup
✅
Note: We will be releasing a TUI installer program that will allow for an guided, quick and easy method of setting up an OLLO node and/or validator. In the meantime, you can optionally use this script to automate the setup and network sync of a local OLLO node.
Run a node with state sync
Below is a script to automate the setup & sync of a node for state sync. Copy and paste the below into your terminal, ensuring you change "<YOUR-MONIKER>"
to your desired node name.
# 1. Clone the OLLO network repository, and install it to $GOPATH/bin/ollod
echo "---------- Cloning OLLO network repository ---------- "
git clone https://github.com/OLLO-Station/ollo -b v0.0.1 --single-branch
cd ./ollo
make install
# 2. Initialize your node on the ollo-testnet-0 chain with your custom moniker
echo "---------- Initializing OLLO node directory ---------- "
ollod init --chain-id "ollo-testnet-1" "<YOUR-MONIKER>"
# 3. Download a copy of the OLLO genesis and OLLO addressbook to your OLLO config directory
echo "---------- Gathering genesis and peer address book ---------- "
wget -qO $HOME/.ollo/config/genesis.json \
https://github.com/OLLO-Station/networks/raw/master/ollo-testnet-1/genesis.json
wget -qO $HOME/.ollo/config/addrbook.json \
https://github.com/OLLO-Station/networks/raw/master/ollo-testnet-1/addrbook.json
# 4. Enable state sync with the latest block height & trust hash
echo "---------- Gathering latest block info & rpc info ---------- "
RPC1="http://18.144.61.148:26657"; \
RPC2="http://52.8.174.235:26657"; \
LATEST_HEIGHT=$(curl -s $RPC1/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "$RPC1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash); \
echo "OLLO network latest height: $LATEST_HEIGHT"
echo "State sync block height: $BLOCK_HEIGHT"
echo "Corresponding state sync block hash: $TRUST_HASH"
# 5. Insert these values into the ~/.ollo/config/config.toml file
echo "---------- Configuring node with state sync values ---------- "
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true|" ~/.ollo/config/config.toml ; \
sed -i.bak -E "s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$RPC1,$RPC2\"|" ~/.ollo/config/config.toml;\
sed -i.bak -E "s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT|" ~/.ollo/config/config.toml; \
sed -i.bak -E "s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" ~/.ollo/config/config.toml
# 6. Create, enable, and start a systemd service file to allow your node to run in the background
echo "---------- Creating and starting OLLO service ---------- "
sudo systemctl enable ollod
sudo systemctl daemon-reload
sudo systemctl restart ollod
# 7. See the node output through systemd journal
echo "---------- To see node output, run journalctl -fu ollod -o cat ---------- "
journalctl -fu ollod -o cat
Run a node with Fast Sync
Below is a script to automate the setup & sync of a node for fast sync. Copy and paste the below into your terminal, ensuring you change "<YOUR-MONIKER>"
to your desired node name.
# 1. Clone the OLLO network repository, and install it to $GOPATH/bin/ollod
echo "---------- Cloning OLLO network repository ---------- "
git clone https://github.com/OLLO-Station/ollo -b v0.0.1 --single-branch
cd ./ollo
make install
# 2. Initialize your node on the ollo-testnet-0 chain with your custom moniker
echo "---------- Initializing OLLO node directory ---------- "
ollod init --chain-id "ollo-testnet-1" "<YOUR-MONIKER>"
# 3. Download a copy of the OLLO genesis and OLLO addressbook to your OLLO config directory
echo "---------- Gathering genesis and peer address book ---------- "
wget -qO $HOME/.ollo/config/genesis.json \
https://github.com/OLLO-Station/networks/raw/master/ollo-testnet-1/genesis.json
wget -qO $HOME/.ollo/config/addrbook.json \
https://github.com/OLLO-Station/networks/raw/master/ollo-testnet-1/addrbook.json
You should now be ready to run ollod start
Run a node as a service
💡
Note: This section of the docs is under construction