## 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节点已经成功地提交了加入通道的请求。
- Fabric命令手册
- Peer命令
- peer
- peer node
- peer node start
- peer node status
- peer channel
- peer channel create
- peer channel fetch
- peer channel getinfo
- peer channel join
- peer channel list
- peer channel signconfigtx
- peer channel update
- peer chaincode
- peer chaincode install
- peer chaincode instantiate
- peer chaincode invoke
- peer chaincode list
- peer chaincode package
- peer chaincode query
- peer chaincode signpackage
- peer chaincode upgrade
- peer version
- peer logging
- peer logging getlevel
- peer logging revertlevels
- peer logging setlevel
- Configtxgen命令
- configtxgen
- Configtxlator命令
- configtxlator
- configtxlator start
- configtxlator proto_encode
- configtxlator proto_decode
- configtxlator compute_update
- configtxlator version
- Cryptogen命令
- cryptogen
- cryptogen help
- cryptogen generate
- cryptogen showtemplate
- FabricCA命令
- fabric-ca-client
- fabric-ca-server