首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何查看链码定义?

如何查看链码定义?
EN

Stack Overflow用户
提问于 2020-07-05 15:40:37
回答 2查看 365关注 0票数 0

Fabric文档详细解释了链码定义是什么,以及它在链码的生命周期和治理中扮演的角色。它说,一个组织需要批准一个定义才能使用链码。它不能解释的是,如何在批准之前查看链码定义。

问题:有查看链码定义的命令吗?或者,我错过了另一个工作流,以便组织可以在批准定义之前研究它?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-07-06 14:41:11

批准的参数是定义。您可以将链码定义看作是执行和验证链码事务所需的所有参数。您可以通过您在文档中看到的参数提供定义,因此,在不知道定义的情况下,执行审批是不可能的。

一般情况下,该定义是同意带外的,然后所有的参与组织都认可外部同意的定义。但是,如果您在网络上,并且希望了解其他成员批准了什么,或者提交了哪些定义,则有许多查询实用程序通过对等CLI提供。您可以看到一个组织使用经查询批准的子命令批准了什么定义,您可以看到哪些org使用校验就绪子命令批准了特定的定义,您可以使用查询已提交子命令或通过使用queryinstalled子命令查看当前提交的定义。

票数 1
EN

Stack Overflow用户

发布于 2020-07-06 15:37:17

步骤1:每个组织都必须就具有唯一散列值和标签的链码包达成一致,他们都可能从开发人员那里获得链码包,如果有人试图更改链码上的某些内容,该链码包将给出与其他人不同的哈希值。

步骤2:每个组织将在对等点上安装该链码包。

步骤3:在此之后,每个组织都会得到一个相同的包ID,这是该链码包的散列值和标签上的一个组合。您可以通过“对等生命周期链码查询安装”命令获得它。

步骤4:现在您可以从您的组织中批准与channelID、名称、版本、init要求等相同的包ID。在批准之前,您还可以检查校验提交准备状态。

步骤5:要检查与channelID、名称、版本、init要求、序列1等相同的包ID的校验提交就绪状态,请执行以下命令。如果得到足够的批准,就可以提交了。

因此,每个组织都会批准自己的链码和其他定义,如channelID、名称、版本、init要求等&由于系统的原因,欺诈活动将得不到足够的批准。

代码语言:javascript
复制
Check whether a chaincode definition is ready to be committed on a channel.

Usage:
  peer lifecycle chaincode checkcommitreadiness [flags]

Flags:
      --channel-config-policy string   The endorsement policy associated to this chaincode specified as a channel config policy reference
  -C, --channelID string               The channel on which this command should be executed
      --collections-config string      The fully qualified path to the collection JSON file including the file name
      --connectionProfile string       The fully qualified path to the connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information
  -E, --endorsement-plugin string      The name of the endorsement plugin to be used for this chaincode
  -h, --help                           help for checkcommitreadiness
      --init-required                  Whether the chaincode requires invoking 'init'
  -n, --name string                    Name of the chaincode
  -O, --output string                  The output format for query results. Default is human-readable plain-text. json is currently the only supported format.
      --peerAddresses stringArray      The addresses of the peers to connect to
      --sequence int                   The sequence number of the chaincode definition for the channel (default 1)
      --signature-policy string        The endorsement policy associated to this chaincode specified as a signature policy
      --tlsRootCertFiles stringArray   If TLS is enabled, the paths to the TLS root cert files of the peers to connect to. The order and number of certs specified should match the --peerAddresses flag
  -V, --validation-plugin string       The name of the validation plugin to be used for this chaincode
  -v, --version string                 Version of the chaincode

Global Flags:
      --cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
      --certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
      --clientauth                          Use mutual TLS when communicating with the orderer endpoint
      --connTimeout duration                Timeout for client to connect (default 3s)
      --keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
  -o, --orderer string                      Ordering service endpoint
      --ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer.
      --tls                                 Use TLS when communicating with the orderer endpoint

正如在链码定义是参数的组合。之前回答的那样。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62742859

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档