From 1246b1305efbdfc56e07f38a7fbfe17a2aabd10d Mon Sep 17 00:00:00 2001 From: Jason Yellick Date: Tue, 7 Feb 2017 16:37:45 -0500 Subject: [PATCH] [FAB-2108] Add channel config schema https://jira.hyperledger.org/browse/FAB-2108 This CR adds the config schema for the channel configuration (which references the application and orderer config schemas). Change-Id: Id75939622e826af0ce4187d59f9b8ba4d16eb7d1 Signed-off-by: Jason Yellick --- .../configtx/handlers/channel/sharedconfig.go | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/common/configtx/handlers/channel/sharedconfig.go b/common/configtx/handlers/channel/sharedconfig.go index 59c96072956..649a5772549 100644 --- a/common/configtx/handlers/channel/sharedconfig.go +++ b/common/configtx/handlers/channel/sharedconfig.go @@ -20,6 +20,8 @@ import ( "fmt" "math" + "github.com/hyperledger/fabric/common/configtx/handlers/application" + "github.com/hyperledger/fabric/common/configtx/handlers/orderer" "github.com/hyperledger/fabric/common/util" cb "github.com/hyperledger/fabric/protos/common" @@ -27,6 +29,29 @@ import ( "github.com/op/go-logging" ) +const ( + // ApplicationGroupKey is the group name for the application config + ApplicationGroupKey = "Application" + + // OrdererGroupKey is the group name for the orderer config + OrdererGroupKey = "Orderer" +) + +var Schema = &cb.ConfigGroupSchema{ + Groups: map[string]*cb.ConfigGroupSchema{ + ApplicationGroupKey: application.Schema, + OrdererGroupKey: orderer.Schema, + }, + Values: map[string]*cb.ConfigValueSchema{ + HashingAlgorithmKey: nil, + BlockDataHashingStructureKey: nil, + OrdererAddressesKey: nil, + }, + Policies: map[string]*cb.ConfigPolicySchema{ + // TODO, set appropriately once hierarchical policies are implemented + }, +} + // Chain config keys const ( // HashingAlgorithmKey is the cb.ConfigItem type key name for the HashingAlgorithm message