forked from blockchainvn/hyperledger-fabric-swarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·41 lines (35 loc) · 990 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
BASE_DIR=$PWD
if [ ! -d "$GOPATH" ];then
ARCH=`uname -s | grep Darwin`
if [ "$ARCH" == "Darwin" ]; then
if [ ! `command -v go` ]; then
brew install go
fi
else
if [ ! `command -v go` ]; then
apt install golang-go -y
fi
apt install libtool libltdl-dev -y
fi
apt install libtool libltdl-dev
mkdir -p /opt/gopath/src
export GOPATH=/opt/gopath
fi
if [ ! -d "$GOPATH/src/github.com/hyperledger" ];then
cd $GOPATH/src
mkdir -p github.com/hyperledger
cd github.com/hyperledger
git clone -b release-1.1 https://github.com/hyperledger/fabric.git
fi
cd ${GOPATH}/src/github.com/hyperledger/fabric/
make configtxgen
make cryptogen
# check combind of 2 results
echo "===================== Crypto tools built successfully ===================== "
echo
echo "Copying to bin folder of network..."
echo
# make sure folder exists
mkdir -p $BASE_DIR/bin
cp ./build/bin/configtxgen $BASE_DIR/bin
cp ./build/bin/cryptogen $BASE_DIR/bin