peer channel update
签名并发送指定的通道configtx更新文件。需要-f
、-o
和-c
标志。
使用方法
~$ peer channel update [flags]
命令标志
-c, --channelID string In case of a newChain command, the channel ID to create. It must be all lower case, less than 250 characters long and match the regular expression: [a-z][a-z0-9.-]*
-f, --file string Configuration transaction file generated by a tool such as configtxgen for submitting to orderer
-h, --help help for update
全局标志:
--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
示例代码
下面的示例使用文件./updatechannel.txn
中的配置交易更新通道mychannel,
使用位于orderer.example.com:7050的排序器向所有peer节点发送配置交易以便更新其
通道配置:
~$ peer channel update -c mychannel -f ./updatechannel.txn -o orderer.example.com:7050
2018-02-23 06:32:11.569 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-02-23 06:32:11.626 UTC [main] main -> INFO 010 Exiting.....
执行到这一步时,通道mychannel已经成功更新了。