🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 1. 释义 将指定节点加入到一个通道中。 ## 2. 使用方法 ``` ~$ peer channel join [flags] ``` ## 3. 命令标志 ``` -b, --blockpath string Path to file containing genesis block -h, --help help for join ``` 全局标志: ``` --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 ``` ## 4. 示例代码 下面的示例将peer节点加入到文件`./mychannel.genesis.block`中包含的创世块中定义的通, 该通道区块文件是之前使用`peer channel fetch`命令获取到的: ``` ~$ peer channel join -b ./mychannel.genesis.block 2018-02-25 12:25:26.511 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized 2018-02-25 12:25:26.571 UTC [channelCmd] executeJoin -> INFO 006 Successfully submitted proposal to join channel 2018-02-25 12:25:26.571 UTC [main] main -> INFO 007 Exiting..... ``` 可以看到peer节点已经成功地提交了加入通道的请求。