Skip to content

Commit

Permalink
[FAB-2336] Add application/MSP to genesis.yaml
Browse files Browse the repository at this point in the history
https://jira.hyperledger.org/browse/FAB-2336

The genesis.yaml file currently only contains the bootstrapping
parameters necessary for the orderer (without MSPs).  This CR adds the
additional configuration variables needed for MSPs and the application
side, and populates them into config structures.  No one consumes them
yet however.

Change-Id: Ia40a14de9d90f6e06dd96a9b226a72712fbbea2b
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
  • Loading branch information
Jason Yellick committed Feb 18, 2017
1 parent 50372c1 commit 6f4a391
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 6 deletions.
52 changes: 52 additions & 0 deletions common/configtx/tool/genesis.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
---
################################################################################
#
# Section: Organizations
#
# - This section defines the different organizational identities which will
# be referenced later in the configuration.
#
################################################################################
Organizations:

- &defaultOrg
# DefaultOrg defines the organization which is used in the sampleconfig
# of the fabric.git development environment
Name: defaultOrg

# ID to load the MSP definition as
ID: DEFAULT

# MSPDir is the filesystem path which contains the MSP configuration
MSPDir: msp/sampleconfig


AnchorPeers:
# AnchorPeers defines the location of peers which can be used
# for cross org gossip communication. Note, this value is only
# encoded in the genesis block in the Application section context
- Host: 127.0.0.1
Port: 7051

################################################################################
#
# SECTION: Orderer
Expand Down Expand Up @@ -40,3 +69,26 @@ Orderer:
Brokers:
- 127.0.0.1:9092

# Organizations is the list of orgs which are defined as participants on
# the orderer side of the network
Organizations:

# The default organization as defined in the organization section
- *defaultOrg

################################################################################
#
# SECTION: Application
#
# - This section defines the values to encode into a config transaction or
# genesis block for application related parameters
#
################################################################################
Application:

# Organizations is the list of orgs which are defined as participants on
# the application side of the network
Organizations:

# The default organization as defined in the organization section
- *defaultOrg
39 changes: 33 additions & 6 deletions common/configtx/tool/localconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,43 @@ const Prefix string = "CONFIGTX"

// TopLevel contains the genesis structures for use by the provisional bootstrapper
type TopLevel struct {
Orderer Orderer
Application Application
Organizations []*Organization
Orderer Orderer
}

type Application struct {
Organizations []*Organization
}

type Organization struct {
Name string
ID string
MSPDir string

// Note, the viper deserialization does not seem to care for
// embedding of types, so we use one organization structure for
// both orderers and applications
AnchorPeers []*AnchorPeer
}

type AnchorPeer struct {
Host string
Port int
}

type ApplicationOrganization struct {
Organization
}

// Orderer contains config which is used for orderer genesis by the provisional bootstrapper
type Orderer struct {
OrdererType string
Addresses []string
BatchTimeout time.Duration
BatchSize BatchSize
Kafka Kafka
OrdererType string
Addresses []string
BatchTimeout time.Duration
BatchSize BatchSize
Kafka Kafka
Organizations []*Organization
}

// BatchSize contains configuration affecting the size of batches
Expand Down

0 comments on commit 6f4a391

Please sign in to comment.