日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Hyperledger Fabric 1.0 实例简析 第一课 network_setup.sh分析

發布時間:2025/3/15 编程问答 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Hyperledger Fabric 1.0 实例简析 第一课 network_setup.sh分析 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

以fabric-samples/balance-transfer例子:

1. 具體流程

fabric/examples/e2e_cli目錄下存有文件network_setup.sh用于一鍵部署環境并測試chaincode示例代碼。其中包括兩個部分,一個是利用generateArtifacts.sh腳本文件配置組織關系和頒發證書,另一個是docker-compose-cli.yaml用于根據配置啟動集群并測試chaincode的示例代碼。

2. generateArtifacts.sh腳本文件

包含三個函數:

  • generateCerts:使用cryptogen工具根據crypto-config.yaml來生成證書。
  • replacePrivateKey:將docker-compose-e2e-template.yaml文檔中的ca私鑰替換成具體的私鑰。(本例中未使用)
  • generateChannelArtifacts:使用configtxgen工具根據configtx.yaml文件來生成orderer genesis block、channel configuration transaction、anchor peer update。

crypto-config.yaml的具體內容如下:

# --------------------------------------------------------------------------- # "OrdererOrgs" - Definition of organizations managing orderer nodes # --------------------------------------------------------------------------- OrdererOrgs:# ---------------------------------------------------------------------------# Orderer# ---------------------------------------------------------------------------- Name: OrdererDomain: example.com# ---------------------------------------------------------------------------# "Specs" - See PeerOrgs below for complete description# ---------------------------------------------------------------------------Specs:- Hostname: orderer # --------------------------------------------------------------------------- # "PeerOrgs" - Definition of organizations managing peer nodes # --------------------------------------------------------------------------- PeerOrgs:# ---------------------------------------------------------------------------# Org1# ---------------------------------------------------------------------------- Name: Org1Domain: org1.example.com# ---------------------------------------------------------------------------# "Specs"# ---------------------------------------------------------------------------# Uncomment this section to enable the explicit definition of hosts in your# configuration. Most users will want to use Template, below## Specs is an array of Spec entries. Each Spec entry consists of two fields:# - Hostname: (Required) The desired hostname, sans the domain.# - CommonName: (Optional) Specifies the template or explicit override for# the CN. By default, this is the template:## "{{.Hostname}}.{{.Domain}}"## which obtains its values from the Spec.Hostname and# Org.Domain, respectively.# ---------------------------------------------------------------------------# Specs:# - Hostname: foo # implicitly "foo.org1.example.com"# CommonName: foo27.org5.example.com # overrides Hostname-based FQDN set above# - Hostname: bar# - Hostname: baz# ---------------------------------------------------------------------------# "Template"# ---------------------------------------------------------------------------# Allows for the definition of 1 or more hosts that are created sequentially# from a template. By default, this looks like "peer%d" from 0 to Count-1.# You may override the number of nodes (Count), the starting index (Start)# or the template used to construct the name (Hostname).## Note: Template and Specs are not mutually exclusive. You may define both# sections and the aggregate nodes will be created for you. Take care with# name collisions# ---------------------------------------------------------------------------Template:Count: 2# Start: 5# Hostname: {{.Prefix}}{{.Index}} # default# ---------------------------------------------------------------------------# "Users"# ---------------------------------------------------------------------------# Count: The number of user accounts _in addition_ to Admin# ---------------------------------------------------------------------------Users:Count: 1# ---------------------------------------------------------------------------# Org2: See "Org1" for full specification# ---------------------------------------------------------------------------- Name: Org2Domain: org2.example.comTemplate:Count: 2Users:Count: 1

configtx.yaml的具體內容如下:

################################################################################ # # Profile # # - Different configuration profiles may be encoded here to be specified # as parameters to the configtxgen tool # ################################################################################ Profiles:TwoOrgsOrdererGenesis:Orderer:<<: *OrdererDefaultsOrganizations:- *OrdererOrgConsortiums:SampleConsortium:Organizations:- *Org1- *Org2TwoOrgsChannel:Consortium: SampleConsortiumApplication:<<: *ApplicationDefaultsOrganizations:- *Org1- *Org2################################################################################ # # Section: Organizations # # - This section defines the different organizational identities which will # be referenced later in the configuration. # ################################################################################ Organizations:# SampleOrg defines an MSP using the sampleconfig. It should never be used# in production but may be used as a template for other definitions- &OrdererOrg# DefaultOrg defines the organization which is used in the sampleconfig# of the fabric.git development environmentName: OrdererOrg# ID to load the MSP definition asID: OrdererMSP# MSPDir is the filesystem path which contains the MSP configurationMSPDir: crypto-config/ordererOrganizations/example.com/msp- &Org1# DefaultOrg defines the organization which is used in the sampleconfig# of the fabric.git development environmentName: Org1MSP# ID to load the MSP definition asID: Org1MSPMSPDir: crypto-config/peerOrganizations/org1.example.com/mspAnchorPeers:# AnchorPeers defines the location of peers which can be used# for cross org gossip communication. Note, this value is only# encoded in the genesis block in the Application section context- Host: peer0.org1.example.comPort: 7051- &Org2# DefaultOrg defines the organization which is used in the sampleconfig# of the fabric.git development environmentName: Org2MSP# ID to load the MSP definition asID: Org2MSPMSPDir: crypto-config/peerOrganizations/org2.example.com/mspAnchorPeers:# AnchorPeers defines the location of peers which can be used# for cross org gossip communication. Note, this value is only# encoded in the genesis block in the Application section context- Host: peer0.org2.example.comPort: 7051################################################################################ # # SECTION: Orderer # # - This section defines the values to encode into a config transaction or # genesis block for orderer related parameters # ################################################################################ Orderer: &OrdererDefaults# Orderer Type: The orderer implementation to start# Available types are "solo" and "kafka"OrdererType: soloAddresses:- orderer.example.com:7050# Batch Timeout: The amount of time to wait before creating a batchBatchTimeout: 2s# Batch Size: Controls the number of messages batched into a blockBatchSize:# Max Message Count: The maximum number of messages to permit in a batchMaxMessageCount: 10# Absolute Max Bytes: The absolute maximum number of bytes allowed for# the serialized messages in a batch.AbsoluteMaxBytes: 98 MB# Preferred Max Bytes: The preferred maximum number of bytes allowed for# the serialized messages in a batch. A message larger than the preferred# max bytes will result in a batch larger than preferred max bytes.PreferredMaxBytes: 512 KBKafka:# Brokers: A list of Kafka brokers to which the orderer connects# NOTE: Use IP:port notationBrokers:- 127.0.0.1:9092# Organizations is the list of orgs which are defined as participants on# the orderer side of the networkOrganizations:################################################################################ # # SECTION: Application # # - This section defines the values to encode into a config transaction or # genesis block for application related parameters # ################################################################################ Application: &ApplicationDefaults# Organizations is the list of orgs which are defined as participants on# the application side of the networkOrganizations:

3. docker-compose-cli.yaml文件

根據組織關系啟動docker集群,并在cli容器中執行command命令運行./scripts/script.sh腳本文件。

./scripts/script.sh腳本包含以下函數:

  • createChannel:創建channel。
  • joinChannel:將每個peer節點加入channel。
  • updateAnchorPeers
  • installChaincode:部署chaincode。
  • instantiateChaincode:初始化chaincode,并設置背書策略。
  • chaincodeQuery
  • chaincodeInvoke

總結

以上是生活随笔為你收集整理的Hyperledger Fabric 1.0 实例简析 第一课 network_setup.sh分析的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 亚洲区国产区 | 久久精品视频中文字幕 | 激情综合网五月天 | 国产999久久久 | 国产成人在线视频网站 | 人妻熟人中文字幕一区二区 | 欧美中文字幕 | 久久国色 | 国产精品白嫩白嫩大学美女 | 亚洲精品日韩丝袜精品 | 麻豆精品免费观看 | 少妇2做爰交换朴银狐 | 人人玩人人干 | 国产欧美日韩视频在线观看 | 一区二区片 | 欧美极品少妇xxxxⅹ免费视频 | 国产一线二线三线在线观看 | 18xxxx日本| 中文字幕日韩有码 | 欧美成人国产精品一区二区 | 亚洲视频免费 | 岛国av动作片 | 九九久久久| 国产成人黄色片 | 一级免费在线 | 激情高潮呻吟抽搐喷水 | 久久午夜剧场 | 国产精品17p | 久久精品国产亚洲av麻豆蜜芽 | 毛片一级在线观看 | 一区二区三区视频网 | 黄色大片一级片 | 成人午夜精品福利 | 日本黄网站 | 韩国毛片基地 | 精品国产乱码久久久久久88av | 日韩中出在线 | 秋霞久久精品 | 欧美性粗暴 | 欧美日韩专区 | 欧美成一区二区三区 | 亚洲一级片在线播放 | 国产美女免费视频 | 国产视频精品自拍 | 日本精品久久久久 | 激情六月婷婷 | 亚洲最大成人综合网 | www.第四色| 一级美女大片 | 美女被c出白浆 | 青青青青青操 | 精品电影在线观看 | 国产三级国产精品国产国在线观看 | 美女在线一区 | 爱情岛亚洲论坛入口福利 | 日韩av一区二区在线观看 | 一本视频在线 | 日韩欧美成人一区二区三区 | 成人片在线免费看 | 不卡中文av | 国产黄色av网站 | 国产三级在线看 | 91福利区 | 久久精品99北条麻妃 | 国产午夜精品久久久久久久久久 | 女人裸体又黄 | 影音先锋亚洲成aⅴ人在 | 日韩精品视频久久 | 久久免费av| 欧美日韩制服 | 两性av | 神马午夜我不卡 | 精品一区二区在线播放 | 亚洲成人福利视频 | 四虎精品在永久在线观看 | 日韩性欧美 | 午夜视频大全 | 伊人999| 久久伊人网站 | 69人人 | 欧美韩一区 | 粗大黑人巨茎大战欧美成人免费看 | 黄色小说在线看 | 女同激情久久av久久 | 野花中文免费观看6 | 影音先锋 日韩 | kk视频在线观看 | 国产午夜一区二区 | 黄色一及毛片 | 婷婷在线视频 | 一集毛片 | 综合网亚洲 | 大奶在线播放 | 侵犯女教师一区二区三区 | 鲁丝一区二区三区 | 亚洲青青操 | 成人在线播放av | 1769国产精品 | 国产精品羞羞答答在线 |