简体   繁体   English

创世区块创建失败(Hyperledger Fabric)

[英]Failure to create Genesis Block (Hyperledger fabric)

This is my first post on Stackoverflow.这是我在 Stackoverflow 上的第一篇文章。 Please bear with me... I am new to basically everything around hyperledger-fabric.请耐心等待......我对超级账本结构的一切基本上都是新手。 While trying to follow the "Writing Your First Application Tutorial" i am unable to generate the genesis block.在尝试遵循“编写您的第一个应用程序教程”时,我无法生成创世块。

I am running:我在跑步:

windows 10窗口 10

Docker version 18.03.0-ce, build 0520e24302 Docker 版本 18.03.0-ce,构建 0520e24302

docker-compose version 1.20.1, build 5d8c71b2 docker-compose 版本 1.20.1,构建 5d8c71b2

npm 6.1.2 npm 6.1.2

node.js v12.1 node.js v12.1

python 2.7蟒蛇 2.7

I used the curl commands given in the instructions.我使用了说明中给出的 curl 命令。

When i run ./startFabric.sh javascript at first everything is going ok.当我首先运行./startFabric.sh javascript时一切正常。 I am getting some warnings but starting the Channel seems to work fine.我收到了一些警告,但启动频道似乎工作正常。 In the next few lines however i am getting an error.但是在接下来的几行中,我遇到了错误。

Generate CCP files for Org1 and Org2 /c/Users/Jonathan/Hyperledger_Fabric/fabric-samples/bin/configtxgen Generating Orderer Genesis block CONSENSUS_TYPE=solo + '[' solo == solo ']' + configtxgen -profile TwoOrgsOrdererGenesis -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block 2019-11-25 10:35:01.676 CET [common.tools.configtxgen] main -> INFO 001 Loading configuration 2019-11-25 10:35:01.677 CET [common.tools.configtxgen.localconfig] Load -> PANI 002 Error reading configuration: Unsupported Config Type "" 2019-11-25 10:35:01.679 CET [common.tools.configtxgen] func1 -> PANI 003 Error reading configuration: Unsupported Config Type "" panic: Error reading configuration: Unsupported Config Type "" [recovered] panic: Error reading configuration: Unsupported Config Type ""

It seems that the configuration is missing/not the right "type".似乎缺少配置/不是正确的“类型”。 I googled my error and came up with people having similar/the same issue but i havent been able to solve my issue by following the advice they were given (hence why i am here).我在谷歌上搜索了我的错误,并提出了有类似/相同问题的人,但我无法按照他们给出的建议解决我的问题(因此我在这里)。 Similar posts i found:我发现的类似帖子:

The people responding to the posts above generally seem to think its an issue regarding the path to the config file which apparently can be fixed with回复上述帖子的人通常似乎认为这是一个关于配置文件路径的问题,显然可以用

FABRIC_CFG_PATH=$PWD

But that hasnt worked for me.但这对我没有用。

Full Console Output: https://pastebin.com/CHxjZ1Uq完整的控制台输出: https : //pastebin.com/CHxjZ1Uq

Look at the warning at the start: you are missing some prerequisites.查看开始时的警告:您缺少一些先决条件。

First, use the generate script to generate the crypto-config and artifacts folder.首先,使用 generate 脚本生成 crypto-config 和 artifacts 文件夹。 Once you got your certificates you can start fabric.获得证书后,您就可以开始使用 Fabric。

You should have a generte.sh script or something like that.你应该有一个generte.sh 脚本或类似的东西。 Essentially it runs the certificate generation for your network using cryptogen.本质上,它使用cryptogen 为您的网络运行证书生成。

The code is something like this:代码是这样的:

  which cryptogen
  if [ "$?" -ne 0 ]; then
    echo "cryptogen tool not found. exiting"
    exit 1
  fi

  if [ -d "crypto-config" ]; then
    rm -Rf crypto-config
  fi

  set -x
  cryptogen generate --config=./crypto-config.yaml

Once you generated the certificates, you can now generate the genesis block with something like:生成证书后,您现在可以使用以下内容生成创世块:

 which configtxgen

 if [ -d "config" ]; then
    rm -Rf config
  fi
  mkdir config

  configtxgen -profile OneOrgOrdererGenesis -outputBlock ./config/genesis.block
  configtxgen -profile OneOrgChannel -outputCreateChannelTx ./config/channel.tx -channelID $CHANNEL_NAME
  configtxgen -profile OneOrgChannel -outputAnchorPeersUpdate ./config/${MSP_NAME}anchors.tx -channelID $CHANNEL_NAME -asOrg $MSP_NAME

Obviously replacing with your names and variables.显然用你的名字和变量替换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 创世块存储在哪里以及如何从现有网络(Hyperledger Fabric)中检索它? - Where is genesis block stored and how can I retrieve it from an existing network (Hyperledger Fabric)? 恐慌:无法引导订购者。 读取创世块文件时出错:打开/etc/hyperledger/fabric/genesisblock:没有这样的文件或目录 - panic: unable to bootstrap orderer. Error reading genesis block file: open /etc/hyperledger/fabric/genesisblock: no such file or directory 超级账本结构创世区块相关 - Hyper-ledger fabric genesis block related Hyperledger Fabric Raft Orderer 设置失败,通道创建时身份验证握手失败 - Hyperledger Fabric Raft Orderer Setup Failed with authentication handshake failure on channel create 无法在Hyperledger Fabric docker安装程序中创建通道? - Cannot create a channel in Hyperledger fabric docker setup? 在 Hyperledger Fabric 中创建和启动应用程序通道的正确方法是什么? (已编辑) - What is the correct approach to create & start an application channel in Hyperledger Fabric? (Edited) Hyperledger结构构建错误 - Hyperledger fabric build error 超账结构对等变量 - hyperledger fabric peer variables Hyperledger Fabric Cli 容器错误 - Hyperledger fabric Cli container errors Hyperledger Fabric:了解Docker容器 - Hyperledger Fabric: Understanding Docker Containers
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM