在调整商业用纸以使用AWS组件时出现“错误:[网络]没有合适的同位体可用于初始化”

时间:2019-12-05 00:09:31

标签: amazon-web-services hyperledger-fabric blockchain hyperledger

我已经在本地https://hyperledger-fabric.readthedocs.io/en/release-1.4/tutorial/commercial_paper.html上关注并成功获得了此商业票据区块链教程。在本教程中,它使用托管所有组件的Docker容器,然后使用允许特定.js文件与这些组件进行交互的连接配置文件。我一直在尝试使用商业票据运行issue.js来创建资产,但是使用AWS Managedblockchain组件。该线程使我想到了检查连接配置文件的想法,在修改了连接配置文件后,我仍然不断收到“错误:[网络]没有合适的对等方可用来初始化。"Error: no suitable peers available to initiize from" when querying the blockchain

我的计划是使用AWS Managedblockchain中托管的所有内容,例如Orderer,CA和Node,但是,我仍然想将docker容器用于ouchdb。

我按照本指南设置了AWS Managedblockchain组件:https://docs.aws.amazon.com/managed-blockchain/latest/managementguide/get-started-create-network.html

以下是使用AWS受管区块链中的组件更新的连接配置文件:(我已经稍微修改了组件地址)

#
# The network connection profile provides client applications the information about the target
# blockchain network that are necessary for the applications to interact with it. These are all
# knowledge that must be acquired from out-of-band sources. This file provides such a source.
#
name: "basic-network"

#
# Any properties with an "x-" prefix will be treated as application-specific, exactly like how naming
# in HTTP headers or swagger properties work. The SDK will simply ignore these fields and leave
# them for the applications to process. This is a mechanism for different components of an application
# to exchange information that are not part of the standard schema described below. In particular,
# the "x-type" property with the "hlfv1" value example below is used by Hyperledger Composer to
# determine the type of Fabric networks (v0.6 vs. v1.0) it needs to work with.
#
x-type: "hlfv1"

#
# Describe what the target network is/does.
#
description: "The basic network"

#
# Schema version of the content. Used by the SDK to apply the corresponding parsing rules.
#
version: "1.0"

client:
  organization: Org1

#
# [Optional]. But most apps would have this section so that channel objects can be constructed
# based on the content below. If an app is creating channels, then it likely will not need this
# section.
#
channels:
  # name of the channel
  channeltest:
    # Required. list of orderers designated by the application to use for transactions on this
    # channel. This list can be a result of access control ("org1" can only access "ordererA"), or
    # operational decisions to share loads from applications among the orderers.  The values must
    # be "names" of orgs defined under "organizations/peers"
    orderers:
      - orderer.n-vpstww25fjcg5phjmntoklkaeq.managedblockchain.us-east-1.amazonaws.com

    # Required. list of peers from participating orgs
    peers:
      nd-mr6djdkiobdidhzploid3usv7d6.m-47ogvmlbjiuyd6etajnoygxq7y.n-vogtww35fjab5pwbmhgbnmkolq.managedblockchain.us-east-1.amazonaws.com:
        # [Optional]. will this peer be sent transaction proposals for endorsement? The peer must
        # have the chaincode installed. The app can also use this property to decide which peers
        # to send the chaincode install request. Default: true
        endorsingPeer: true

        # [Optional]. will this peer be sent query proposals? The peer must have the chaincode
        # installed. The app can also use this property to decide which peers to send the
        # chaincode install request. Default: true
        chaincodeQuery: true

        # [Optional]. will this peer be sent query proposals that do not require chaincodes, like
        # queryBlock(), queryTransaction(), etc. Default: true
        ledgerQuery: true

        # [Optional]. will this peer be the target of the SDK's listener registration? All peers can
        # produce events but the app typically only needs to connect to one to listen to events.
        # Default: true
        eventSource: true

#
# list of participating organizations in this network
#
organizations:
  Org1:
    mspid: m-22OGJKLBJRPOERHNAUUTNOITHQWA

    peers:
      - nd-mr6djdkiobdidhzploid3usv7d6.m-47ogvmlbjiuyd6etajnoygxq7y.n-vogtww35fjab5pwbmhgbnmkolq.managedblockchain.us-east-1.amazonaws.com

    # [Optional]. Certificate Authorities issue certificates for identification purposes in a Fabric based
    # network. Typically certificates provisioning is done in a separate process outside of the
    # runtime network. Fabric-CA is a special certificate authority that provides a REST APIs for
    # dynamic certificate management (enroll, revoke, re-enroll). The following section is only for
    # Fabric-CA servers.
    certificateAuthorities:
      - ca-org1

#
# List of orderers to send transaction and channel create/update requests to. For the time
# being only one orderer is needed. If more than one is defined, which one get used by the# being only one orderer is needed. If more than one is defined, which one get used by the
# SDK is implementation specific. Consult each SDK's documentation for its handling of orderers.
#
orderers:
 orderer.n-vpstww25fjcg5phjmntoklkaeq.managedblockchain.us-east-1.amazonaws.com:
    url: grpc:// orderer.n-vpstww25fjcg5phjmntoklkaeq.managedblockchain.us-east-1.amazonaws.com:30003

    # these are standard properties defined by the gRPC library
    # they will be passed in as-is to gRPC client constructor
    grpcOptions:
      ssl-target-name-override: orderer.example.com

#
# List of peers to send various requests to, including endorsement, query
# and event listener registration.
#
peers:
  nd-mr6djdkiobdidhzploid3usv7d6.m-47ogvmlbjiuyd6etajnoygxq7y.n-vogtww35fjab5pwbmhgbnmkolq.managedblockchain.us-east-1.amazonaws.com
    # this URL is used to send endorsement and query requests
    url: grpc://nd-mr6djdkiobdidhzploid3usv7d6.m-47ogvmlbjiuyd6etajnoygxq7y.n-vogtww35fjab5pwbmhgbnmkolq.managedblockchain.us-east-1.amazonaws.com:30005

    grpcOptions:
      ssl-target-name-override: nd-mr6djdkiobdidhzploid3usv7d6.m-47ogvmlbjiuyd6etajnoygxq7y.n-vogtww35fjab5pwbmhgbnmkolq.managedblockchain.us-east-1.amazonaws.com
      request-timeout: 120001

# Fabric-CA is a special kind of Certificate Authority provided by Hyperledger Fabric which allows
# certificate management to be done via REST APIs. Application may choose to use a standard
# Certificate Authority instead of Fabric-CA, in which case this section would not be specified.
#
certificateAuthorities:
  ca-org1:
    url: ca.m-47ogvmlbjjaleifjeindfefecd8.n-n-vpstww25fjcg5phjmntoklkaeq.managedblockchain.us-east-1.amazonaws.com:30002
    # the properties specified under this object are passed to the 'http' client verbatim when
    # making the request to the Fabric-CA server
    httpOptions:
      verify: false

    # Fabric-CA supports dynamic user enrollment via REST APIs. A "root" user, a.k.a registrar, is
    # needed to enroll and invoke new users.
    registrar:
      - enrollId: UsernameGoesHere
        enrollSecret: PasswordGoesHere
    # [Optional] The optional name of the CA.
    caName: ca-org1

最后,这是我收到的错误

2019-12-04T23:58:44.513Z-错误:[网络]:_ initializeInternalChannel:没有合适的对等项可用于从中初始化 处理交易时出错。错误:没有合适的同位体可用于从中初始化 错误:没有合适的同位体可用于从中初始化     在Network._initializeInternalChannel(/home/ubuntu/fabric-samples/commercial-paper/organization/magnetocorp/application/node_modules/fabric-network/lib/network.js:89:10)     在Network._initialize(/home/ubuntu/fabric-samples/commercial-paper/organization/magnetocorp/application/node_modules/fabric-network/lib/network.js:130:14)     在Gateway.getNetwork(/home/ubuntu/fabric-samples/commercial-paper/organization/magnetocorp/application/node_modules/fabric-network/lib/gateway.js:287:20)     在主要(/home/ubuntu/fabric-samples/commercial-paper/organization/magnetocorp/application/issue.js:58:39)     在 从Fabric网关断开连接。 发布程序已完成。

如果有人对我能做什么有任何想法,那将很棒!

谢谢

0 个答案:

没有答案