configtxgen command allows users to create and inspect channel config
related artifacts. The content of the generated artifacts is dictated by the
configtxgen tool has no sub-commands, but supports flags which can be set
to accomplish a number of tasks.
Usage of configtxgen:
Performs the config generation as a particular organization (by name), only including values in the write set that org (likely) has privilege to set
Specifies a profile to consider as the orderer system channel current state to allow modification of non-application parameters during channel create tx generation. Only valid in conjunction with 'outputCreateChannelTx'.
The channel ID to use in the configtx
The path containing the configuration to use (if set)
Prints the configuration contained in the block at the specified path
Prints the configuration contained in the transaction at the specified path
[DEPRECATED] Creates a config update to update an anchor peer (works only with the default channel creation, and only for the first update)
The path to write the genesis block to (if set)
The path to write a channel creation configtx to (if set)
Prints the definition of an organization as JSON. (useful for adding an org to a channel manually)
The profile from configtx.yaml to use for generation.
Show version information
Output a genesis block¶
Write a genesis block to
genesis_block.pb for channel
configtxgen -outputBlock genesis_block.pb -profile SampleSingleMSPRaftV1_1 -channelID orderer-system-channel
Output a channel creation tx¶
Write a channel creation transaction to
create_chan_tx.pb for profile
configtxgen -outputCreateChannelTx create_chan_tx.pb -profile SampleSingleMSPChannelV1_1 -channelID application-channel-1
Inspect a genesis block¶
Print the contents of a genesis block named
genesis_block.pb to the screen as
configtxgen -inspectBlock genesis_block.pb
Inspect a channel creation tx¶
Print the contents of a channel creation tx named
create_chan_tx.pb to the
screen as JSON.
configtxgen -inspectChannelCreateTx create_chan_tx.pb
Print an organization definition¶
Construct an organization definition based on the parameters such as MSPDir
configtx.yaml and print it as JSON to the screen. (This output is useful
for channel reconfiguration workflows, such as adding a member).
configtxgen -printOrg Org1
Output anchor peer tx (deprecated)¶
Output a channel configuration update transaction
anchor_peer_tx.pb based on
the anchor peers defined for Org1 and channel profile SampleSingleMSPChannelV1_1
configtx.yaml. Transaction will set anchor peers for Org1 if no anchor peers
have been set on the channel.
configtxgen -outputAnchorPeersUpdate anchor_peer_tx.pb -profile SampleSingleMSPChannelV1_1 -asOrg Org1
-outputAnchorPeersUpdate output flag has been deprecated. To set anchor
peers on the channel, use configtxlator to update the
configtxgen tool”s output is largely controlled by the content of
configtx.yaml. This file is searched for at
FABRIC_CFG_PATH and must be
configtxgen to operate.
Refer to the sample
configtx.yaml shipped with Fabric for all possible
configuration options. You may find this file in the
config directory of
the release artifacts tar, or you may find it under the
if you are building from source.
This work is licensed under a Creative Commons Attribution 4.0 International License.