Skip to content

Commit

Permalink
[FAB-16056] Display config block num for CLI
Browse files Browse the repository at this point in the history
CLI user want to see only the config block num, instead of two block
numbers when fetching the config block.

However the newest block number log can not be removed. So add a new
log to point out the config block number:

$ peer channel fetch config -c mychannel

InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
readBlock -> INFO 002 Received block: 4
fetch -> INFO 003 Retrieving last config block: 2
readBlock -> INFO 004 Received block: 2

Signed-off-by: Shitaibin <hz_stb@163.com>
Change-Id: I1d359b93f4d48786b8404cbb3484f0710c7eb829
  • Loading branch information
Shitaibin committed Aug 15, 2019
1 parent e40b33e commit ea2316f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions peer/channel/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func fetch(cmd *cobra.Command, args []string, cf *ChannelCmdFactory) error {
return err2
}
block, err = cf.DeliverClient.GetSpecifiedBlock(lc)
logger.Infof("Retrieving last config block: %d", lc)
default:
num, err2 := strconv.Atoi(args[0])
if err2 != nil {
Expand Down

0 comments on commit ea2316f

Please sign in to comment.