Search
⌃K

Installation Steps

Obtaining the binary can be done by either of the following methods:

Download Binary from GitHub

  1. 1.
    First make sure you have golang installed and $PATH is pointing to where go binary is installed. Also set the $GOPATH environment variable.
  2. 2.
    Head over to the Releases Page and download the latest version of the Onomy Binary.
    • Default structure for Onomy files:
$HOME
|- .onomy (Default home location for onomy chain)
|- bin (Default location for all the binaries)
|- scripts (Default location of all the scripts)
|- src (Default location for source code, in case binaries are compiled locally)
3. Copy the downloaded binary to $HOME/.onomy/bin directory and add executable permission chmod +x onomyd
4. Add $HOME/.onomy/bin to $PATH environment variable. export PATH=$PATH:$HOME/.onomy/bin
5. To make changes in PATH variable persistent, run the following command, which will add an export command to your .bashrc file. echo "export PATH=$PATH:$HOME/.onomy/bin" >> ~/.bashrc

Compile Binary Locally Using Script

  1. 1.
    Download the bin.sh script wget https://raw.githubusercontent.com/onomyprotocol/onomy/main/deploy/scripts/bin-mainnet.sh
  2. 2.
    Add the executable permission using chmod +x bin-mainnet.sh
  3. 3.
    Run the script using bash bin-mainnet.sh
  4. 4.
    Restart terminal so changes made in environment can take effect
This script downloads and compiles Onomy binary. A new directory .onomy will be created in your home directory. All the source code will be downloaded in the .onomy/src directory. Compiled binary will be in .onomy/bin directory.

Compile Binary Manually

  1. 1.
    Create onomy Directory Tree
We can start a full node with Cosmovisor which changes and uses new binary automatically after a chain upgrade.
mkdir –p .onomy/bin
Create Cosmovisor directory if using Cosmovisor
mkdir –p .onomy/cosmovisor
  1. 2.
    Install Necessary Packages
Install packages needed to build Onomy binary.
This example is for ubuntu based systems
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install curl nano ca-certificates tar git jq perl python3 moreutils wget nodejs make hostname crudini cmake -y
  1. 3.
    Install GO
Download the latest version of Go and extract it.
curl -LO https://go.dev/dl/go1.20.1.linux-amd64.tar.gz
tar -C $HOME -xzf go1.20.1.linux-amd64.tar.gz
Setup environment variables
export PATH=$PATH:$HOME/go/bin
export GOPATH=$HOME/go
Check if go installation is working
go version
  1. 4.
    Compile Onomy
Download onomy repo and compile binary
git clone -b v1.0.1 https://github.com/onomyprotocol/onomy.git
cd onomy
make build
If using Cosmsovisor, move the binary to Cosmovisor directory
mv onomyd $HOME/.onomy/cosmovisor/genesis/bin/onomyd
Otherwise, we move it to bin directory
mv onomyd $HOME/.onomy/bin/onomyd
  1. 5.
    Compile Cosmovisor
Download and compile Cosmovisor
git clone -b cosmovisor-v1.0.1 https://github.com/onomyprotocol/onomy-sdk
cd onomy-sdk
make cosmovisor
cp cosmovisor/cosmovisor $HOME/.onomy/bin/cosmovisor
  1. 6.
    Post-installation
Make binaries executable
chmod +x $ONOMY_HOME/bin/*
chmod +x $ONOMY_HOME/cosmovisor/genesis/bin/*
Add onomy paths to PATH variable
export PATH=$PATH:$HOME/.onomy/bin
export PATH=$PATH:$HOME/.onomy/cosmovisor/genesis/bin
Add to bashrc to make changes persistent
echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH" >> ~/.bashrc
These variables are needed only for Cosmovisor
echo "export DAEMON_HOME=$ONOMY_HOME/" >> ~/.bashrc
echo "export DAEMON_NAME=onomyd" >> ~/.bashrc
echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> ~/.bashrc
NOTE: Do not run the script as a super user. If you run script as a super user, then the .onomy directory will be created in home directory of super user. Script will ask for super user privileges while installing and updating packages.