Ontology install guide
1. Set Go install
1.1 download page
- 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
1.2 unpack
tar -C /usr/local -xzf go1.9.4.linux-amd64.tar.gz
1.3 make some lib for ontology/gopath
mkdir /opt/gopath
mkdir /opt/gopath/test
1.4 environment variables needed by other scripts & env Bashrc setup
- 設置環(huán)境變量
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"
- 退出并使生效
source /root/.bashrc
1.5 glide install
go get github.com/Masterminds/glide
1.6 clone & install script
cd /opt/gopath/test
vim install.sh
填入如下內(nèi)容
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
1.7 create config(solo)
copy https://github.com/ontio/ontology/blob/master/config-solo.json to /opt/gopath/test lib
1.8 start script
cd /opt/gopath/test
vim ./start.sh
填入如下內(nèi)容
#! /bin/bash
./ontology <<EOF
passwordtest
EOF
chmod +777 ./start.sh
1.9 create account
./nodectl wallet --create --name wallet.dat --password passwordtest
2.0 list account
./nodectl wallet --list account --password passwordtest
2.1 update config
- change Bookkeepers to your own account's public key
2.3 start your solo node
cd /opt/gopath/test
bash ./start.sh
2.4 list account money
./nodectl wallet --list -b --password passwordtest
2.5 send ont
./nodectl transfer --contract ff00000000000000000000000000000000000001 --value 10 --from 0181beb9cfba23c777421eaf57e357e0fc331cbf --to 01f3aecd2ba7a5b704fbd5bac673e141d5109e3e