ontology - Install

2018-04-17  本文已影响0人  Xtar

install by source

1.1. Setup Go

1.1.1 download golang

https://golang.org/dl/

  • macos
https://dl.google.com/go/go1.9.4.darwin-amd64.tar.gz
  • linux
wget https://dl.google.com/go/go1.9.4.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.9.4.linux-amd64.tar.gz

1.2 Setup ENV & work lib

1.2.1 the compile output lib is set to test , you can also change it as you like.
mkdir /opt/gopath
mkdir /opt/gopath/test
1.2.2 environment variables needed by other scripts & env Bashrc setup
vim /root/.bashrc   ///etc/profile
export PATH=$PATH:/usr/local/go/bin
export GOBIN=/usr/local/go/bin
export GOROOT=/usr/local/go
export GOPATH="/opt/gopath"
wq!
source /root/.bashrc

1.3 install glide(imports manager)

go get github.com/Masterminds/glide

1.4 clone & install ontology

you can use below script to fast clone & install

cd /opt/gopath/test
vim install.sh
set -e
set -x

rm /opt/gopath/src/github.com/ontio -rf;
mkdir /opt/gopath/src/github.com/ontio;
cd /opt/gopath/src/github.com/ontio;
git clone https://github.com/ontio/ontology.git;
cd /opt/gopath/src/github.com/ontio/ontology;glide install;
go build -o /opt/gopath/test/ontology main.go;
go build -o /opt/gopath/test/nodectl nodectl.go;
cd /opt/gopath/test;

chmod +777 ./install.sh
bash ./install.sh

install by binary

上一篇 下一篇

猜你喜欢

热点阅读