You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2 KiB

  1. #!/usr/bin/env bash
  2. # XXX: this script is intended to be run from
  3. # a fresh Digital Ocean droplet with Ubuntu
  4. # upon its completion, you must either reset
  5. # your terminal or run `source ~/.profile`
  6. # as written, this script will install
  7. # tendermint core from master branch
  8. REPO=github.com/tendermint/tendermint
  9. # change this to a specific release or branch
  10. BRANCH=master
  11. GO_VERSION=1.11.2
  12. sudo apt-get update -y
  13. sudo apt-get install -y make
  14. # get and unpack golang
  15. curl -O https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz
  16. tar -xvf go$GO_VERSION.linux-amd64.tar.gz
  17. # move go folder and add go binary to path
  18. sudo mv go /usr/local
  19. echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.profile
  20. # create the go directory, set GOPATH, and put it on PATH
  21. mkdir go
  22. echo "export GOPATH=$HOME/go" >> ~/.profile
  23. echo "export PATH=\$PATH:\$GOPATH/bin" >> ~/.profile
  24. source ~/.profile
  25. # get the code and move into repo
  26. go get $REPO
  27. cd "$GOPATH/src/$REPO"
  28. # build & install
  29. git checkout $BRANCH
  30. # XXX: uncomment if branch isn't master
  31. # git fetch origin $BRANCH
  32. make get_tools
  33. make get_vendor_deps
  34. make install
  35. # the binary is located in $GOPATH/bin
  36. # run `source ~/.profile` or reset your terminal
  37. # to persist the changes