const ( // ApplicationGroupKey is the group name for the Application config ApplicationGroupKey = "Application" // ACLsKey is the name of the ACLs config ACLsKey = "ACLs" )
Channel config keys
const ( // ConsortiumKey is the key for the cb.ConfigValue for the Consortium message ConsortiumKey = "Consortium" // HashingAlgorithmKey is the cb.ConfigItem type key name for the HashingAlgorithm message HashingAlgorithmKey = "HashingAlgorithm" // BlockDataHashingStructureKey is the cb.ConfigItem type key name for the BlockDataHashingStructure message BlockDataHashingStructureKey = "BlockDataHashingStructure" // OrdererAddressesKey is the cb.ConfigItem type key name for the OrdererAddresses message OrdererAddressesKey = "OrdererAddresses" // GroupKey is the name of the channel group ChannelGroupKey = "Channel" // CapabilitiesKey is the name of the key which refers to capabilities, it appears at the channel, // application, and orderer levels and this constant is used for all three. CapabilitiesKey = "Capabilities" )
const ( // ConsensusTypeKey is the cb.ConfigItem type key name for the ConsensusType message. ConsensusTypeKey = "ConsensusType" // BatchSizeKey is the cb.ConfigItem type key name for the BatchSize message. BatchSizeKey = "BatchSize" // BatchTimeoutKey is the cb.ConfigItem type key name for the BatchTimeout message. BatchTimeoutKey = "BatchTimeout" // ChannelRestrictionsKey is the key name for the ChannelRestrictions message. ChannelRestrictionsKey = "ChannelRestrictions" // KafkaBrokersKey is the cb.ConfigItem type key name for the KafkaBrokers message. KafkaBrokersKey = "KafkaBrokers" // EndpointsKey is the cb.COnfigValue key name for the Endpoints message in the OrdererOrgGroup. EndpointsKey = "Endpoints" )
const ( // ReadersPolicyKey is the key used for the read policy ReadersPolicyKey = "Readers" // WritersPolicyKey is the key used for the read policy WritersPolicyKey = "Writers" // AdminsPolicyKey is the key used for the read policy AdminsPolicyKey = "Admins" )
const ( // AnchorPeersKey is the key name for the AnchorPeers ConfigValue AnchorPeersKey = "AnchorPeers" )
const ( // ChannelCreationPolicyKey is the key used in the consortium config to denote the policy // to be used in evaluating whether a channel creation request is authorized ChannelCreationPolicyKey = "ChannelCreationPolicy" )
const ( // ConsortiumsGroupKey is the group name for the consortiums config ConsortiumsGroupKey = "Consortiums" )
const ( // MSPKey is the key for the MSP definition in orderer groups MSPKey = "MSP" )
const ( // OrdererGroupKey is the group name for the orderer config. OrdererGroupKey = "Orderer" )
RootGroupKey is the key for namespacing the channel config, especially for policy evaluation.
const RootGroupKey = "Channel"
func DeserializeProtoValuesFromGroup(group *cb.ConfigGroup, protosStructs ...interface{}) error
DeserializeGroup deserializes the value for all values in a config group
func LogSanityChecks(res Resources)
func MarshalEtcdRaftMetadata(md *etcdraft.ConfigMetadata) ([]byte, error)
MarshalEtcdRaftMetadata serializes etcd RAFT metadata.
func MarshalSmartBFTMetadata(md *smartbft.ConfigMetadata) ([]byte, error)
MarshalSmartBFTMetadata serializes Smart BFT metadata.
func ValidateCapabilities(block *cb.Block) error
ValidateCapabilities validates whether the peer can meet the capabilities requirement in the given config block
Application stores the common shared application config
type Application interface { // Organizations returns a map of org ID to ApplicationOrg Organizations() map[string]ApplicationOrg // APIPolicyMapper returns a PolicyMapper that maps API names to policies APIPolicyMapper() PolicyMapper // Capabilities defines the capabilities for the application portion of a channel Capabilities() ApplicationCapabilities }
ApplicationCapabilities defines the capabilities for the application portion of a channel
type ApplicationCapabilities interface { // Supported returns an error if there are unknown capabilities in this channel which are required Supported() error // ForbidDuplicateTXIdInBlock specifies whether two transactions with the same TXId are permitted // in the same block or whether we mark the second one as TxValidationCode_DUPLICATE_TXID ForbidDuplicateTXIdInBlock() bool // ACLs returns true is ACLs may be specified in the Application portion of the config tree ACLs() bool // PrivateChannelData returns true if support for private channel data (a.k.a. collections) is enabled. // In v1.1, the private channel data is experimental and has to be enabled explicitly. // In v1.2, the private channel data is enabled by default. PrivateChannelData() bool // CollectionUpgrade returns true if this channel is configured to allow updates to // existing collection or add new collections through chaincode upgrade (as introduced in v1.2) CollectionUpgrade() bool // V1_1Validation returns true is this channel is configured to perform stricter validation // of transactions (as introduced in v1.1). V1_1Validation() bool // V1_2Validation returns true is this channel is configured to perform stricter validation // of transactions (as introduced in v1.2). V1_2Validation() bool // V1_3Validation returns true if this channel supports transaction validation // as introduced in v1.3. This includes: // - policies expressible at a ledger key granularity, as described in FAB-8812 // - new chaincode lifecycle, as described in FAB-11237 V1_3Validation() bool // StorePvtDataOfInvalidTx() returns true if the peer needs to store the pvtData of // invalid transactions. StorePvtDataOfInvalidTx() bool // MetadataLifecycle indicates whether the peer should use the deprecated and problematic // v1.0/v1.1 lifecycle, or whether it should use the newer per channel peer local chaincode // metadata package approach planned for release with Fabric v1.2 MetadataLifecycle() bool // KeyLevelEndorsement returns true if this channel supports endorsement // policies expressible at a ledger key granularity, as described in FAB-8812 KeyLevelEndorsement() bool // FabToken returns true if this channel supports FabToken functions FabToken() bool }
ApplicationConfig implements the Application interface
type ApplicationConfig struct {
// contains filtered or unexported fields
}
func NewApplicationConfig(appGroup *cb.ConfigGroup, mspConfig *MSPConfigHandler) (*ApplicationConfig, error)
NewApplicationConfig creates config from an Application config group
func (ac *ApplicationConfig) APIPolicyMapper() PolicyMapper
APIPolicyMapper returns a PolicyMapper that maps API names to policies
func (ac *ApplicationConfig) Capabilities() ApplicationCapabilities
Capabilities returns a map of capability name to Capability
func (ac *ApplicationConfig) Organizations() map[string]ApplicationOrg
Organizations returns a map of org ID to ApplicationOrg
ApplicationOrg stores the per org application config
type ApplicationOrg interface { Org // AnchorPeers returns the list of gossip anchor peers AnchorPeers() []*pb.AnchorPeer }
ApplicationOrgConfig defines the configuration for an application org
type ApplicationOrgConfig struct { *OrganizationConfig // contains filtered or unexported fields }
func NewApplicationOrgConfig(id string, orgGroup *cb.ConfigGroup, mspConfig *MSPConfigHandler) (*ApplicationOrgConfig, error)
NewApplicationOrgConfig creates a new config for an application org
func (aog *ApplicationOrgConfig) AnchorPeers() []*pb.AnchorPeer
AnchorPeers returns the list of anchor peers of this Organization
func (aoc *ApplicationOrgConfig) Validate() error
ApplicationOrgProtos are deserialized from the config
type ApplicationOrgProtos struct { AnchorPeers *pb.AnchorPeers }
ApplicationProtos is used as the source of the ApplicationConfig
type ApplicationProtos struct { ACLs *pb.ACLs Capabilities *cb.Capabilities }
Bundle is a collection of resources which will always have a consistent view of the channel configuration. In particular, for a given bundle reference, the config sequence, the policy manager etc. will always return exactly the same value. The Bundle structure is immutable and will always be replaced in its entirety, with new backing memory.
type Bundle struct {
// contains filtered or unexported fields
}
func NewBundle(channelID string, config *cb.Config) (*Bundle, error)
NewBundle creates a new immutable bundle of configuration
func NewBundleFromEnvelope(env *cb.Envelope) (*Bundle, error)
NewBundleFromEnvelope wraps the NewBundle function, extracting the needed information from a full configtx
func (b *Bundle) ApplicationConfig() (Application, bool)
ApplicationConfig returns the configtxapplication.SharedConfig for the channel and whether the Application config exists.
func (b *Bundle) ChannelConfig() Channel
ChannelConfig returns the config.Channel for the chain.
func (b *Bundle) ConfigtxValidator() configtx.Validator
ConfigtxValidator returns the configtx.Validator for the channel.
func (b *Bundle) ConsortiumsConfig() (Consortiums, bool)
ConsortiumsConfig returns the config.Consortiums for the channel and whether the consortiums config exists.
func (b *Bundle) MSPManager() msp.MSPManager
MSPManager returns the MSP manager constructed for this config.
func (b *Bundle) OrdererConfig() (Orderer, bool)
OrdererConfig returns the config.Orderer for the channel and whether the Orderer config exists.
func (b *Bundle) PolicyManager() policies.Manager
PolicyManager returns the policy manager constructed for this config.
func (b *Bundle) ValidateNew(nb Resources) error
ValidateNew checks if a new bundle's contained configuration is valid to be derived from the current bundle. This allows checks of the nature "Make sure that the consensus type did not change".
BundleActor performs an operation based on the given bundle
type BundleActor func(bundle *Bundle)
BundleSource stores a reference to the current configuration bundle It also provides a method to update this bundle. The assorted methods largely pass through to the underlying bundle, but do so through an atomic pointer so that gross go-routine reads are not vulnerable to out-of-order execution memory type bugs.
type BundleSource struct {
// contains filtered or unexported fields
}
func NewBundleSource(bundle *Bundle, callbacks ...BundleActor) *BundleSource
NewBundleSource creates a new BundleSource with an initial Bundle value The callbacks will be invoked whenever the Update method is called for the BundleSource. Note, these callbacks are called immediately before this function returns.
func (bs *BundleSource) ApplicationConfig() (Application, bool)
ApplicationConfig returns the Application config for the channel and whether the Application config exists
func (bs *BundleSource) ChannelConfig() Channel
ChannelConfig returns the config.Channel for the chain
func (bs *BundleSource) ConfigtxValidator() configtx.Validator
ConfigtxValidator returns the configtx.Validator for the channel
func (bs *BundleSource) ConsortiumsConfig() (Consortiums, bool)
ConsortiumsConfig() returns the config.Consortiums for the channel and whether the consortiums config exists
func (bs *BundleSource) MSPManager() msp.MSPManager
MSPManager returns the MSP manager constructed for this config
func (bs *BundleSource) OrdererConfig() (Orderer, bool)
OrdererConfig returns the config.Orderer for the channel and whether the Orderer config exists
func (bs *BundleSource) PolicyManager() policies.Manager
PolicyManager returns the policy manager constructed for this config
func (bs *BundleSource) StableBundle() *Bundle
StableBundle returns a pointer to a stable Bundle. It is stable because calls to its assorted methods will always return the same result, as the underlying data structures are immutable. For instance, calling BundleSource.Orderer() and BundleSource.MSPManager() to get first the list of orderer orgs, then querying the MSP for those org definitions could result in a bug because an update might replace the underlying Bundle in between. Therefore, for operations which require consistency between the Bundle calls, the caller should first retrieve a StableBundle, then operate on it.
func (bs *BundleSource) Update(newBundle *Bundle)
Update sets a new bundle as the bundle source and calls any registered callbacks
func (bs *BundleSource) ValidateNew(resources Resources) error
ValidateNew passes through to the current bundle
Channel gives read only access to the channel configuration
type Channel interface { // HashingAlgorithm returns the default algorithm to be used when hashing // such as computing block hashes, and CreationPolicy digests HashingAlgorithm() func(input []byte) []byte // BlockDataHashingStructureWidth returns the width to use when constructing the // Merkle tree to compute the BlockData hash BlockDataHashingStructureWidth() uint32 // OrdererAddresses returns the list of valid orderer addresses to connect to to invoke Broadcast/Deliver OrdererAddresses() []string // Capabilities defines the capabilities for a channel Capabilities() ChannelCapabilities }
ChannelCapabilities defines the capabilities for a channel
type ChannelCapabilities interface { // Supported returns an error if there are unknown capabilities in this channel which are required Supported() error // MSPVersion specifies the version of the MSP this channel must understand, including the MSP types // and MSP principal types. MSPVersion() msp.MSPVersion // ConsensusTypeMigration return true if consensus-type migration is permitted in both orderer and peer. ConsensusTypeMigration() bool // OrgSpecificOrdererEndpoints return true if the channel config processing allows orderer orgs to specify their own endpoints OrgSpecificOrdererEndpoints() bool }
ChannelConfig stores the channel configuration
type ChannelConfig struct {
// contains filtered or unexported fields
}
func NewChannelConfig(channelGroup *cb.ConfigGroup) (*ChannelConfig, error)
NewChannelConfig creates a new ChannelConfig
func (cc *ChannelConfig) ApplicationConfig() *ApplicationConfig
ApplicationConfig returns the application config associated with this channel
func (cc *ChannelConfig) BlockDataHashingStructureWidth() uint32
BlockDataHashingStructure returns the width to use when forming the block data hashing structure
func (cc *ChannelConfig) Capabilities() ChannelCapabilities
Capabilities returns information about the available capabilities for this channel
func (cc *ChannelConfig) ConsortiumName() string
ConsortiumName returns the name of the consortium this channel was created under
func (cc *ChannelConfig) ConsortiumsConfig() *ConsortiumsConfig
ConsortiumsConfig returns the consortium config associated with this channel if it exists
func (cc *ChannelConfig) HashingAlgorithm() func(input []byte) []byte
HashingAlgorithm returns a function pointer to the chain hashing algorihtm
func (cc *ChannelConfig) MSPManager() msp.MSPManager
MSPManager returns the MSP manager for this config
func (cc *ChannelConfig) OrdererAddresses() []string
OrdererAddresses returns the list of valid orderer addresses to connect to to invoke Broadcast/Deliver
func (cc *ChannelConfig) OrdererConfig() *OrdererConfig
OrdererConfig returns the orderer config associated with this channel
func (cc *ChannelConfig) Validate(channelCapabilities ChannelCapabilities) error
Validate inspects the generated configuration protos and ensures that the values are correct
ChannelProtos is where the proposed configuration is unmarshaled into
type ChannelProtos struct { HashingAlgorithm *cb.HashingAlgorithm BlockDataHashingStructure *cb.BlockDataHashingStructure OrdererAddresses *cb.OrdererAddresses Consortium *cb.Consortium Capabilities *cb.Capabilities }
ChannelValues gives read only access to the channel configuration
type ChannelValues interface { // HashingAlgorithm returns the default algorithm to be used when hashing // such as computing block hashes, and CreationPolicy digests HashingAlgorithm() func(input []byte) []byte // BlockDataHashingStructureWidth returns the width to use when constructing the // Merkle tree to compute the BlockData hash BlockDataHashingStructureWidth() uint32 // OrdererAddresses returns the list of valid orderer addresses to connect to to invoke Broadcast/Deliver OrdererAddresses() []string }
ConfigValue defines a common representation for different *cb.ConfigValue values.
type ConfigValue interface { // Key is the key this value should be stored in the *cb.ConfigGroup.Values map. Key() string // Value is the message which should be marshaled to opaque bytes for the *cb.ConfigValue.value. Value() proto.Message }
Consortium represents a group of orgs which may create channels together
type Consortium interface { // ChannelCreationPolicy returns the policy to check when instantiating a channel for this consortium ChannelCreationPolicy() *cb.Policy // Organizations returns the organizations for this consortium Organizations() map[string]Org }
ConsortiumConfig holds the consoritums configuration information
type ConsortiumConfig struct {
// contains filtered or unexported fields
}
func NewConsortiumConfig(consortiumGroup *cb.ConfigGroup, mspConfig *MSPConfigHandler) (*ConsortiumConfig, error)
NewConsortiumConfig creates a new instance of the consoritums config
func (cc *ConsortiumConfig) ChannelCreationPolicy() *cb.Policy
CreationPolicy returns the policy structure used to validate the channel creation
func (cc *ConsortiumConfig) Organizations() map[string]Org
Organizations returns the set of organizations in the consortium
ConsortiumProtos holds the config protos for the consortium config
type ConsortiumProtos struct { ChannelCreationPolicy *cb.Policy }
Consortiums represents the set of consortiums serviced by an ordering service
type Consortiums interface { // Consortiums returns the set of consortiums Consortiums() map[string]Consortium }
ConsortiumsConfig holds the consoritums configuration information
type ConsortiumsConfig struct {
// contains filtered or unexported fields
}
func NewConsortiumsConfig(consortiumsGroup *cb.ConfigGroup, mspConfig *MSPConfigHandler) (*ConsortiumsConfig, error)
NewConsortiumsConfig creates a new instance of the consoritums config
func (cc *ConsortiumsConfig) Consortiums() map[string]Consortium
Consortiums returns a map of the current consortiums
MSPConfigHandler
type MSPConfigHandler struct {
// contains filtered or unexported fields
}
func NewMSPConfigHandler(mspVersion msp.MSPVersion) *MSPConfigHandler
func (bh *MSPConfigHandler) CreateMSPManager() (msp.MSPManager, error)
func (bh *MSPConfigHandler) ProposeMSP(mspConfig *mspprotos.MSPConfig) (msp.MSP, error)
ProposeValue called when an org defines an MSP
Orderer stores the common shared orderer config
type Orderer interface { // ConsensusType returns the configured consensus type ConsensusType() string // ConsensusMetadata returns the metadata associated with the consensus type. ConsensusMetadata() []byte // ConsensusState returns the consensus-type state. ConsensusState() ab.ConsensusType_State // BatchSize returns the maximum number of messages to include in a block BatchSize() *ab.BatchSize // BatchTimeout returns the amount of time to wait before creating a batch BatchTimeout() time.Duration // MaxChannelsCount returns the maximum count of channels to allow for an ordering network MaxChannelsCount() uint64 // KafkaBrokers returns the addresses (IP:port notation) of a set of "bootstrap" // Kafka brokers, i.e. this is not necessarily the entire set of Kafka brokers // used for ordering KafkaBrokers() []string // Organizations returns the organizations for the ordering service Organizations() map[string]OrdererOrg // Capabilities defines the capabilities for the orderer portion of a channel Capabilities() OrdererCapabilities }
OrdererCapabilities defines the capabilities for the orderer portion of a channel
type OrdererCapabilities interface { // PredictableChannelTemplate specifies whether the v1.0 undesirable behavior of setting the /Channel // group's mod_policy to "" and copy versions from the orderer system channel config should be fixed or not. PredictableChannelTemplate() bool // Resubmission specifies whether the v1.0 non-deterministic commitment of tx should be fixed by re-submitting // the re-validated tx. Resubmission() bool // Supported returns an error if there are unknown capabilities in this channel which are required Supported() error // ExpirationCheck specifies whether the orderer checks for identity expiration checks // when validating messages ExpirationCheck() bool // ConsensusTypeMigration checks whether the orderer permits a consensus-type migration. ConsensusTypeMigration() bool }
OrdererConfig holds the orderer configuration information.
type OrdererConfig struct {
// contains filtered or unexported fields
}
func NewOrdererConfig(ordererGroup *cb.ConfigGroup, mspConfig *MSPConfigHandler, channelCapabilities ChannelCapabilities) (*OrdererConfig, error)
NewOrdererConfig creates a new instance of the orderer config.
func (oc *OrdererConfig) BatchSize() *ab.BatchSize
BatchSize returns the maximum number of messages to include in a block.
func (oc *OrdererConfig) BatchTimeout() time.Duration
BatchTimeout returns the amount of time to wait before creating a batch.
func (oc *OrdererConfig) Capabilities() OrdererCapabilities
Capabilities returns the capabilities the ordering network has for this channel.
func (oc *OrdererConfig) ConsensusMetadata() []byte
ConsensusMetadata returns the metadata associated with the consensus type.
func (oc *OrdererConfig) ConsensusState() ab.ConsensusType_State
ConsensusState return the consensus type state.
func (oc *OrdererConfig) ConsensusType() string
ConsensusType returns the configured consensus type.
func (oc *OrdererConfig) KafkaBrokers() []string
KafkaBrokers returns the addresses (IP:port notation) of a set of "bootstrap" Kafka brokers, i.e. this is not necessarily the entire set of Kafka brokers used for ordering.
func (oc *OrdererConfig) MaxChannelsCount() uint64
MaxChannelsCount returns the maximum count of channels this orderer supports.
func (oc *OrdererConfig) Organizations() map[string]OrdererOrg
Organizations returns a map of the orgs in the channel.
func (oc *OrdererConfig) Validate() error
OrdererOrg stores the per org orderer config.
type OrdererOrg interface { Org // Endpoints returns the endpoints of orderer nodes. Endpoints() []string }
OrdererOrgConfig defines the configuration for an orderer org
type OrdererOrgConfig struct { *OrganizationConfig // contains filtered or unexported fields }
func NewOrdererOrgConfig(orgName string, orgGroup *cb.ConfigGroup, mspConfigHandler *MSPConfigHandler, channelCapabilities ChannelCapabilities) (*OrdererOrgConfig, error)
NewOrdererOrgConfig returns an orderer org config built from the given ConfigGroup.
func (oc *OrdererOrgConfig) Endpoints() []string
Endpoints returns the set of addresses this ordering org exposes as orderers
func (ooc *OrdererOrgConfig) Validate() error
OrdererOrgProtos are deserialized from the Orderer org config values
type OrdererOrgProtos struct { Endpoints *cb.OrdererAddresses }
OrdererProtos is used as the source of the OrdererConfig.
type OrdererProtos struct { ConsensusType *ab.ConsensusType BatchSize *ab.BatchSize BatchTimeout *ab.BatchTimeout KafkaBrokers *ab.KafkaBrokers ChannelRestrictions *ab.ChannelRestrictions Capabilities *cb.Capabilities }
Org stores the common organizational config
type Org interface { // Name returns the name this org is referred to in config Name() string // MSPID returns the MSP ID associated with this org MSPID() string }
OrganizationConfig stores the configuration for an organization
type OrganizationConfig struct {
// contains filtered or unexported fields
}
func NewOrganizationConfig(name string, orgGroup *cb.ConfigGroup, mspConfigHandler *MSPConfigHandler) (*OrganizationConfig, error)
NewOrganizationConfig creates a new config for an organization
func (oc *OrganizationConfig) MSPID() string
MSPID returns the MSP ID associated with this org
func (oc *OrganizationConfig) Name() string
Name returns the name this org is referred to in config
func (oc *OrganizationConfig) Validate() error
Validate returns whether the configuration is valid
OrganizationProtos are used to deserialize the organization config
type OrganizationProtos struct { MSP *mspprotos.MSPConfig }
PolicyMapper is an interface for
type PolicyMapper interface { // PolicyRefForAPI takes the name of an API, and returns the policy name // or the empty string if the API is not found PolicyRefForAPI(apiName string) string }
Resources is the common set of config resources for all channels Depending on whether chain is used at the orderer or at the peer, other config resources may be available
type Resources interface { // ConfigtxValidator returns the configtx.Validator for the channel ConfigtxValidator() configtx.Validator // PolicyManager returns the policies.Manager for the channel PolicyManager() policies.Manager // ChannelConfig returns the config.Channel for the chain ChannelConfig() Channel // OrdererConfig returns the config.Orderer for the channel // and whether the Orderer config exists OrdererConfig() (Orderer, bool) // ConsortiumsConfig() returns the config.Consortiums for the channel // and whether the consortiums config exists ConsortiumsConfig() (Consortiums, bool) // ApplicationConfig returns the configtxapplication.SharedConfig for the channel // and whether the Application config exists ApplicationConfig() (Application, bool) // MSPManager returns the msp.MSPManager for the chain MSPManager() msp.MSPManager // ValidateNew should return an error if a new set of configuration resources is incompatible with the current one ValidateNew(resources Resources) error }
StandardConfigValue implements the ConfigValue interface.
type StandardConfigValue struct {
// contains filtered or unexported fields
}
func ACLValues(acls map[string]string) *StandardConfigValue
ACLsValues returns the config definition for an applications resources based ACL definitions. It is a value for the /Channel/Application/.
func AnchorPeersValue(anchorPeers []*pb.AnchorPeer) *StandardConfigValue
AnchorPeersValue returns the config definition for an org's anchor peers. It is a value for the /Channel/Application/*.
func BatchSizeValue(maxMessages, absoluteMaxBytes, preferredMaxBytes uint32) *StandardConfigValue
BatchSizeValue returns the config definition for the orderer batch size. It is a value for the /Channel/Orderer group.
func BatchTimeoutValue(timeout string) *StandardConfigValue
BatchTimeoutValue returns the config definition for the orderer batch timeout. It is a value for the /Channel/Orderer group.
func BlockDataHashingStructureValue() *StandardConfigValue
BlockDataHashingStructureValue returns the only currently valid block data hashing structure. It is a value for the /Channel group.
func CapabilitiesValue(capabilities map[string]bool) *StandardConfigValue
CapabilitiesValue returns the config definition for a a set of capabilities. It is a value for the /Channel/Orderer, Channel/Application/, and /Channel groups.
func ChannelCreationPolicyValue(policy *cb.Policy) *StandardConfigValue
ChannelCreationPolicyValue returns the config definition for a consortium's channel creation policy It is a value for the /Channel/Consortiums/*/*.
func ChannelRestrictionsValue(maxChannelCount uint64) *StandardConfigValue
ChannelRestrictionsValue returns the config definition for the orderer channel restrictions. It is a value for the /Channel/Orderer group.
func ConsensusTypeValue(consensusType string, consensusMetadata []byte) *StandardConfigValue
ConsensusTypeValue returns the config definition for the orderer consensus type. It is a value for the /Channel/Orderer group.
func ConsortiumValue(name string) *StandardConfigValue
ConsortiumValue returns the config definition for the consortium name. It is a value for the channel group.
func EndpointsValue(addresses []string) *StandardConfigValue
EndpointsValue returns the config definition for the orderer addresses at an org scoped level. It is a value for the /Channel/Orderer/<OrgName> group.
func HashingAlgorithmValue() *StandardConfigValue
HashingAlgorithm returns the only currently valid hashing algorithm. It is a value for the /Channel group.
func KafkaBrokersValue(brokers []string) *StandardConfigValue
KafkaBrokersValue returns the config definition for the addresses of the ordering service's Kafka brokers. It is a value for the /Channel/Orderer group.
func MSPValue(mspDef *mspprotos.MSPConfig) *StandardConfigValue
MSPValue returns the config definition for an MSP. It is a value for the /Channel/Orderer/*, /Channel/Application/*, and /Channel/Consortiums/*/*/* groups.
func OrdererAddressesValue(addresses []string) *StandardConfigValue
OrdererAddressesValue returns the a config definition for the orderer addresses. It is a value for the /Channel group.
func (scv *StandardConfigValue) Key() string
Key is the key this value should be stored in the *cb.ConfigGroup.Values map.
func (scv *StandardConfigValue) Value() proto.Message
Value is the message which should be marshaled to opaque bytes for the *cb.ConfigValue.value.
type StandardValues struct {
// contains filtered or unexported fields
}
func NewStandardValues(protosStructs ...interface{}) (*StandardValues, error)
NewStandardValues accepts a structure which must contain only protobuf message types. The structure may embed other (non-pointer) structures which satisfy the same condition. NewStandard values will instantiate memory for all the proto messages and build a lookup map from structure field name to proto message instance This is a useful way to easily implement the Values interface
func (sv *StandardValues) Deserialize(key string, value []byte) (proto.Message, error)
Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes to populate the backing message structure, and returns a referenced to the retained deserialized message (or an error, either because the key did not exist, or there was an an error unmarshaling