当前位置: 首页 > news >正文

珠海网站快速排名提升抖音蓝号代运营

珠海网站快速排名提升,抖音蓝号代运营,腾讯官方网站,lnmp wordpress 301链上代码#xff08;Chaincode#xff09;简称链码#xff0c;包括系统链码和用户链码。系统链码#xff08;System Chaincode#xff09;指的是 Fabric Peer 中负责系统配置、查询、背书、验证等平台功能的代码逻辑#xff0c;运行在 Peer 进程内#xff0c;将在第 14 …链上代码Chaincode简称链码包括系统链码和用户链码。系统链码System Chaincode指的是 Fabric Peer 中负责系统配置、查询、背书、验证等平台功能的代码逻辑运行在 Peer 进程内将在第 14 章介绍。用户链码指的是用户编写的用来实现智能合约的应用代码。如无特殊说明链码一般指的就是用户链码。 链码被部署在 Peer 节点上运行在独立的沙盒目前为 Docker 容器中并通过 gRPC 协议与相应的 Peer 节点进行交互。用户可以通过命令行或 SDK 调用链码方法链码被调用时会按照链码内预定逻辑来计算账本状态的更新集合读写集合。 链码操作命令 Operate a chaincode: install|instantiate|invoke|package|query|signpackage|upgrade|list.Usage:peer chaincode [command]Available Commands:install Install a chaincode.instantiate Deploy the specified chaincode to the network.invoke Invoke the specified chaincode.list Get the instantiated chaincodes on a channel or installed chaincodes on a peer.package Package a chaincodequery Query using the specified chaincode.signpackage Sign the specified chaincode packageupgrade Upgrade chaincode.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)-h, --help help for chaincode--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--tlsHandshakeTimeShift duration The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint--transient string Transient map of arguments in JSON encodingUse peer chaincode [command] --help for more information about a command.最简单的操作链码的方式是使用命令行。Fabric 自 2.0 版本开始正式启用新的生命周期系统链码位于 core/chaincode/lifecycle来管理链码需开启应用能力 V2_0客户端通过新的 peer lifecycle chaincode 子命令位于 internal/peer/lifecycle对链码进行打包、安装、批注和提交等生命周期管理取代 1.x 中的 peer chaincode 命令。 相对 1.x 版本中的模式新的链码管理从单个组织升级为通道范畴。例如链码的背书策略可由通道内多个组织来商定部署和升级也作为通道层面的操作这些都提高了链码生命周期的安全性。如果要对链码进行调用或查询仍可以使用原有的 peer chaincode invoke 和 peer chaincode query 命令。 如果要使用 1.x 版本中的链码生命周期管理peer chaincodeinstall/instantaite/upgrade/list 等命令需要将通道的应用能力版本设置为兼容的低版本如 V1_4_2。当通道启用了应用能力 V2_0 后将无法再部署或升级原有模式下的链码。 链码生命周期 链码操作支持全局命令选项 全局选项类型含义--cafilestring信任的排序服务的 TLS CA 的证书PEM 编码格式路径--certfilestring与排序服务进行双向 TLS 认证时使用的本地证书文件路径--clientauthbool与排序服务通信时是否启用双向 TLS 认证--connTimeoutduration客户端连接超时默认为 3 秒--keyfilestring与排序服务双向 TLS 认证时使用的本地私钥文件路径-o,--ordererstringOrderer 服务地址--ordererTLSHostnameOverridestring验证 Orderer TLS 时覆盖所校验的主机名--tlsbool连接到 Orderer 服务时是否启用 TLS--transientstring调用链码时传递的临时信息其他 peer 将无法获取该信息 打包链码 package 子命令可以封装链码相关的数据将其打包为.tar.gz 安装包供安装使用。 Package a chaincode and write the package to a file.Usage:peer chaincode package [outputfile] [flags]Flags:-s, --cc-package create CC deployment spec for owner endorsements instead of raw CC deployment spec-c, --ctor string Constructor message for the chaincode in JSON format (default {})-h, --help help for package-i, --instantiate-policy string instantiation policy for the chaincode-l, --lang string Language the chaincode is written in (default golang)-n, --name string Name of the chaincode-p, --path string Path to chaincode-S, --sign if creating CC deployment spec package for owner endorsements, also sign it with local MSP-v, --version string Version of the chaincode specified in install/instantiate/upgrade commandsGlobal 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--tlsHandshakeTimeShift duration The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint--transient string Transient map of arguments in JSON encoding其中生成的打包文件中包括 Chaincode-Package-Metadata.json、Code-Package.tar.gz 两个文件。Chaincode-Package-Metadata.json 内容包括链码路径、类型、标签等信息.Code-Package.tar.gz 内容包括链码的源码包结构如 src/examples/chaincode/go/testcc/ 路径以及内容但不能包括对目录以外路径的引用。 注意自 2.0 版本起编译链码的 ccenv 镜像不再包括 shim 层。链码需要自行包括 github.com/hyperledger/fabric-chaincode-go/shim 和其他所需要的依赖包。 安装链码 打包后的链码安装包文件可以使用 install 命令安装到运行链码的各个 Peer。 Install a chaincode on a peer. This installs a chaincode deployment spec package (if provided) or packages the specified chaincode before subsequently installing it.Usage:peer chaincode install [flags]Flags:--connectionProfile string Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information-c, --ctor string Constructor message for the chaincode in JSON format (default {})-h, --help help for install-l, --lang string Language the chaincode is written in (default golang)-n, --name string Name of the chaincode-p, --path string Path to chaincode--peerAddresses stringArray The addresses of the peers to connect to--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, --version string Version of the chaincode specified in install/instantiate/upgrade commandsGlobal 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--tlsHandshakeTimeShift duration The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint--transient string Transient map of arguments in JSON encoding参数类型含义-- connectionProfilestring网络访问信息文件路径目前仅支持 peer 连接信息-- peerAddressesstringArray请求所发往的 peer 地址列表--tlsRootCertFilesstringArray所连接的 peer 的信任 TLS 根证书 Peer 会尝试编译链码如果编译成功则将安装包以二进制的形式储存到指定路径的 chaincodes 子目录下并利用元数据标签和安装包生成的 SHA256 值作为文件名。 Peer 会尝试编译链码如果编译成功则将安装包以二进制的形式储存到指定路径的 chaincodes 子目录下并利用元数据标签和安装包生成的 SHA256 值作为文件名。 注意安装操作需要是 Peer 认可的组织管理员身份证书在 Peer 的 admincerts 目录下存在。 查询和批准链码 通道内组织在部署链码前需要足够多的组织管理员对链码定义进行投票批准。链码定义包括链码名称、版本、序列号、背书和验证参数、是否需要初始化、链码包 Id以及可能带有的私密数据集合配置等。操作涉及 queryinstalled、getinstalled-package、approveformyorg、checkcommitrea-diness 四个链码生命周期子命令。 queryinstalled 子命令可以查询目标 Peer 上已经安装的链码信息。支持的参数包括 ●--connectionProf ile string网络访问信息文件路径目前仅支持 Peer 连接信息。 ●-O,--output string结果输出的格式目前支持格式化为 json 格式。 ●--peerAddresses stringArray请求所发往的 Peer 地址列表。 ●--tlsRootCertFiles stringArray所连接的 Peer 的信任的 TLS 根证书。getinstalledpackage 子命令可以获取指定的链码安装包与发送给 Peer 的安装包内容相同。支持参数包括 ●--connectionProf ile string网络访问信息文件路径目前仅支持 Peer 连接信息。 ●--output-directory string将获取到的链码安装包保存到指定路径默认为当前路径。 ●--package-id string所要获取的链码安装包的 ID。 ●--peerAddresses stringArray请求所发往的 Peer 地址列表。 ●--tlsRootCertFiles stringArray所连接的 Peer 的信任的 TLS 根证书。 approveformyorg 子命令允许用户将链码的定义发送给 Peer 进行背书通过后发给 Orderer 进行排序和确认。所有需要执行链码的组织都需要完成此步骤。默认情况下只有通道内大多数组织通道内的 Channel/Application/LifecycleEndorsement 策略指定默认为通道内大多数成员都批准了链码定义对应链码才能在通道内部署运行。支持的参数包括 ●--channel-config-policy string指定链码的背书策略名称该策略名称需要提前存储在通道策略配置中默认为 Channel/Application/Endorsement 策略默认为通道内大多数成员组织背书。 ●-C,--channelID string执行命令面向的通道名称。 ●--collections-conf ig string启用私密数据功能时指定集合文件的路径。 ●--connectionProf ile string网络访问信息文件路径目前仅支持 Peer 连接信息。 ●-E,--endorsement-plugin string链码所使用的背书插件的名称。 ●--init-required是否需要调用 Init 方法对链码进行初始化。 ●-n,--name string链码名称。 ●--package-id string链码安装包的名称。 ●--peerAddresses stringArray所连接的 Peer 节点列表。 ●--sequence int通道内对链码进行定义的序列号默认为 1每次更新链码定义则需要递增。 ●--signature-policy string指定链码的基于签名的背书策略默认采用 Channel/Application/Endorsement 指定的策略默认为通道内大多数成员组织背书不能与 --channel-conf ig-policy 同时使用。 ●--tlsRootCertFiles stringArray连接 Peer 启用 TLS 时所信任的 TLS 根证书列表注意与 Peer 地址顺序匹配。 ●-V,--validation-plugin string链码所使用的校验系统插件名称。 ●--waitForEvent是否等待事件以确认交易在各个 Peer 提交默认开启。 ●--waitForEventTimeout duration等待事件的时间默认为 30s。 checkcommitreadiness 子命令可以获取指定的链码安装包当前的批准状态调用_lifecycle 链码 CheckCommitReadiness 方法位于 core/chaincode/lifecycle/scc.go。支持参数与 approveformyorg 子命令类似。 提交链码并查询状态 通道内链码得到足够多的组织批准后将成为可以合法运行的链码。此时任意通道内组织可以使用 commit 子命令发起提交操作。链码定义被成功提交到通道后通道内成员可以使用链码如进行调用。支持的参数包括 ●--channel-config-policy string指定链码的背书策略名称该策略名称需要提前存储在通道策略配置中默认为 Channel/Application/Endorsement 策略默认为通道内大多数成员组织背书。 ●-C,--channelID string执行命令面向的通道名称。 ●--collections-conf ig string启用私密数据功能时指定集合文件的路径。 ●--connectionProf ile string网络访问信息文件路径目前仅支持 Peer 连接信息。 ●-E,--endorsement-plugin string链码所使用的背书插件的名称。 ●--init-required是否需要调用 Init 方法对链码进行初始化。 ●-n,--name string链码名称。 ●--package-id string链码安装包的名称。 ●--peerAddresses stringArray所连接的 Peer 节点列表。 ●--sequence int通道内对链码进行定义的序列号默认为 1每次更新链码定义则需要递增。 ●--signature-policy string指定链码的基于签名的背书策略默认采用 Channel/Application/Endorsement 指定的策略默认为通道内大多数成员组织背书不能与 --channel-conf ig-policy 同时使用。 ●--tlsRootCertFiles stringArray连接 Peer 启用 TLS 时所信任的 TLS 根证书列表注意与 Peer 地址顺序匹配。 ●-V,--validation-plugin string链码所使用的校验系统插件名称。 ●--waitForEvent是否等待事件以确认交易在各个 Peer 提交默认开启。 ●--waitForEventTimeout duration等待事件的时间默认为 30s。 ●-C,--channelID string执行命令的通道名称。 ●--connectionProf ile string网络访问信息文件路径目前仅支持 Peer 连接信息。 ●-n,--name string链码名称。 ●-O,--output string结果输出的格式目前支持 json 格式。 ●--peerAddresses stringArray所连接的 Peer 地址列表。 ●--tlsRootCertFiles stringArray连接 Peer 启用 TLS 时所信任的 TLS 根证书列表注意与 Peer 地址顺序匹配。 首先使用 commit 子命令提交已经得到批准的链码定义然后使用 querycommitted 子命令查询提交状态 使用私有数据 在批准和提交链码定义时可以通过 --collections-conf ig collection.json 来指定与私密数据相关的集合配置Fabric v1.1.0 开始支持可以实现在同一通道内私密数据的调用只有部分成员共享。如果不指定该参数则默认不启用该特性意味着通道内所有成员都可以看到链码调用结果。 collections_config.json 配置文件示例 : [{name: collection1, // 集合名称policy: OR(Org1MSP.member), // 集合成员requiredPeerCount: 0, // 背书之前至少扩散私有数据到的节点数maxPeerCount: 3, // 背书之前尝试扩散最多节点个数, 不能小于 requiredPeerCountblockToLive: 1000000, // 私有数据保存时长 0 意味着永不过期memberOnlyRead: true, // 是否只允许集合成员来读取私有数据memberOnlyWrite: true // 是否只允许集合成员来发起对私有数据的写交易endorsementPolicy: OR(Org1MSP.member) ,// 指定对私有数据写操作时的背书策略signaturePolicy: OR(Org1MSP.member) // 指定使用签名策略 },{name: collection2,policy: OR(Org2MSP.member),requiredPeerCount: 0,maxPeerCount: 3,blockToLive: 1,memberOnlyRead: true} ] 其中collection.json 中定义了 collection1 和 collection2 两个集合其成员分别为 Org1、Org2 两个组织。当在链码逻辑中指定某个键值属于特定集合时只有集合内成员能看到明文的读写集合非集合成员即使在同一通道内也无法获取私密数据。对应 policy 只支持 OR 语法指定哪些组织可以看到私密数据集合。 requiredPeerCount 和 maxPeerCount 指定了在执行背书过程中尝试扩散数据到其他合法节点的个数避免因背书节点的突然故障而导致私密数据丢失。背书阶段未获取私密数据的合法节点在提交阶段会尝试从其他节点来拉取私密数据。 调用链码 通过 peer chaincode invoke 命令实现位于 internal/peer/chaincode可以调用运行中链码定义的方法所指定的函数名和参数会被传到链码的 Invoke () 方法进行处理。调用链码操作需要同时与 Peer 和 Orderer 打交道。 Invoke the specified chaincode. It will try to commit the endorsed transaction to the network.Usage:peer chaincode invoke [flags]Flags:-C, --channelID string The channel on which this command should be executed--connectionProfile string Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information-c, --ctor string Constructor message for the chaincode in JSON format (default {})-h, --help help for invoke-I, --isInit Is this invocation for init (useful for supporting legacy chaincodes in the new lifecycle)-n, --name string Name of the chaincode--peerAddresses stringArray The addresses of the peers to connect to--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--waitForEvent Whether to wait for the event from each peers deliver filtered service signifying that the invoke transaction has been committed successfully--waitForEventTimeout duration Time to wait for the event from each peers deliver filtered service signifying that the invoke transaction has been committed successfully (default 30s)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--tlsHandshakeTimeShift duration The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint--transient string Transient map of arguments in JSON encoding注意invoke 是异步操作invoke 成功只能保证交易已经进入 Orderer 进行排序但无法保证最终写到账本中例如交易未通过 Committer 验证而被拒绝。需要通过事件监听或主动查询等方式来进行确认交易是否最终写到账本上。 查询链码 查询链码可以通过 peer chaincode query 子命令。 该子命令实际上是 invoke 操作与 Peer 打交道的部分即将签名后的 Proposal 发给指定的 Peer 节点的 ProcessProposal () gRPC 接口。最终将 - c 指定的命令参数发送给了链码中的 Invoke () 方法执行。 query 操作与 invoke 操作的区别在于query 操作用来查询 Peer 上账本状态需要链码支持查询逻辑不生成交易也不需要与 Orderer 打交道。同时query 命令默认只返回第一个 Peer 的查询结果。 Get endorsed result of chaincode function call and print it. It wont generate transaction.Usage:peer chaincode query [flags]Flags:-C, --channelID string The channel on which this command should be executed--connectionProfile string Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information-c, --ctor string Constructor message for the chaincode in JSON format (default {})-h, --help help for query-x, --hex If true, output the query value byte array in hexadecimal. Incompatible with --raw-n, --name string Name of the chaincode--peerAddresses stringArray The addresses of the peers to connect to-r, --raw If true, output the query value as raw bytes, otherwise format as a printable string--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 flagGlobal 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--tlsHandshakeTimeShift duration The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint--transient string Transient map of arguments in JSON encoding升级链码 链码升级过程需要重复 peer lifecycle chaincode 相关命令来执行完整的生命周期具体步骤如下 1更新旧版本链码的源代码并重新打包链码包。 2将新的链码包再次安装到 Peer获取新的包 Id。注意相对旧版本要递增版本号。 3按照策略通道内足够多组织都要重新对新版本的链码定义进行批准。注意序列号要递增。 4通道内足够多组织批准定义后可以提交新版本链码定义到通道。 5再次调用链码确保链码已经自动更新为新的版本。 peersfabricgosequencehyperledger fabricvalidationgrpc © 著作权归作者所有 举报
http://www.zqtcl.cn/news/539980/

相关文章:

  • 私人装修接单网站wordpress热门文章插件
  • 湘潭网站外包公司宁波妇科医生推荐
  • 企业网站建设可以分为几个层次三亚网站定制
  • 手机网站可以做商城吗如何为公司建立网站
  • 淄博建设银行网站怎么做盗号网站手机
  • 网站建设推广的10种方法精美个人网站
  • 西安专业承接网站搭建模板网站聚合页
  • 便宜网站建设加盟推广公司
  • 手机移动端网站怎么做三维建设项目管理网站
  • 如何把网站设为正确建设中广东学校网站建设公司
  • 企业型网站建设怎样收费dw制作网站模板
  • 自适应网站欣赏医联体网站建设
  • 南安市住房和城乡建设部网站微商城网站建设行情
  • 网站开发的前景wordpress倒闭
  • 合肥网站建设网页设计免费推广渠道有哪些方式
  • 广州电力建设有限公司网站按月网站建设
  • 做网站客户会问什么问题手机如何制作网页链接
  • 做足球直播网站wordpress筛选框
  • 做网站需求文档深圳站建在边境
  • 网站建设法规浙江建设信息港证书查询
  • 影视作品网站开发与设计网站建设教程简笔画
  • 自己可以给公司做网站吗网站建设 用ftp上传文件
  • 电子商务网站开发与管理网站建设的设备
  • 网站建设项目公司沈阳网站关键字优化
  • 可以做淘宝联盟的免费网站优质国外网站
  • 石家庄营销型网站建设公司服装公司网站源码
  • 网站开发的软硬件需求做网站盘锦
  • 创意网站建设排行榜python和php哪个做网站
  • 开锁做网站怎么样榆林网站开发公司
  • 松原市建设局网站苏州网站建设-中国互联