Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
bash script for installing go and gaia cosmoshub-1 on Ubuntu
# Upgrade the system and install go
sudo apt update
sudo apt upgrade -y
sudo apt install gcc git make -y
sudo snap install --classic go
sudo mkdir -p /opt/go/bin
# Export environment variables
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH
# Create a system user for running the service
sudo useradd -m -d /opt/gaiad --system --shell /usr/sbin/nologin gaiad
sudo -u gaiad mkdir -p /opt/gaiad/config
# Get Cosmos SDK and build binaries
go get
cd $HOME/go/src/
git fetch --all
git checkout -f v0.34.1
make install
# Copy the binaries to /opt/go/bin/
sudo cp $HOME/go/bin/gaia* /opt/go/bin/
# Create systemd unit file
echo "[Unit]
Description=Cosmos Gaia Node
ExecStart=/opt/go/bin/gaiad start --home=/opt/gaiad/
[Install]" > gaiad.service
sudo mv gaiad.service /etc/systemd/system/
sudo systemctl enable gaiad.service
# Create the config skeleton as user gaiad
sudo -u gaiad /opt/go/bin/gaiad unsafe-reset-all --home=/opt/gaiad
echo "You can copy the genesis.json file to /opt/gaiad/config and edit the /opt/gaiad/config/config.toml."
echo "Run 'sudo service gaiad start' to start the service."

This comment has been minimized.

Copy link

chris-remus commented Jun 25, 2018

Suggestions -

echo "You can copy the genesis.json file to /opt/gaiad/config and edit the /opt/gaiad/config/config.toml."

Add a note -

-about where to find the genesis.json file to copy into /opt/gaiad/config

-how to edit config.toml, i.e. moniker, seeds and persistent peers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.