github.com/kaituanwang/hyperledger@v2.0.1+incompatible/docs/source/orderer_deploy.md (about)

     1  # Setting up an ordering node
     2  
     3  In this topic, we'll describe the process for bootstrapping an ordering node.
     4  If you want more information about the different ordering service implementations
     5  and their relative strengths and weaknesses, check out our
     6  [conceptual documentation about ordering](./orderer/ordering_service.html).
     7  
     8  Broadly, this topic will involve a few interrelated steps:
     9  
    10  1. Creating the organization your ordering node belongs to (if you have not already
    11     done so)
    12  2. Configuring your node (using `orderer.yaml`)
    13  3. Creating the genesis block for the orderer system channel
    14  4. Bootstrapping the orderer
    15  
    16  Note: this topic assumes you have already pulled the Hyperledger Fabric orderer
    17  images from docker hub.
    18  
    19  ## Create an organization definition
    20  
    21  Like peers, all orderers must belong to an organization that must be created
    22  before the orderer itself is created. This organization has a definition
    23  encapsulated by a [Membership Service Provider](./membership/membership.html)
    24  (MSP) that is created by a Certificate Authority (CA) dedicated to creating the
    25  certificates and MSP for the organization.
    26  
    27  For information about creating a CA and using it to create users and an MSP,
    28  check out the [Fabric CA user's guide](https://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html).
    29  
    30  ## Configure your node
    31  
    32  The configuration of the orderer is handled through a `yaml` file called
    33  `orderer.yaml`. The `FABRIC_CFG_PATH` environment variable is used to point to
    34  an `orderer.yaml` file you've configured, which will extract a series of files
    35  and certificates on your file system.
    36  
    37  To look at a sample `orderer.yaml`, check out the [`fabric-samples` github repo](https://github.com/hyperledger/fabric/blob/{BRANCH}/sampleconfig/orderer.yaml), which **should be read and studied closely** before proceeding.
    38  Note in particular a few values:
    39  
    40  * `LocalMSPID` --- this is the name of the MSP, generated by your CA, of your
    41  orderer organization. This is where your orderer organization admins will be
    42  listed.
    43  
    44  * `LocalMSPDir` --- the place in your file system where the local MSP is located.
    45  
    46  *  `# TLS enabled`, `Enabled: false`. This is where you specify whether you want
    47  to [enable TLS](enable_tls.html). If you set this value to `true`, you will have
    48  to specify the locations of the relevant TLS certificates. Note that this is
    49  mandatory for Raft nodes.
    50  
    51  * `BootstrapFile` --- this is the name of the genesis block you will generate for
    52  this ordering service.
    53  
    54  * `BootstrapMethod` --- the method by which the bootstrap block is given. For now,
    55  this can only be `file`, in which the file in the `BootstrapFile` is specified.
    56  
    57  If you are deploying this node as part of a cluster (for example, as part of a
    58  cluster of Raft nodes), make note of the `Cluster` and `Consensus` sections.
    59  
    60  If you plan to deploy a Kafka based ordering service, you will need to complete
    61  the `Kafka` section.
    62  
    63  ## Generate the genesis block of the orderer
    64  
    65  The first block of a newly created channel is known as a "genesis block". If
    66  this genesis block is being created as part of the creation of a **new network**
    67  (in other words, if the orderer being created will not be joined to an existing
    68  cluster of orderers), then this genesis block will be the first block of the "orderer
    69  system channel" (also known as the "ordering system channel"), a special channel
    70  managed by the orderer admins which includes a list of the organizations permitted
    71  to create channels. *The genesis block of the orderer system channel is special:
    72  it must be created and included in the configuration of the node before the node
    73  can be started.*
    74  
    75  To learn how to create a genesis block using the `configtxgen` tool, check out
    76  [Channel Configuration (configtx)](configtx.html).
    77  
    78  ## Bootstrap the ordering node
    79  
    80  Once you have built the images, created the MSP, configured your `orderer.yaml`,
    81  and created the genesis block, you're ready to start your orderer using a
    82  command that will look similar to:
    83  
    84  ```
    85  docker-compose -f docker-compose-cli.yaml up -d --no-deps orderer.example.com
    86  ```
    87  
    88  With the address of your orderer replacing `orderer.example.com`.
    89  
    90  <!--- Licensed under Creative Commons Attribution 4.0 International License
    91  https://creativecommons.org/licenses/by/4.0/) -->