设置Hyperledger Fabric

时间:2016-06-01 12:28:49

标签: blockchain hyperledger hyperledger-fabric

我尝试设置Hyperledger Fabric项目。不幸的是,当我调用 vargant up 时,我得到了:

Bringing machine 'default' up with 'virtualbox' provider...
 ==> default: Box 'hyperledger/fabric-baseimage' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: 0.0.10
The box 'hyperledger/fabric-baseimage' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:

URL: ["https://atlas.hashicorp.com/hyperledger/fabric-baseimage"]
Error: SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

我尝试使用docker image https://hub.docker.com/r/hyperledger/fabric-baseimage/但是运行命令没有做任何事情

我想启动Fabric Blockchain,尝试管理系统,部署合同并启动一些测试事务。任何人都可以帮助我,如何启动Fabric?

由于

4 个答案:

答案 0 :(得分:3)

此处列出的错误非常清楚,并提供了解决方案的链接。 Vagrant无法下载图像,因为本地CA没有携带颁发HashiCorp服务器证书的CA证书。

如果您只想运行Hyperledger Fabric并开发/部署链代码并开发区块链应用程序,只需使用Docker for Mac或Windows(beta版)运行以下docker-compose.yml定义docker-compose up即可。 ):

vp:
  image: hyperledger/fabric-peer
  ports:
  - "5000:5000"
  environment:
  - CORE_PEER_ADDRESSAUTODETECT=true
  - CORE_VM_ENDPOINT=http://127.0.0.1:2375
  - CORE_LOGGING_LEVEL=DEBUG
  command: peer node start
membersrvc:
  image: hyperledger/fabric-membersrvc
  command: membersrvc

基于Vagrant的开发环境方法让您的笔记本电脑上运行Fabric,实际上更倾向于希望帮助开发Hyperledger Fabric项目的开发人员,而不是那些只希望使用该平台开发应用程序的开发人员。

答案 1 :(得分:1)

我建议你重新安装。

  1. 流浪汉摧毁。它将停止并删除所有流浪机的痕迹。
  2. 流浪汉。启动并规定流浪者环境。

答案 2 :(得分:1)

请尝试以下说明: http://hyperledger-fabric.readthedocs.io/en/latest/dev-setup/devenv.html

我使用GitHub的超级分层结构的分支v0.6代替 Gerrit一个(步骤“克隆Fabric项目”): git clone -b v0.6 https://github.com/hyperledger/fabric.git

当VM配置最后完成时,您将拥有一个可用于测试链码的环境。

环境完成后,您还应该查看GitHub IBM-Blockchain弹珠应用程序。

希望这对你有用,祝你好运。

答案 3 :(得分:-2)

打开此链接:https://atlas.hashicorp.com/hyperledger/boxes/fabric-baseimage

使用以下命令:

from threading import Thread
import time

class MyThread(Thread):
    def __init__(self):
        Thread.__init__(self)
        self.start()

    def run(self):
        while (True):
            self.foo()
            time.sleep(1)

    def foo(self):
        print("foo !")

my = None

while True:
    user_input = raw_input("What do I do ? ")

    if user_input == "start thread":
        #Will start a threat that prints foo every second.
        if my == None: 
            print("Starting thread...")
            my = MyThread()
        else:
            print("Thread is already started.")

    elif user_input == "hello":
        print("Hello !")

    else:
        print("This is not a correct command.")