在 Hyperledger Fabric 中,如果无法使用 peer channel fetch 命令,如何加入频道?
In Hyperledger Fabric, how do I join a channel if I cannot use the peer channel fetch command?
我想让我的同伴加入一个频道(在本例中是我的频道)。此特定对等点在其文件系统上没有 mychannel.block
文件。
然后我尝试使用peer channel fetch 0 -c mychannel
。然后我收到以下错误:
2019-01-15 08:11:18.948 UTC [msp] Validate -> DEBU 036 MSP ZafitMSP validating identity
2019-01-15 08:11:18.949 UTC [msp] GetDefaultSigningIdentity -> DEBU 037 Obtaining default signing identity
2019-01-15 08:11:18.949 UTC [grpc] DialContext -> DEBU 038 parsed scheme: ""
2019-01-15 08:11:18.949 UTC [grpc] DialContext -> DEBU 039 scheme "" not registered, fallback to default scheme
2019-01-15 08:11:18.949 UTC [grpc] watcher -> DEBU 03a ccResolverWrapper: sending new addresses to cc: [{peer1.zafit.example.com:7051 0 <nil>}]
2019-01-15 08:11:18.949 UTC [grpc] switchBalancer -> DEBU 03b ClientConn switching balancer to "pick_first"
2019-01-15 08:11:18.950 UTC [grpc] HandleSubConnStateChange -> DEBU 03c pickfirstBalancer: HandleSubConnStateChange: 0xc4202b78d0, CONNECTING
2019-01-15 08:11:18.952 UTC [grpc] HandleSubConnStateChange -> DEBU 03d pickfirstBalancer: HandleSubConnStateChange: 0xc4202b78d0, READY
2019-01-15 08:11:18.953 UTC [channelCmd] InitCmdFactory -> INFO 03e Endorser and orderer connections initialized
2019-01-15 08:11:18.953 UTC [msp] GetDefaultSigningIdentity -> DEBU 03f Obtaining default signing identity
2019-01-15 08:11:18.953 UTC [msp] GetDefaultSigningIdentity -> DEBU 040 Obtaining default signing identity
2019-01-15 08:11:18.953 UTC [msp/identity] Sign -> DEBU 041 Sign: plaintext: 0AF2060A1508051A0608A6ABF6E10522...1BB3248E4BFA12080A021A0012021A00
2019-01-15 08:11:18.953 UTC [msp/identity] Sign -> DEBU 042 Sign: digest: C8988576954088FD1A61D6D4FFA7A7280E52F10B2F2671693C260B54B09F3B89
2019-01-15 08:11:18.954 UTC [cli/common] readBlock -> INFO 043 Got status: &{NOT_FOUND}
但是,当我从另一个节点复制 mychannel.block
文件时,我能够成功加入 mychannel
。 peer channel fetch
命令在加入频道后也能成功
对我来说,这似乎是先有鸡还是先有蛋的情况,我需要以同伴身份加入频道,但我无法加入,因为我需要创世块。但是我需要加入频道,所以无法获取创世区块?
所以问题是检索 genesis mychannel.block
文件的适当命令是什么?
您需要添加 -o
(--orderer
) 标志并将其设置为排序服务端点。如果你不设置这个标志,那么 peer channel fetch
会尝试从对等方(显然没有它)获取块。您还可以在 运行 没有 -o
的情况下指定不同的 --peer.address / CORE_PEER_ADDRESS
以从不同的对等方获取配置块。
原来我需要添加orderer参数-o
。此外,由于我连接的是 TLS,因此我需要指定 --tls true
以及指定 --cafile
.
完整命令如下:?
peer channel fetch 0 -c mychannel -o orderer.example.com:7050 --tls true --cafile $ORDERER_CA
peer channel fetch 0 -c mychannel
注意:您无需获取频道即可加入频道
创建频道会给出.block文件作为成功的标志。
加入频道将使用它来完成加入过程
如果你错过了 .block 那么你需要获取命令
注意:对于最新的获取命令
https://hyperledger-fabric.readthedocs.io/en/release-1.4/commands/peerchannel.html
peer channel join -b channel.block --tls --cafile /etc/hyperledger/crypto/peer/tls/ca.crt
当您尝试加入渠道时,您必须联系订购者以获取配置信息,这就是为什么您会提到 -o orderer_name 以便通过 CLI 了解订购者的原因
我想让我的同伴加入一个频道(在本例中是我的频道)。此特定对等点在其文件系统上没有 mychannel.block
文件。
然后我尝试使用peer channel fetch 0 -c mychannel
。然后我收到以下错误:
2019-01-15 08:11:18.948 UTC [msp] Validate -> DEBU 036 MSP ZafitMSP validating identity
2019-01-15 08:11:18.949 UTC [msp] GetDefaultSigningIdentity -> DEBU 037 Obtaining default signing identity
2019-01-15 08:11:18.949 UTC [grpc] DialContext -> DEBU 038 parsed scheme: ""
2019-01-15 08:11:18.949 UTC [grpc] DialContext -> DEBU 039 scheme "" not registered, fallback to default scheme
2019-01-15 08:11:18.949 UTC [grpc] watcher -> DEBU 03a ccResolverWrapper: sending new addresses to cc: [{peer1.zafit.example.com:7051 0 <nil>}]
2019-01-15 08:11:18.949 UTC [grpc] switchBalancer -> DEBU 03b ClientConn switching balancer to "pick_first"
2019-01-15 08:11:18.950 UTC [grpc] HandleSubConnStateChange -> DEBU 03c pickfirstBalancer: HandleSubConnStateChange: 0xc4202b78d0, CONNECTING
2019-01-15 08:11:18.952 UTC [grpc] HandleSubConnStateChange -> DEBU 03d pickfirstBalancer: HandleSubConnStateChange: 0xc4202b78d0, READY
2019-01-15 08:11:18.953 UTC [channelCmd] InitCmdFactory -> INFO 03e Endorser and orderer connections initialized
2019-01-15 08:11:18.953 UTC [msp] GetDefaultSigningIdentity -> DEBU 03f Obtaining default signing identity
2019-01-15 08:11:18.953 UTC [msp] GetDefaultSigningIdentity -> DEBU 040 Obtaining default signing identity
2019-01-15 08:11:18.953 UTC [msp/identity] Sign -> DEBU 041 Sign: plaintext: 0AF2060A1508051A0608A6ABF6E10522...1BB3248E4BFA12080A021A0012021A00
2019-01-15 08:11:18.953 UTC [msp/identity] Sign -> DEBU 042 Sign: digest: C8988576954088FD1A61D6D4FFA7A7280E52F10B2F2671693C260B54B09F3B89
2019-01-15 08:11:18.954 UTC [cli/common] readBlock -> INFO 043 Got status: &{NOT_FOUND}
但是,当我从另一个节点复制 mychannel.block
文件时,我能够成功加入 mychannel
。 peer channel fetch
命令在加入频道后也能成功
对我来说,这似乎是先有鸡还是先有蛋的情况,我需要以同伴身份加入频道,但我无法加入,因为我需要创世块。但是我需要加入频道,所以无法获取创世区块?
所以问题是检索 genesis mychannel.block
文件的适当命令是什么?
您需要添加 -o
(--orderer
) 标志并将其设置为排序服务端点。如果你不设置这个标志,那么 peer channel fetch
会尝试从对等方(显然没有它)获取块。您还可以在 运行 没有 -o
的情况下指定不同的 --peer.address / CORE_PEER_ADDRESS
以从不同的对等方获取配置块。
原来我需要添加orderer参数-o
。此外,由于我连接的是 TLS,因此我需要指定 --tls true
以及指定 --cafile
.
完整命令如下:?
peer channel fetch 0 -c mychannel -o orderer.example.com:7050 --tls true --cafile $ORDERER_CA
peer channel fetch 0 -c mychannel
注意:您无需获取频道即可加入频道 创建频道会给出.block文件作为成功的标志。
加入频道将使用它来完成加入过程
如果你错过了 .block 那么你需要获取命令
注意:对于最新的获取命令
https://hyperledger-fabric.readthedocs.io/en/release-1.4/commands/peerchannel.html
peer channel join -b channel.block --tls --cafile /etc/hyperledger/crypto/peer/tls/ca.crt
当您尝试加入渠道时,您必须联系订购者以获取配置信息,这就是为什么您会提到 -o orderer_name 以便通过 CLI 了解订购者的原因