6
votes

Dans Hyperledger Fabric, comment rejoindre un canal si je ne peux pas utiliser la commande d'extraction de canal homologue?

Je souhaite que mon pair rejoigne un canal (mychannel dans ce cas). Ce pair spécifique n'a pas le fichier mychannel.block sur son système de fichiers.

Ce que j'ai ensuite essayé était d'utiliser peer channel fetch 0 -c mychannel . J'obtiens alors l'erreur suivante:

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}

Cependant, lorsque je copie le fichier mychannel.block d'un autre pair, je peux rejoindre mychannel avec succès. La commande peer channel fetch fonctionne également avec succès après avoir rejoint le canal.

Pour moi, cela semble être un scénario de poule et d'oeuf, je dois rejoindre le canal en tant que pair, mais je Je ne peux pas rejoindre parce que j'ai besoin du bloc de genèse. Mais je ne peux pas obtenir le bloc genesis parce que je dois rejoindre la chaîne?

La question est donc de savoir quelle est la commande appropriée pour récupérer la genèse mychannel.block fichier?


3 commentaires

Avez-vous pensé à définir les variables d'environnement pour l'homologue? CORE_PEER_ZZZZ


@emiliomarin oui, ils sont définis correctement.


J'utilise cette commande: peer channel fetch 0 -o $ ORDERER_ADDRESS -c mychannel mais je pense que l'adresse de commande par défaut serait localhost: 7050 (pas mon cas). Assurez-vous que le client fonctionne correctement. Tout ce à quoi je peux penser, ce sont les variables d'environnement ... Voici ce que j'exporte: CORE_PEER_MSPCONFIGPATH, CORE_PEER_ID, CORE_PEER_FILESYSTEMPATH, CORE_PEER_LOCALMSPID, CORE_PEER_LISTENADDRESS, CORE_PEER_ADDRIST_FILESYSTEMPATH, CORE_PEER_LOCALMSPID, CORE_PEER_LISTENADDRESS, CORE_PEER_ADDRIST_ADDRIST, CORE_PEER_CHESS.


3 Réponses :


0
votes

Vous devez ajouter l'indicateur -o ( --orderer ) et le définir sur un point de terminaison de service de commande. Si vous ne définissez pas cet indicateur, alors peer channel fetch essaie d'obtenir le bloc du pair (qui ne l'a évidemment pas). Vous pouvez également spécifier un autre --peer.address / CORE_PEER_ADDRESS lors de l'exécution sans -o pour obtenir le bloc de configuration d'un autre pair également.


0 commentaires

2
votes

Il s'est avéré que j'avais besoin d'ajouter le paramètre de commande -o . De plus, comme je me connectais avec TLS, je devais spécifier --tls true et spécifier le --cafile .

La commande complète est la suivante :?

peer channel fetch 0 -c mychannel -o orderer.example.com:7050 --tls true --cafile $ ORDERER_CA


0 commentaires

0
votes
peer channel fetch 0 -c mychannel 
Note: You don't need to fetch channel in order to join channel
create channel will give .block file as a token of success.join channel will make use of this inorder to complete the joining processIn case you miss .block then you need fetch command Note: for latest fetch commands https://hyperledger-fabric.readthedocs.io/en/release-1.4/commands/peerchannel.htmlpeer channel join -b channel.block --tls --cafile /etc/hyperledger/crypto/peer/tls/ca.crtwhen you try to join a cahnnel you must contact the orderer to get config information that's why you will mention -o orderer_name in order to know about orderer by CLI

0 commentaires