1. 首页
  2. 技术

fabric:建立第一个网络

搭建环境

安装curl、docker、docker-compose、go。

注意:将当前用户加入docker组以避免执行命令时重复输入sudo

sudo gpasswd -a ${USER} docker

配置GO

vi ~/.bash_profile

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOROOT/bin:$PATH

部署示例代码

mkdir -p $GOPATH/src/github.com/hyperledger
cd $GOPATH/src/github.com/hyperledger

git clone https://github.com/hyperledger/fabric-samples.git
cd fabric-samples

curl -sSL https://goo.gl/Gci9ZX | bash
或
wget https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap-1.0.2.sh
sudo bash bootstrap-1.0.2.sh

Build Your First Network

cd first-network
./byfn.sh -h
./byfn.sh -m generate
./byfn.sh -m up
./byfn.sh -m down

参考文章:http://hyperledger-fabric.readthedocs.io/en/release/build_network.html

该内容来自于互联网公开内容,非区块链原创内容,如若转载,请注明出处:https://htzkw.com/archives/3955

联系我们

aliyinhang@gmail.com