github.com/defanghe/fabric@v2.1.1+incompatible/docs/wrappers/configtxgen_postscript.md (about)

     1  ## Usage
     2  
     3  ### Output a genesis block
     4  
     5  Write a genesis block to `genesis_block.pb` for channel `orderer-system-channel`
     6  for profile `SampleSingleMSPRaftV1_1`.
     7  
     8  ```
     9  configtxgen -outputBlock genesis_block.pb -profile SampleSingleMSPRaftV1_1 -channelID orderer-system-channel
    10  ```
    11  
    12  ### Output a channel creation tx
    13  
    14  Write a channel creation transaction to `create_chan_tx.pb` for profile
    15  `SampleSingleMSPChannelV1_1`.
    16  
    17  ```
    18  configtxgen -outputCreateChannelTx create_chan_tx.pb -profile SampleSingleMSPChannelV1_1 -channelID application-channel-1
    19  ```
    20  
    21  ### Inspect a genesis block
    22  
    23  Print the contents of a genesis block named `genesis_block.pb` to the screen as
    24  JSON.
    25  
    26  ```
    27  configtxgen -inspectBlock genesis_block.pb
    28  ```
    29  
    30  ### Inspect a channel creation tx
    31  
    32  Print the contents of a channel creation tx named `create_chan_tx.pb` to the
    33  screen as JSON.
    34  
    35  ```
    36  configtxgen -inspectChannelCreateTx create_chan_tx.pb
    37  ```
    38  
    39  ### Print an organization definition
    40  
    41  Construct an organization definition based on the parameters such as MSPDir
    42  from `configtx.yaml` and print it as JSON to the screen. (This output is useful
    43  for channel reconfiguration workflows, such as adding a member).
    44  
    45  ```
    46  configtxgen -printOrg Org1
    47  ```
    48  
    49  ### Output anchor peer tx (deprecated)
    50  
    51  Output a channel configuration update transaction `anchor_peer_tx.pb`  based on
    52  the anchor peers defined for Org1 and channel profile SampleSingleMSPChannelV1_1
    53  in `configtx.yaml`. Transaction will set anchor peers for Org1 if no anchor peers
    54  have been set on the channel.
    55  ```
    56  configtxgen -outputAnchorPeersUpdate anchor_peer_tx.pb -profile SampleSingleMSPChannelV1_1 -asOrg Org1
    57  ```
    58  
    59  The `-outputAnchorPeersUpdate` output flag has been deprecated. To set anchor
    60  peers on the channel, use [configtxlator](configtxlator.html) to update the
    61  channel configuration.
    62  
    63  ## Configuration
    64  
    65  The `configtxgen` tool's output is largely controlled by the content of
    66  `configtx.yaml`.  This file is searched for at `FABRIC_CFG_PATH` and must be
    67  present for `configtxgen` to operate.
    68  
    69  Refer to the sample `configtx.yaml` shipped with Fabric for all possible
    70  configuration options.  You may find this file in the `config` directory of
    71  the release artifacts tar, or you may find it under the `sampleconfig` folder
    72  if you are building from source.
    73  
    74  
    75  <a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.