Skip to content

Commit 9e77006

Browse files
committedNov 7, 2017
[FAB-6803] Rename capabilities key V1.1 to V1_1
We are using an old version of Viper, which has problems locating keys with period. It uses period as delimiter for the path of a nested structure, therefore, foo.bar.V1.1 would result in foo: bar: V1: 1 instead of foo: bar: V1.1: as we expected. This patch simply renames "V1.1" to "V1_1" to avoid this problem. Change-Id: Iebfa5ca40038beacd2bf4ccff3639b9e5e4ce0f0 Signed-off-by: Jay Guo <guojiannan1101@gmail.com>
1 parent 9f89f2e commit 9e77006

File tree

5 files changed

+60
-6
lines changed

5 files changed

+60
-6
lines changed
 

‎common/capabilities/application.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const (
1414
applicationTypeName = "Application"
1515

1616
// ApplicationV1_1 is the capabilties string for standard new non-backwards compatible fabric v1.1 application capabilities.
17-
ApplicationV1_1 = "V1.1"
17+
ApplicationV1_1 = "V1_1"
1818
)
1919

2020
// ApplicationProvider provides capabilities information for application level config.

‎common/capabilities/channel.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const (
1515
channelTypeName = "Channel"
1616

1717
// ChannelV1_1 is the capabilties string for standard new non-backwards compatible fabric v1.1 channel capabilities.
18-
ChannelV1_1 = "V1.1"
18+
ChannelV1_1 = "V1_1"
1919
)
2020

2121
// ChannelProvider provides capabilities information for channel level config.

‎common/capabilities/orderer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const (
1414
ordererTypeName = "Orderer"
1515

1616
// OrdererV1_1 is the capabilties string for standard new non-backwards compatible fabric v1.1 orderer capabilities.
17-
OrdererV1_1 = "V1.1"
17+
OrdererV1_1 = "V1_1"
1818
)
1919

2020
// OrdererProvider provides capabilities information for orderer level config.

‎examples/e2e_cli/configtx.yaml

+54
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515
Profiles:
1616

1717
TwoOrgsOrdererGenesis:
18+
Capabilities:
19+
<<: *GlobalCapabilities
1820
Orderer:
1921
<<: *OrdererDefaults
2022
Organizations:
2123
- *OrdererOrg
24+
Capabilities:
25+
<<: *OrdererCapabilities
2226
Consortiums:
2327
SampleConsortium:
2428
Organizations:
@@ -31,6 +35,8 @@ Profiles:
3135
Organizations:
3236
- *Org1
3337
- *Org2
38+
Capabilities:
39+
<<: *ApplicationCapabilities
3440

3541
################################################################################
3642
#
@@ -151,3 +157,51 @@ Application: &ApplicationDefaults
151157
# Organizations is the list of orgs which are defined as participants on
152158
# the application side of the network
153159
Organizations:
160+
################################################################################
161+
#
162+
# SECTION: Capabilities
163+
#
164+
# - This section defines the capabilities of fabric network. This is a new
165+
# concept as of v1.1.0 and should not be utilized in mixed networks with
166+
# v1.0.x peers and orderers. Capabilities define features which must be
167+
# present in a fabric binary for that binary to safely participate in the
168+
# fabric network. For instance, if a new MSP type is added, newer binaries
169+
# might recognize and validate the signatures from this type, while older
170+
# binaries without this support would be unable to validate those
171+
# transactions. This could lead to different versions of the fabric binaries
172+
# having different world states. Instead, defining a capability for a channel
173+
# informs those binaries without this capability that they must cease
174+
# processing transactions until they have been upgraded. For v1.0.x if any
175+
# capabilities are defined (including a map with all capabilities turned off)
176+
# then the v1.0.x peer will deliberately crash.
177+
#
178+
################################################################################
179+
Capabilities:
180+
# Global capabilities apply to both the orderers and the peers and must be
181+
# supported by both. Set the value of the capability to true to require it.
182+
Global: &GlobalCapabilities
183+
# V1.1 for Global is a catchall flag for behavior which has been
184+
# determined to be desired for all orderers and peers running v1.0.x,
185+
# but the modification of which would cause imcompatibilities. Users
186+
# should leave this flag set to true.
187+
V1_1: true
188+
189+
# Orderer capabilities apply only to the orderers, and may be safely
190+
# manipulated without concern for upgrading peers. Set the value of the
191+
# capability to true to require it.
192+
Orderer: &OrdererCapabilities
193+
# V1.1 for Order is a catchall flag for behavior which has been
194+
# determined to be desired for all orderers running v1.0.x, but the
195+
# modification of which would cause imcompatibilities. Users should
196+
# leave this flag set to true.
197+
V1_1: true
198+
199+
# Application capabilities apply only to the peer network, and may be safely
200+
# manipulated without concern for upgrading orderers. Set the value of the
201+
# capability to true to require it.
202+
Application: &ApplicationCapabilities
203+
# V1.1 for Application is a catchall flag for behavior which has been
204+
# determined to be desired for all peers running v1.0.x, but the
205+
# modification of which would cause imcompatibilities. Users should
206+
# leave this flag set to true.
207+
V1_1: true

‎sampleconfig/configtx.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ Capabilities:
319319
# determined to be desired for all orderers and peers running v1.0.x,
320320
# but the modification of which would cause imcompatibilities. Users
321321
# should leave this flag set to true.
322-
"V1.1": true
322+
V1_1: true
323323

324324
# Orderer capabilities apply only to the orderers, and may be safely
325325
# manipulated without concern for upgrading peers. Set the value of the
@@ -329,7 +329,7 @@ Capabilities:
329329
# determined to be desired for all orderers running v1.0.x, but the
330330
# modification of which would cause imcompatibilities. Users should
331331
# leave this flag set to true.
332-
"V1.1": true
332+
V1_1: true
333333

334334
# Application capabilities apply only to the peer network, and may be safely
335335
# manipulated without concern for upgrading orderers. Set the value of the
@@ -339,4 +339,4 @@ Capabilities:
339339
# determined to be desired for all peers running v1.0.x, but the
340340
# modification of which would cause imcompatibilities. Users should
341341
# leave this flag set to true.
342-
"V1.1": true
342+
V1_1: true

0 commit comments

Comments
 (0)
Please sign in to comment.