github.com/kaituanwang/hyperledger@v2.0.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 50 51 Output a configuration update transaction to `anchor_peer_tx.pb` which sets the 52 anchor peers for organization Org1 as defined in profile 53 SampleSingleMSPChannelV1_1 based on `configtx.yaml`. 54 55 ``` 56 configtxgen -outputAnchorPeersUpdate anchor_peer_tx.pb -profile SampleSingleMSPChannelV1_1 -asOrg Org1 57 ``` 58 59 ## Configuration 60 61 The `configtxgen` tool's output is largely controlled by the content of 62 `configtx.yaml`. This file is searched for at `FABRIC_CFG_PATH` and must be 63 present for `configtxgen` to operate. 64 65 Refer to the sample `configtx.yaml` shipped with Fabric for all possible 66 configuration options. You may find this file in the `config` directory of 67 the release artifacts tar, or you may find it under the `sampleconfig` folder 68 if you are building from source. 69 70 71 <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>.