CLI - Set Up
Set up the environment on your computer, and install Sifnode.
Set up your Environment
Thanks to the Cosmos hub for their stellar documentation about using the CLI to interact with Cosmos chains. Sifchain is built on the Cosmos SDK.
Build Requirements
At present, the CLI fully supports installation on linux distributions. For the purpose of this instruction set, we'll be using Ubuntu 20.04.3 LTS. It is also possible to install on Unix, while Windows may require additional unsupported third party installation (eg. Install WSL and then use it to follow the Linux Instructions). All steps are listed below for a clean install.
Linux:
Update the local package list and install any available updates:
sudo apt-get update && sudo apt upgrade -yInstall make and gcc, ensure correct time sync
sudo apt-get install make build-essential gcc git jq chrony -yUnix (Mac):
Ensure you have installed homebrew. Then update and upgrade it:
brew update
brew upgradeNow install gcc
brew info gcc
brew install gcc
brew cleanup //(this removes previous application/dependency revisions saving considerable space)Install make
brew install make2) Install Go (1.17.7+ is required for Sifchain)
Linux: You can follow these docs to install Go.
The current version required is go 1.17.7 and you can download by launching:
wget https://golang.org/dl/go1.17.7.linux-amd64.tar.gzand then installing it in the local directory:
sudo tar -C /usr/local -xzf go1.17.7.linux-amd64.tar.gzUnix:
brew install go3) Add the GOPATH
After installing Go, ensure that you add GOPATH to your PATH variable so that we can run the sifnoded binary.
Linux:
Open the profile file (~/.profile) :
nano ~/.profileadd the following:
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/binApply the changes on the current shell:
source ~/.profileUnix:
Open the profile file (~/.profile) :
nano ~/.bash_profileadd the following:
export GOROOT=opt/homebrew/bin/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/binApply the changes on the current shell:
source ~/.bash_profileOr alternatively, launch this command everytime you open the shell:
export PATH=$PATH:/usr/local/go/bin4) Install Sifnoded
Next, we need to install the Sifnode binaries:
git clone "https://github.com/Sifchain/sifnode"Move to the newly installed folder
cd sifnodeCompile and install a non-archive node:
git checkout v0.13.3 && make clean installTroubleshooting
You may encounter an error here:
go: cannot find GOROOT directory: /usr/local/goIn this instance, from terminal run:
which goThis will return the path to you Go Root directory. If it is not /usr/local/go, copy the path. Now return to step 3 above, "Add the GOPATH", and update the .profile file with the correct path to GOROOT. Save it - you may need to restart terminal for the changes to take effect.
5) Create a wallet
From within the ~/sifnode folder, create a wallet:
sifnoded keys add <wallet name>
You will be asked to create a passphrase. This will protect the mnemonic that will be generated. Remember to safely back up the mnemonic Note:
If your transaction throws any error, make sure to add the necessary flags. Some of the flags you may need are:
Some useful flags:
--chain-id string The network chain ID
--fees string Fees to pay along with transaction
--from string Name or address of private key with which to sign
--keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory)
--node string <host>:<port> to tendermint rpc interface for this chain
Logs flag:
--log_format string The logging format (json|plain) (default "plain")
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--trace print out full stack trace on errors
Last updated