You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[FAB-2584] configtxgen prints block config as json
https://jira.hyperledger.org/browse/FAB-2584
This CR leverages the work from FAB-2577 to allow the configtxgen tool
to dump the configuration inside a configuration block to the screen as
JSON. This allows for the inspection of the genesis material.
Change-Id: I863286b88f456adf7a7958af86306de148991817
Signed-off-by: Jason Yellick <[email protected]>
This document describe the usage for the `configtxgen` utility for manipulating fabric channel configuration.
4
+
5
+
For now, the tool is primarily focused on generating the genesis block for bootstrapping the orderer, but it is intended to be enhanced in the future for generating new channel configurations as well as reconfiguring existing channels.
6
+
7
+
## Building the tool
8
+
9
+
Building the tool is as simple as `make configtxgen`. This will create a `configtxgen` binary at `build/bin/configtxgen` which is included in the Vagrant development environment path by default.
10
+
11
+
## Configuration Profiles
12
+
13
+
The configuration parameters supplied to the `configtxgen` tool are primarily provided by the `configtx.yaml` file. This file is located at `fabric/common/configtx/tool/configtx.yaml` in the fabric.git repository.
14
+
15
+
This configuration file is split primarily into three pieces.
16
+
17
+
1. The `Profiles` section. By default, this section includes some sample configurations which can be used for development or testing scenarios, and refer to crypto material present in the fabric.git tree. These profiles can make a good starting point for construction a real deployment profile. The `configtxgen` tool allows you to specify the profile it is operating under by passing the `-profile` flag. Profiles may explicitly declare all configuration, but usually inherit configuration from the defaults in (3) below.
18
+
2. The `Organizations` section. By default, this section includes a single reference to the sampleconfig MSP definition. For production deployments, the sample organization should be removed, and the MSP definitions of the network members should be referenced and defined instead. Each element in the `Organizations` section should be tagged with an anchor label such as `&orgName` which will allow the definition to be referenced in the `Profiles` sections.
19
+
3. The default sections. There are default sections for `Orderer` and `Application` configuration, these include attributes like `BatchTimeout` and are generally used as the base inherited values for the profiles.
20
+
21
+
This configuration file may be edited, or, individual properties may be overridden by setting environment variables, such as `CONFIGTX_ORDERER_ORDERERTYPE=kafka`. Note that the `Profiles` element and profile name do not need to be specified.
22
+
23
+
## Bootstrapping the orderer
24
+
After creating a configuration profile as desired, simply invoke
This will produce a `genesis.block` file in the current directory. If you wish to skip writing the file simply do not pass `outputBlock`
29
+
30
+
Then, to utilize this genesis block, before starting the orderer, simply specify `ORDERER_GENERAL_GENESISMETHOD=file` and `ORDERER_GENERAL_GENESISFILE=$PWD/genesis.block` or modify the `orderer.yaml` file to encode these values.
31
+
32
+
## Creating a channel
33
+
34
+
The tool can also output a channel creation tx by executing
This will output a marshaled `Envelope` message which may be sent to broadcast to create a channel.
41
+
42
+
## Reviewing a configuration block
43
+
44
+
In addition to creating configuration, the `configtxgen` tool is also capable of inspecting configuration. You may even wish to combine the inspection with generation. For example:
0 commit comments