Skip to content

Instantly share code, notes, and snippets.

@RyanHendricks
Last active April 25, 2019 15:26
Show Gist options
  • Save RyanHendricks/8fdbad0e13396ab0934d854322e71472 to your computer and use it in GitHub Desktop.
Save RyanHendricks/8fdbad0e13396ab0934d854322e71472 to your computer and use it in GitHub Desktop.
Node Setup Steps
# Update and Upgrade
apt-get update && apt-get upgrade -y

# Install Nginx and Obtain SSL Certs (optional)
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install certbot python-certbot-nginx 
systemctl start nginx
systemctl start nginx.service
systemctl enable nginx.service
systemctl enable nginx
certbot --nginx

# Install Go Version Manager
sudo apt-get install curl git mercurial make binutils bison gcc build-essential
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
source /root/.gvm/scripts/gvm
gvm install go1.12.1 --binary
gvm use go1.12.1 --default

# Modify Path, Create Working Directory, Obtain source
export PATH=$PATH:$GOPATH/bin	
[[ -s "/Users/<usr>/.gvm/scripts/gvm" ]] && source "/Users/<usr>/.gvm/scripts/gvm"
mkdir -p $GOPATH/src/github.com/cosmos	
cd $GOPATH/src/github.com/cosmos	
git clone https://github.com/cosmos/cosmos-sdk	
cd cosmos-sdk

# Checkout correct branch and build
git checkout v0.34.1
git pull
make
cd ..
cd ..
cd ..
# (yes, three times, and you should see a folder called bin)
cd bin
install -m 0755 -o root -g root -t /usr/local/bin `find . -maxdepth 1 -executable -type f`
gaiad version --long
gaiacli version --long

# Digital Ocean Volume Mount (optional)
mkdir -p /mnt/a2h_sentry_two_data	
mount -o discard,defaults,noatime /dev/disk/by -id/scsi-0DO_Volume_a2h-sentry-two-data /mnt/a2h_sentry_two_data
echo '/dev/disk/by-id/scsi-0DO_Volume_a2h-sentry-two-data /mnt/a2h_sentry_two_data ext4 defaults,nofail,discard 0 0' | sudo tee -a /etc/fstab

# Env Variables for non-default --home folder
export GAIAD_HOME=/PATH/TO/YOUR/.gaiad
echo $GAIAD_HOME

gaiad init MONIKER --chain-id=cosmoshub-2	--home=$GAIAD_HOME
cd $GAIAD_HOME/config
rm genesis.json	
curl https://raw.githubusercontent.com/cosmos/launch/master/genesis.json > genesis.json
sha256sum  genesis.json

# Add seeds to config
nano config.toml
gaiad start --home=$GAIAD_HOME	

# Or Run in background ()
nohup gaiad start --home=$GAIAD_HOME > gaiadlogs.txt &
top
apt-get update
apt-get upgrade
apt-get install curl git mercurial make binutils bison gcc build-essential
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
source /root/.gvm/scripts/gvm
gvm install go1.12.1 --binary
gvm use go1.12.1 --default
export PATH=$PATH:$GOPATH/bin
[[ -s "/Users/<usr>/.gvm/scripts/gvm" ]] && source "/Users/<usr>/.gvm/scripts/gvm"
mkdir -p $GOPATH/src/github.com/irisnet/
cd $GOPATH/src/github.com/irisnet/
git clone https://github.com/irisnet/irishub
cd irishub
git checkout master
git checkout v0.13.1
git pull
make
cd $GOPATH/bin
install -m 0755 -o root -g root -t /usr/local/bin `find . -maxdepth 1 -executable -type f`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment