Skip to content

Instantly share code, notes, and snippets.

@joeabbey
Last active February 15, 2022 18:47
Show Gist options
  • Save joeabbey/5f43e417484e71a5d520cdbc95251f49 to your computer and use it in GitHub Desktop.
Save joeabbey/5f43e417484e71a5d520cdbc95251f49 to your computer and use it in GitHub Desktop.
Quickly Setup an Osmosis Node
#!/bin/bash
export MONIKER="$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13 ; echo '')"
# Install tooling
sudo apt-get update && sudo apt upgrade -y
sudo apt-get install make build-essential gcc git jq chrony -y
wget -4 https://golang.org/dl/go1.17.5.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.17.5.linux-amd64.tar.gz
cat <<EOF >> ~/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source ~/.profile
go version
# Create a service for osmosis
sudo tee /etc/systemd/system/osmosis.service > /dev/null <<EOF
[Unit]
Description=Osmosis Mainnet
After=network-online.target
[Service]
User=$USER
ExecStart=$HOME/go/bin/osmosisd start
Restart=on-failure
RestartSec=10
LimitNOFILE=infinity
Environment="DAEMON_NAME=osmosisd"
Environment="DAEMON_HOME=$HOME/.osmosisd"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_LOG_BUFFER_SIZE=512"
Environment="UNSAFE_SKIP_BACKUP=true"
[Install]
WantedBy=multi-user.target
EOF
# Build Chain
cd $HOME
git clone https://github.com/osmosis-labs/osmosis
cd osmosis
git checkout v6.1.0 -b v6.1.0
make install
# Rapidly statesync
bash ./scripts/statesync.sh
sudo systemctl daemon-reload
sudo systemctl enable osmosis
sudo systemctl restart osmosis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment