Skip to content

Commit 6f4a391

Browse files
author
Jason Yellick
committed
[FAB-2336] Add application/MSP to genesis.yaml
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 <[email protected]>
1 parent 50372c1 commit 6f4a391

File tree

2 files changed

+85
-6
lines changed

2 files changed

+85
-6
lines changed

common/configtx/tool/genesis.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
---
2+
################################################################################
3+
#
4+
# Section: Organizations
5+
#
6+
# - This section defines the different organizational identities which will
7+
# be referenced later in the configuration.
8+
#
9+
################################################################################
10+
Organizations:
11+
12+
- &defaultOrg
13+
# DefaultOrg defines the organization which is used in the sampleconfig
14+
# of the fabric.git development environment
15+
Name: defaultOrg
16+
17+
# ID to load the MSP definition as
18+
ID: DEFAULT
19+
20+
# MSPDir is the filesystem path which contains the MSP configuration
21+
MSPDir: msp/sampleconfig
22+
23+
24+
AnchorPeers:
25+
# AnchorPeers defines the location of peers which can be used
26+
# for cross org gossip communication. Note, this value is only
27+
# encoded in the genesis block in the Application section context
28+
- Host: 127.0.0.1
29+
Port: 7051
30+
231
################################################################################
332
#
433
# SECTION: Orderer
@@ -40,3 +69,26 @@ Orderer:
4069
Brokers:
4170
- 127.0.0.1:9092
4271

72+
# Organizations is the list of orgs which are defined as participants on
73+
# the orderer side of the network
74+
Organizations:
75+
76+
# The default organization as defined in the organization section
77+
- *defaultOrg
78+
79+
################################################################################
80+
#
81+
# SECTION: Application
82+
#
83+
# - This section defines the values to encode into a config transaction or
84+
# genesis block for application related parameters
85+
#
86+
################################################################################
87+
Application:
88+
89+
# Organizations is the list of orgs which are defined as participants on
90+
# the application side of the network
91+
Organizations:
92+
93+
# The default organization as defined in the organization section
94+
- *defaultOrg

common/configtx/tool/localconfig/config.go

+33-6
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,43 @@ const Prefix string = "CONFIGTX"
4040

4141
// TopLevel contains the genesis structures for use by the provisional bootstrapper
4242
type TopLevel struct {
43-
Orderer Orderer
43+
Application Application
44+
Organizations []*Organization
45+
Orderer Orderer
46+
}
47+
48+
type Application struct {
49+
Organizations []*Organization
50+
}
51+
52+
type Organization struct {
53+
Name string
54+
ID string
55+
MSPDir string
56+
57+
// Note, the viper deserialization does not seem to care for
58+
// embedding of types, so we use one organization structure for
59+
// both orderers and applications
60+
AnchorPeers []*AnchorPeer
61+
}
62+
63+
type AnchorPeer struct {
64+
Host string
65+
Port int
66+
}
67+
68+
type ApplicationOrganization struct {
69+
Organization
4470
}
4571

4672
// Orderer contains config which is used for orderer genesis by the provisional bootstrapper
4773
type Orderer struct {
48-
OrdererType string
49-
Addresses []string
50-
BatchTimeout time.Duration
51-
BatchSize BatchSize
52-
Kafka Kafka
74+
OrdererType string
75+
Addresses []string
76+
BatchTimeout time.Duration
77+
BatchSize BatchSize
78+
Kafka Kafka
79+
Organizations []*Organization
5380
}
5481

5582
// BatchSize contains configuration affecting the size of batches

0 commit comments

Comments
 (0)