在 Hyperledger Fabric v0.5-preview 中设置用于开发的网络

Setting Up a Network For Development in Hyperledger Fabric v0.5-preview

我的演示项目已经 运行 正常,但它只是网络中的一个点。我想将更多对等点添加到网络中。 我遵循了本指南 ==> https://github.com/hyperledger-archives/fabric/blob/540c4db5f64dba4bd1b18e896c96a8d17d7ec552/docs/dev-setup/devnet-setup.md.

请帮忙查看下面的日志, 目录错了?或者 运行 启动 peer 的正确方法是什么?

vagrant@hyperledger-devenv:v-:/opt/gopath/src/github.com/hyperledger/fabric$ docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp0 -e CORE_PEER_ADDRESSAUTODETECT=true hyperledger-peer peer node start
Unable to find image 'hyperledger-peer:latest' locally
Pulling repository docker.io/library/hyperledger-peer
docker: Error: image library/hyperledger-peer not found.
See 'docker run --help'.

是否有可能网络中的第一个节点不是在 Docker 容器中启动的? (例如,它可以作为一个进程使用 peer node start 启动)

我们可以验证哪些 docker 图像在 vagrant 机器中可用。只需 运行 docker images 命令:

vagrant@hyperledger-devenv:v0.0.9-b4acc4b:$ docker images
REPOSITORY                     TAG                 IMAGE ID            CREATED             SIZE
hyperledger/fabric-baseimage   latest              c1d6f4800a55        27 hours ago        1.297 GB
hyperledger/fabric-baseimage   x86_64-0.0.9        70328eed56aa        2 weeks ago         990.1 MB
busybox                        latest              47bcc53f74dc        9 weeks ago         1.113 MB

使用这样的配置,当“hyperledger-peer”镜像不可用时,Validation Peer 将不会因为“Unable to find image”错误而启动:

vagrant@hyperledger-devenv:v0.0.9-b4acc4b:/opt/gopath/src/github.com/hyperledger/fabric/peer$ docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp0 -e CORE_PEER_ADDRESSAUTODETECT=true hyperledger-peer peer node start
Unable to find image 'hyperledger-peer:latest' locally
Pulling repository docker.io/library/hyperledger-peer
docker: Error: image library/hyperledger-peer not found.

"hyperledger-peer:latest" 可以使用以下方式创建图像:

cd $GOPATH/src/github.com/hyperledger/fabric/core/container
go test -run BuildImage_Peer

现在 docker images 应该再显示一张可用图像:

REPOSITORY                     TAG                 IMAGE ID            CREATED             SIZE
hyperledger-peer               latest              438b65f18f21        8 seconds ago       1.418 GB

此时 Validation Peer 应该成功启动:

vagrant@hyperledger-devenv:v0.0.9-b4acc4b:~$ docker run —rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp0 -e CORE_PEER_ADDRESSAUTODETECT=true hyperledger-peer peer node start
21:55:51.969 [crypto] main -> INFO 001 Log level recognized 'info', set to INFO
21:55:51.970 [peer] func1 -> INFO 002 Auto detected peer address: 172.17.0.2:30303
21:55:51.971 [peer] func1 -> INFO 003 Auto detected peer address: 172.17.0.2:30303
21:55:51.972 [peer] func1 -> INFO 004 Auto detected peer address: 172.17.0.2:30303
21:55:51.974 [main] serve -> INFO 005 Security enabled status: false
21:55:51.974 [main] serve -> INFO 006 Privacy enabled status: false
…