cosmos-sdk/scripts/install/install_sdk_ubuntu.sh

41 lines
971 B
Bash
Raw Normal View History

2018-05-31 08:03:02 -07:00
#!/usr/bin/env bash
# XXX: this script is intended to be run from
# a fresh Digital Ocean droplet with Ubuntu
# change this to a specific release or branch
2018-11-14 11:05:48 -08:00
BRANCH=master
2018-11-14 12:14:13 -08:00
REPO=github.com/cosmos/cosmos-sdk
GO_VERSION=1.12.1
2018-05-31 08:03:02 -07:00
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y make
# get and unpack golang
2018-11-14 12:14:13 -08:00
curl -O https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz
tar -xvf go$GO_VERSION.linux-amd64.tar.gz
2018-05-31 08:03:02 -07:00
# move go binary and add to path
mv go /usr/local
echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.profile
2018-11-13 22:05:15 -08:00
# create the go directory, set GOPATH, and put it on PATH
mkdir go
echo "export GOPATH=$HOME/go" >> ~/.profile
2018-05-31 08:03:02 -07:00
echo "export PATH=\$PATH:\$GOPATH/bin" >> ~/.profile
echo "export GO111MODULE=on" >> ~/.profile
2018-05-31 08:03:02 -07:00
source ~/.profile
# get the code and move into repo
go get $REPO
cd $GOPATH/src/$REPO
# build & install master
git checkout $BRANCH
LEDGER_ENABLED=false make tools
2018-11-13 22:05:15 -08:00
LEDGER_ENABLED=false make install
2018-11-14 12:14:13 -08:00
source ~/.profile