Hyperledger Fabric 网络体验 - 网络启动过程概览

进入fabric-samples/test-network目录,执行指令:

bash 复制代码
./network.sh up -i 2.5

执行完指令能看到fabric已经启动。

作为第一次Fabric网络体验,网络启动主要包含三个操作,分别是生成配置文件、启动网络和操作网络。

  1. 配置文件
  • 使用cryptogen tool生成证书文件(给组织颁发证书)
  • 生成Orderer节点的创世区块genesis.block(创世区块)
  • 生成通道配置交易文件 channel.tx(通道是fabric独有的机制,相当于是一个子链)
  • 为组织1和组织2创建锚节点(锚节点是一个负责对外通讯的节点)
bash 复制代码
along@DESKTOP-CKPKB5K:~/fabric/fabric-samples/test-network$ ./network.sh up -i 2.5
Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb' with crypto from 'cryptogen'
LOCAL_VERSION=v2.5.4
DOCKER_IMAGE_VERSION=v2.5.9
Local fabric binaries and docker images are out of  sync. This may cause problems.
/home/along/fabric/fabric-samples/test-network/../bin/cryptogen
Generating certificates using cryptogen tool
Creating Org1 Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org1.yaml --output=organizations
org1.example.com
+ res=0
Creating Org2 Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org2.yaml --output=organizations
org2.example.com
+ res=0
Creating Orderer Org Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-orderer.yaml --output=organizations
+ res=0
Generating CCP files for Org1 and Org2
/home/along/fabric/fabric-samples/test-network/../bin/configtxgen
Generating Orderer Genesis block
+ configtxgen -profile TwoOrgsOrdererGenesis -channelID system-channel -outputBlock ./system-genesis-block/genesis.block
2024-07-25 17:08:05.879 CST 0001 INFO [common.tools.configtxgen] main -> Loading configuration
2024-07-25 17:08:05.885 CST 0002 INFO [common.tools.configtxgen.localconfig] completeInitialization -> orderer type: etcdraft
2024-07-25 17:08:05.885 CST 0003 INFO [common.tools.configtxgen.localconfig] completeInitialization -> Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:16777216 
2024-07-25 17:08:05.885 CST 0004 INFO [common.tools.configtxgen.localconfig] Load -> Loaded configuration: /home/along/fabric/fabric-samples/test-network/configtx/configtx.yaml
2024-07-25 17:08:05.888 CST 0005 INFO [common.tools.configtxgen] doOutputBlock -> Generating genesis block
2024-07-25 17:08:05.888 CST 0006 INFO [common.tools.configtxgen] doOutputBlock -> Creating system channel genesis block
2024-07-25 17:08:05.889 CST 0007 INFO [common.tools.configtxgen] doOutputBlock -> Writing genesis block
+ res=0
Creating volume "docker_orderer.example.com" with default driver
Creating volume "docker_peer0.org1.example.com" with default driver
Creating volume "docker_peer0.org2.example.com" with default driver
  1. 启动网络
  • 启动了4peer节点
  • 启动了一个orderer节点
  • 启动了一个管理工具
bash 复制代码
along@DESKTOP-CKPKB5K:~/fabric/fabric-samples/test-network$ ./network.sh up -i 2.5
Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb' 
LOCAL_VERSION=v2.5.4
DOCKER_IMAGE_VERSION=v2.5.9
Local fabric binaries and docker images are out of  sync. This may cause problems.
Creating orderer.example.com    ... done
Creating peer0.org2.example.com ... done
Creating peer0.org1.example.com ... done
Creating cli                    ... done
CONTAINER ID   IMAGE                               COMMAND             CREATED         STATUS                  PORTS                                                                                            NAMES
d3a4ef5a7683   hyperledger/fabric-tools:latest     "/bin/bash"         1 second ago    Up Less than a second                                                                                                    cli
ffcbad39bc93   hyperledger/fabric-peer:latest      "peer node start"   4 seconds ago   Up 2 seconds            0.0.0.0:7051->7051/tcp, :::7051->7051/tcp, 0.0.0.0:9444->9444/tcp, :::9444->9444/tcp             peer0.org1.example.com
4e971c5229f7   hyperledger/fabric-peer:latest      "peer node start"   4 seconds ago   Up 2 seconds            0.0.0.0:9051->9051/tcp, :::9051->9051/tcp, 7051/tcp, 0.0.0.0:9445->9445/tcp, :::9445->9445/tcp   peer0.org2.example.com
105098e02bfb   hyperledger/fabric-orderer:latest   "orderer"           4 seconds ago   Up 2 seconds            0.0.0.0:7050->7050/tcp, :::7050->7050/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp             orderer.example.com
相关推荐
dawn8 分钟前
通过GRE协议组建VPN网络
运维·网络·vpn·gre
网络安全(king)12 分钟前
网络安全之接入控制
网络·学习·安全·web安全
Dynadot_tech23 分钟前
使用DynadotAPI查看域名清仓中的过期域名列表
网络·域名·域名注册·dynadot·过期域名
鱼大大博客25 分钟前
Edge Scdn是用来干什么的?
网络·安全·edge
番茄电脑全能王32 分钟前
《CS2》提示mss32.dll丢失的根源与应对策略。《CS2》提示mss32.dll丢失是什么原因?mss32.dll丢失怎么办?
网络·经验分享·游戏·电脑
m0_6479990335 分钟前
服务器分区与挂载(新手友好)
运维·服务器
跨境商城搭建开发35 分钟前
一个服务器可以搭建几个网站?搭建一个网站的流程介绍
运维·服务器·前端·vue.js·mysql·npm·php
灰勒塔德40 分钟前
Linux-----进程处理(文件IO资源使用)
linux·运维·算法
mqiqe40 分钟前
Linux 安装rpm
linux·运维·数据库
趣知boy40 分钟前
HUB、交换机、路由器和串口服务器
运维·服务器·网络