Documentation
¶
Overview ¶
Note, the directory is still configvalues, but this is stuttery and config is a more accurate and better name, TODO, update directory
Index ¶
- Constants
- func DefaultBlockDataHashingStructure() *cb.ConfigGroup
- func DefaultHashingAlgorithm() *cb.ConfigGroup
- func DefaultOrdererAddresses() *cb.ConfigGroup
- func NewStandardValues(protosStructs ...interface{}) (*standardValues, error)
- func TemplateAnchorPeers(orgID string, anchorPeers []*pb.AnchorPeer) *cb.ConfigGroup
- func TemplateBatchSize(batchSize *ab.BatchSize) *cb.ConfigGroup
- func TemplateBatchTimeout(batchTimeout string) *cb.ConfigGroup
- func TemplateBlockDataHashingStructure(width uint32) *cb.ConfigGroup
- func TemplateChannelRestrictions(maxChannels uint64) *cb.ConfigGroup
- func TemplateConsensusType(typeValue string) *cb.ConfigGroup
- func TemplateConsortium(name string) *cb.ConfigGroup
- func TemplateConsortiumChannelCreationPolicy(name string, policy *cb.Policy) *cb.ConfigGroup
- func TemplateConsortiumsGroup() *cb.ConfigGroup
- func TemplateHashingAlgorithm(name string) *cb.ConfigGroup
- func TemplateKafkaBrokers(brokers []string) *cb.ConfigGroup
- func TemplateOrdererAddresses(addresses []string) *cb.ConfigGroup
- type Application
- type ApplicationConfig
- type ApplicationGroup
- type ApplicationOrg
- type ApplicationOrgConfig
- type ApplicationOrgGroup
- type ApplicationOrgProtos
- type Channel
- type ChannelConfig
- func (cc *ChannelConfig) BlockDataHashingStructureWidth() uint32
- func (cc *ChannelConfig) ConsortiumName() string
- func (sv ChannelConfig) Deserialize(key string, value []byte) (proto.Message, error)
- func (cc *ChannelConfig) HashingAlgorithm() func(input []byte) []byte
- func (cc *ChannelConfig) OrdererAddresses() []string
- func (cc *ChannelConfig) Validate(tx interface{}, groups map[string]ValueProposer) error
- type ChannelGroup
- func (cg *ChannelGroup) Allocate() Values
- func (cg *ChannelGroup) ApplicationConfig() *ApplicationGroup
- func (cg *ChannelGroup) ConsortiumsConfig() *ConsortiumsGroup
- func (sv ChannelGroup) Deserialize(key string, value []byte) (proto.Message, error)
- func (cg *ChannelGroup) NewGroup(group string) (ValueProposer, error)
- func (cg *ChannelGroup) OrdererConfig() *OrdererGroup
- type ChannelProtos
- type ChannelValues
- type Consortium
- type ConsortiumConfig
- func (cc *ConsortiumConfig) ChannelCreationPolicy() *cb.Policy
- func (cc *ConsortiumConfig) Commit()
- func (sv ConsortiumConfig) Deserialize(key string, value []byte) (proto.Message, error)
- func (cc *ConsortiumConfig) Organizations() map[string]*OrganizationGroup
- func (cc *ConsortiumConfig) Validate(tx interface{}, groups map[string]ValueProposer) error
- type ConsortiumGroup
- func (cg *ConsortiumGroup) Allocate() Values
- func (cg *ConsortiumGroup) BeginValueProposals(tx interface{}, groups []string) (ValueDeserializer, []ValueProposer, error)
- func (cg *ConsortiumGroup) CommitProposals(tx interface{})
- func (sv ConsortiumGroup) Deserialize(key string, value []byte) (proto.Message, error)
- func (cg *ConsortiumGroup) NewGroup(name string) (ValueProposer, error)
- func (cg *ConsortiumGroup) PreCommit(tx interface{}) error
- func (cg *ConsortiumGroup) RollbackProposals(tx interface{})
- type ConsortiumProtos
- type Consortiums
- type ConsortiumsConfig
- type ConsortiumsGroup
- type Handler
- type Orderer
- type OrdererConfig
- func (oc *OrdererConfig) BatchSize() *ab.BatchSize
- func (oc *OrdererConfig) BatchTimeout() time.Duration
- func (oc *OrdererConfig) Commit()
- func (oc *OrdererConfig) ConsensusType() string
- func (sv OrdererConfig) Deserialize(key string, value []byte) (proto.Message, error)
- func (oc *OrdererConfig) KafkaBrokers() []string
- func (oc *OrdererConfig) MaxChannelsCount() uint64
- func (oc *OrdererConfig) Organizations() map[string]Org
- func (oc *OrdererConfig) Validate(tx interface{}, groups map[string]ValueProposer) error
- type OrdererGroup
- type OrdererProtos
- type Org
- type OrganizationConfig
- type OrganizationGroup
- type OrganizationProtos
- type Proposer
- type Root
- func (r *Root) Application() *ApplicationGroup
- func (r *Root) BeginValueProposals(tx interface{}, groups []string) (ValueDeserializer, []ValueProposer, error)
- func (r *Root) Channel() *ChannelGroup
- func (r *Root) CommitProposals(tx interface{})
- func (r *Root) Consortiums() *ConsortiumsGroup
- func (r *Root) Orderer() *OrdererGroup
- func (r *Root) PreCommit(tx interface{}) error
- func (r *Root) RollbackProposals(tx interface{})
- type ValueDeserializer
- type ValueProposer
- type Values
Constants ¶
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" )
Channel config keys
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" // ChannelRestrictions is the key name for the ChannelRestrictions message ChannelRestrictionsKey = "ChannelRestrictions" // KafkaBrokersKey is the cb.ConfigItem type key name for the KafkaBrokers message KafkaBrokersKey = "KafkaBrokers" )
const (
// AnchorPeersKey is the key name for the AnchorPeers ConfigValue
AnchorPeersKey = "AnchorPeers"
)
Application org config keys
const (
// ApplicationGroupKey is the group name for the Application config
ApplicationGroupKey = "Application"
)
const (
// ChannelCreationPolicyKey is the key for the ChannelCreationPolicy value
ChannelCreationPolicyKey = "ChannelCreationPolicy"
)
const (
// ConsortiumsGroupKey is the group name for the consortiums config
ConsortiumsGroupKey = "Consortiums"
)
const (
// MSPKey is value key for marshaled *mspconfig.MSPConfig
MSPKey = "MSP"
)
Org config keys
const (
// OrdererGroupKey is the group name for the orderer config
OrdererGroupKey = "Orderer"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultBlockDataHashingStructure ¶ added in v1.0.0
func DefaultBlockDataHashingStructure() *cb.ConfigGroup
DefaultBlockDatahashingStructure creates a headerless config item for the default block data hashing structure
func DefaultHashingAlgorithm ¶ added in v1.0.0
func DefaultHashingAlgorithm() *cb.ConfigGroup
DefaultHashingAlgorithm creates a headerless config item for the default hashing algorithm
func DefaultOrdererAddresses ¶ added in v1.0.0
func DefaultOrdererAddresses() *cb.ConfigGroup
DefaultOrdererAddresses creates a headerless config item for the default orderer addresses
func NewStandardValues ¶ added in v1.0.0
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 TemplateAnchorPeers ¶ added in v1.0.0
func TemplateAnchorPeers(orgID string, anchorPeers []*pb.AnchorPeer) *cb.ConfigGroup
TemplateAnchorPeers creates a headerless config item representing the anchor peers
func TemplateBatchSize ¶ added in v1.0.0
func TemplateBatchSize(batchSize *ab.BatchSize) *cb.ConfigGroup
TemplateBatchSize creates a headerless config item representing the batch size
func TemplateBatchTimeout ¶ added in v1.0.0
func TemplateBatchTimeout(batchTimeout string) *cb.ConfigGroup
TemplateBatchTimeout creates a headerless config item representing the batch timeout
func TemplateBlockDataHashingStructure ¶ added in v1.0.0
func TemplateBlockDataHashingStructure(width uint32) *cb.ConfigGroup
TemplateBlockDataHashingStructure creates a headerless config item representing the block data hashing structure
func TemplateChannelRestrictions ¶ added in v1.0.0
func TemplateChannelRestrictions(maxChannels uint64) *cb.ConfigGroup
TemplateChannelRestrictions creates a config group with ChannelRestrictions specified
func TemplateConsensusType ¶ added in v1.0.0
func TemplateConsensusType(typeValue string) *cb.ConfigGroup
TemplateConsensusType creates a headerless config item representing the consensus type
func TemplateConsortium ¶ added in v1.0.0
func TemplateConsortium(name string) *cb.ConfigGroup
TemplateConsortiumName creates a ConfigGroup representing the ConsortiumName
func TemplateConsortiumChannelCreationPolicy ¶ added in v1.0.0
func TemplateConsortiumChannelCreationPolicy(name string, policy *cb.Policy) *cb.ConfigGroup
TemplateConsortiumChannelCreationPolicy sets the ChannelCreationPolicy for a given consortium
func TemplateConsortiumsGroup ¶ added in v1.0.0
func TemplateConsortiumsGroup() *cb.ConfigGroup
TemplateConsortiumsGroup creates an empty consortiums group
func TemplateHashingAlgorithm ¶ added in v1.0.0
func TemplateHashingAlgorithm(name string) *cb.ConfigGroup
TemplateHashingAlgorithm creates a ConfigGroup representing the HashingAlgorithm
func TemplateKafkaBrokers ¶ added in v1.0.0
func TemplateKafkaBrokers(brokers []string) *cb.ConfigGroup
TemplateKafkaBrokers creates a headerless config item representing the kafka brokers
func TemplateOrdererAddresses ¶ added in v1.0.0
func TemplateOrdererAddresses(addresses []string) *cb.ConfigGroup
TemplateOrdererAddressess creates a headerless config item representing the orderer addresses
Types ¶
type Application ¶ added in v1.0.0
type Application interface { // Organizations returns a map of org ID to ApplicationOrg Organizations() map[string]ApplicationOrg }
Application stores the common shared application config
type ApplicationConfig ¶ added in v1.0.0
type ApplicationConfig struct {
// contains filtered or unexported fields
}
func NewApplicationConfig ¶ added in v1.0.0
func NewApplicationConfig(ag *ApplicationGroup) *ApplicationConfig
func (*ApplicationConfig) Commit ¶ added in v1.0.0
func (ac *ApplicationConfig) Commit()
func (ApplicationConfig) Deserialize ¶ added in v1.0.0
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
func (*ApplicationConfig) Organizations ¶ added in v1.0.0
func (ac *ApplicationConfig) Organizations() map[string]ApplicationOrg
Organizations returns a map of org ID to ApplicationOrg
func (*ApplicationConfig) Validate ¶ added in v1.0.0
func (ac *ApplicationConfig) Validate(tx interface{}, groups map[string]ValueProposer) error
type ApplicationGroup ¶ added in v1.0.0
type ApplicationGroup struct { *Proposer *ApplicationConfig // contains filtered or unexported fields }
ApplicationGroup represents the application config group
func NewApplicationGroup ¶ added in v1.0.0
func NewApplicationGroup(mspConfig *msp.MSPConfigHandler) *ApplicationGroup
NewSharedConfigImpl creates a new SharedConfigImpl with the given CryptoHelper
func (*ApplicationGroup) Allocate ¶ added in v1.0.0
func (ag *ApplicationGroup) Allocate() Values
Allocate returns a new instance of the ApplicationConfig
func (ApplicationGroup) Deserialize ¶ added in v1.0.0
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
func (*ApplicationGroup) NewGroup ¶ added in v1.0.0
func (ag *ApplicationGroup) NewGroup(name string) (ValueProposer, error)
type ApplicationOrg ¶ added in v1.0.0
type ApplicationOrg interface { Org // AnchorPeers returns the list of gossip anchor peers AnchorPeers() []*pb.AnchorPeer }
ApplicationOrg stores the per org application config
type ApplicationOrgConfig ¶ added in v1.0.0
type ApplicationOrgConfig struct { *OrganizationConfig // contains filtered or unexported fields }
func NewApplicationOrgConfig ¶ added in v1.0.0
func NewApplicationOrgConfig(aog *ApplicationOrgGroup) *ApplicationOrgConfig
func (*ApplicationOrgConfig) AnchorPeers ¶ added in v1.0.0
func (aog *ApplicationOrgConfig) AnchorPeers() []*pb.AnchorPeer
AnchorPeers returns the list of valid orderer addresses to connect to to invoke Broadcast/Deliver
func (*ApplicationOrgConfig) Commit ¶ added in v1.0.0
func (aoc *ApplicationOrgConfig) Commit()
func (ApplicationOrgConfig) Deserialize ¶ added in v1.0.0
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
func (*ApplicationOrgConfig) Validate ¶ added in v1.0.0
func (aoc *ApplicationOrgConfig) Validate(tx interface{}, groups map[string]ValueProposer) error
type ApplicationOrgGroup ¶ added in v1.0.0
type ApplicationOrgGroup struct { *Proposer *OrganizationGroup *ApplicationOrgConfig }
ApplicationOrgGroup defines the configuration for an application org
func NewApplicationOrgGroup ¶ added in v1.0.0
func NewApplicationOrgGroup(id string, mspConfig *mspconfig.MSPConfigHandler) *ApplicationOrgGroup
NewApplicationOrgGroup creates a new ApplicationOrgGroup
func (*ApplicationOrgGroup) Allocate ¶ added in v1.0.0
func (aog *ApplicationOrgGroup) Allocate() Values
type ApplicationOrgProtos ¶ added in v1.0.0
type ApplicationOrgProtos struct {
AnchorPeers *pb.AnchorPeers
}
type Channel ¶ added in v1.0.0
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 }
Channel gives read only access to the channel configuration
type ChannelConfig ¶ added in v1.0.0
type ChannelConfig struct {
// contains filtered or unexported fields
}
ChannelConfig stores the channel configuration
func NewChannelConfig ¶ added in v1.0.0
func NewChannelConfig() *ChannelConfig
NewChannelConfig creates a new ChannelConfig
func (*ChannelConfig) BlockDataHashingStructureWidth ¶ added in v1.0.0
func (cc *ChannelConfig) BlockDataHashingStructureWidth() uint32
BlockDataHashingStructure returns the width to use when forming the block data hashing structure
func (*ChannelConfig) ConsortiumName ¶ added in v1.0.0
func (cc *ChannelConfig) ConsortiumName() string
ConsortiumName returns the name of the consortium this channel was created under
func (ChannelConfig) Deserialize ¶ added in v1.0.0
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
func (*ChannelConfig) HashingAlgorithm ¶ added in v1.0.0
func (cc *ChannelConfig) HashingAlgorithm() func(input []byte) []byte
HashingAlgorithm returns a function pointer to the chain hashing algorihtm
func (*ChannelConfig) OrdererAddresses ¶ added in v1.0.0
func (cc *ChannelConfig) OrdererAddresses() []string
OrdererAddresses returns the list of valid orderer addresses to connect to to invoke Broadcast/Deliver
func (*ChannelConfig) Validate ¶ added in v1.0.0
func (cc *ChannelConfig) Validate(tx interface{}, groups map[string]ValueProposer) error
Validate inspects the generated configuration protos, ensures that the values are correct, and sets the ChannelConfig fields that may be referenced after Commit
type ChannelGroup ¶ added in v1.0.0
type ChannelGroup struct { *ChannelConfig *Proposer // contains filtered or unexported fields }
ChannelGroup
func NewChannelGroup ¶ added in v1.0.0
func NewChannelGroup(mspConfigHandler *msp.MSPConfigHandler) *ChannelGroup
func (*ChannelGroup) Allocate ¶ added in v1.0.0
func (cg *ChannelGroup) Allocate() Values
Allocate creates new config resources for a pending config update
func (*ChannelGroup) ApplicationConfig ¶ added in v1.0.0
func (cg *ChannelGroup) ApplicationConfig() *ApplicationGroup
ApplicationConfig returns the application config associated with this channel
func (*ChannelGroup) ConsortiumsConfig ¶ added in v1.0.0
func (cg *ChannelGroup) ConsortiumsConfig() *ConsortiumsGroup
ConsortiumsConfig returns the consortium config associated with this channel if it exists
func (ChannelGroup) Deserialize ¶ added in v1.0.0
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
func (*ChannelGroup) NewGroup ¶ added in v1.0.0
func (cg *ChannelGroup) NewGroup(group string) (ValueProposer, error)
NewGroup instantiates either a new application or orderer config
func (*ChannelGroup) OrdererConfig ¶ added in v1.0.0
func (cg *ChannelGroup) OrdererConfig() *OrdererGroup
OrdererConfig returns the orderer config associated with this channel
type ChannelProtos ¶ added in v1.0.0
type ChannelProtos struct { HashingAlgorithm *cb.HashingAlgorithm BlockDataHashingStructure *cb.BlockDataHashingStructure OrdererAddresses *cb.OrdererAddresses Consortium *cb.Consortium }
ChannelProtos is where the proposed configuration is unmarshaled into
type ChannelValues ¶ added in v1.0.0
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 }
ChannelValues gives read only access to the channel configuration
type Consortium ¶ added in v1.0.0
type Consortium interface { // ChannelCreationPolicy returns the policy to check when instantiating a channel for this consortium ChannelCreationPolicy() *cb.Policy }
Consortium represents a group of orgs which may create channels together
type ConsortiumConfig ¶ added in v1.0.0
type ConsortiumConfig struct {
// contains filtered or unexported fields
}
ConsortiumConfig holds the consoritums configuration information
func NewConsortiumConfig ¶ added in v1.0.0
func NewConsortiumConfig(cg *ConsortiumGroup) *ConsortiumConfig
NewConsortiumConfig creates a new instance of the consoritums config
func (*ConsortiumConfig) ChannelCreationPolicy ¶ added in v1.0.0
func (cc *ConsortiumConfig) ChannelCreationPolicy() *cb.Policy
CreationPolicy returns the policy structure used to validate the channel creation
func (*ConsortiumConfig) Commit ¶ added in v1.0.0
func (cc *ConsortiumConfig) Commit()
Commit commits the ConsortiumConfig
func (ConsortiumConfig) Deserialize ¶ added in v1.0.0
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
func (*ConsortiumConfig) Organizations ¶ added in v1.0.0
func (cc *ConsortiumConfig) Organizations() map[string]*OrganizationGroup
Organizations returns the set of organizations in the consortium
func (*ConsortiumConfig) Validate ¶ added in v1.0.0
func (cc *ConsortiumConfig) Validate(tx interface{}, groups map[string]ValueProposer) error
Validate builds the Consortium map
type ConsortiumGroup ¶ added in v1.0.0
type ConsortiumGroup struct { *Proposer *ConsortiumConfig // contains filtered or unexported fields }
ConsortiumGroup stores the set of Consortium
func NewConsortiumGroup ¶ added in v1.0.0
func NewConsortiumGroup(mspConfig *msp.MSPConfigHandler) *ConsortiumGroup
NewConsortiumGroup creates a new *ConsortiumGroup
func (*ConsortiumGroup) Allocate ¶ added in v1.0.0
func (cg *ConsortiumGroup) Allocate() Values
Allocate returns the resources for a new config proposal
func (*ConsortiumGroup) BeginValueProposals ¶ added in v1.0.0
func (cg *ConsortiumGroup) BeginValueProposals(tx interface{}, groups []string) (ValueDeserializer, []ValueProposer, error)
BeginValueProposals calls through to Proposer after calling into the MSP config Handler
func (*ConsortiumGroup) CommitProposals ¶ added in v1.0.0
func (cg *ConsortiumGroup) CommitProposals(tx interface{})
CommitProposals intercepts the commit request and commits the MSP config handler before calling the underlying proposer
func (ConsortiumGroup) Deserialize ¶ added in v1.0.0
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
func (*ConsortiumGroup) NewGroup ¶ added in v1.0.0
func (cg *ConsortiumGroup) NewGroup(name string) (ValueProposer, error)
NewGroup returns a Consortium instance
func (*ConsortiumGroup) PreCommit ¶ added in v1.0.0
func (cg *ConsortiumGroup) PreCommit(tx interface{}) error
PreCommit intercepts the precommit request and commits the MSP config handler before calling the underlying proposer
func (*ConsortiumGroup) RollbackProposals ¶ added in v1.0.0
func (cg *ConsortiumGroup) RollbackProposals(tx interface{})
RollbackProposals intercepts the rollback request and commits the MSP config handler before calling the underlying proposer
type ConsortiumProtos ¶ added in v1.0.0
ConsortiumProtos holds the config protos for the consortium config
type Consortiums ¶ added in v1.0.0
type Consortiums interface { // Consortiums returns the set of consortiums Consortiums() map[string]Consortium }
Consortiums represents the set of consortiums serviced by an ordering service
type ConsortiumsConfig ¶ added in v1.0.0
type ConsortiumsConfig struct {
// contains filtered or unexported fields
}
ConsortiumsConfig holds the consoritums configuration information
func NewConsortiumsConfig ¶ added in v1.0.0
func NewConsortiumsConfig(cg *ConsortiumsGroup) *ConsortiumsConfig
NewConsortiumsConfig creates a new instance of the consoritums config
func (*ConsortiumsConfig) Commit ¶ added in v1.0.0
func (cc *ConsortiumsConfig) Commit()
Commit commits the ConsortiumsConfig
func (*ConsortiumsConfig) Consortiums ¶ added in v1.0.0
func (cc *ConsortiumsConfig) Consortiums() map[string]Consortium
Consortiums returns a map of the current consortiums
func (ConsortiumsConfig) Deserialize ¶ added in v1.0.0
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
func (*ConsortiumsConfig) Validate ¶ added in v1.0.0
func (cc *ConsortiumsConfig) Validate(tx interface{}, groups map[string]ValueProposer) error
Validate builds the Consortiums map
type ConsortiumsGroup ¶ added in v1.0.0
type ConsortiumsGroup struct { *Proposer *ConsortiumsConfig // contains filtered or unexported fields }
ConsortiumsGroup stores the set of Consortiums
func NewConsortiumsGroup ¶ added in v1.0.0
func NewConsortiumsGroup(mspConfig *msp.MSPConfigHandler) *ConsortiumsGroup
NewConsortiumsGroup creates a new *ConsortiumsGroup
func (*ConsortiumsGroup) Allocate ¶ added in v1.0.0
func (cg *ConsortiumsGroup) Allocate() Values
Allocate returns the resources for a new config proposal
func (ConsortiumsGroup) Deserialize ¶ added in v1.0.0
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
func (*ConsortiumsGroup) NewGroup ¶ added in v1.0.0
func (cg *ConsortiumsGroup) NewGroup(name string) (ValueProposer, error)
NewGroup returns a Consortium instance
type Handler ¶ added in v1.0.0
type Handler interface { Allocate() Values NewGroup(name string) (ValueProposer, error) }
Handler
type Orderer ¶ added in v1.0.0
type Orderer interface { // ConsensusType returns the configured consensus type ConsensusType() string // 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]Org }
Orderer stores the common shared orderer config
type OrdererConfig ¶ added in v1.0.0
type OrdererConfig struct {
// contains filtered or unexported fields
}
OrdererConfig holds the orderer configuration information
func NewOrdererConfig ¶ added in v1.0.0
func NewOrdererConfig(og *OrdererGroup) *OrdererConfig
NewOrdererConfig creates a new instance of the orderer config
func (*OrdererConfig) BatchSize ¶ added in v1.0.0
func (oc *OrdererConfig) BatchSize() *ab.BatchSize
BatchSize returns the maximum number of messages to include in a block
func (*OrdererConfig) BatchTimeout ¶ added in v1.0.0
func (oc *OrdererConfig) BatchTimeout() time.Duration
BatchTimeout returns the amount of time to wait before creating a batch
func (*OrdererConfig) Commit ¶ added in v1.0.0
func (oc *OrdererConfig) Commit()
Commit writes the orderer config back to the orderer config group
func (*OrdererConfig) ConsensusType ¶ added in v1.0.0
func (oc *OrdererConfig) ConsensusType() string
ConsensusType returns the configured consensus type
func (OrdererConfig) Deserialize ¶ added in v1.0.0
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
func (*OrdererConfig) KafkaBrokers ¶ added in v1.0.0
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 (*OrdererConfig) MaxChannelsCount ¶ added in v1.0.0
func (oc *OrdererConfig) MaxChannelsCount() uint64
MaxChannelsCount returns the maximum count of channels this orderer supports
func (*OrdererConfig) Organizations ¶ added in v1.0.0
func (oc *OrdererConfig) Organizations() map[string]Org
Organizations returns a map of the orgs in the channel
func (*OrdererConfig) Validate ¶ added in v1.0.0
func (oc *OrdererConfig) Validate(tx interface{}, groups map[string]ValueProposer) error
type OrdererGroup ¶ added in v1.0.0
type OrdererGroup struct { *Proposer *OrdererConfig // contains filtered or unexported fields }
Config is stores the orderer component configuration
func NewOrdererGroup ¶ added in v1.0.0
func NewOrdererGroup(mspConfig *msp.MSPConfigHandler) *OrdererGroup
NewConfig creates a new *OrdererConfig
func (*OrdererGroup) Allocate ¶ added in v1.0.0
func (og *OrdererGroup) Allocate() Values
func (OrdererGroup) Deserialize ¶ added in v1.0.0
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
func (*OrdererGroup) NewGroup ¶ added in v1.0.0
func (og *OrdererGroup) NewGroup(name string) (ValueProposer, error)
NewGroup returns an Org instance
type OrdererProtos ¶ added in v1.0.0
type OrdererProtos struct { ConsensusType *ab.ConsensusType BatchSize *ab.BatchSize BatchTimeout *ab.BatchTimeout KafkaBrokers *ab.KafkaBrokers ChannelRestrictions *ab.ChannelRestrictions }
OrdererProtos is used as the source of the OrdererConfig
type Org ¶ added in v1.0.0
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 }
Org stores the common organizational config
type OrganizationConfig ¶ added in v1.0.0
type OrganizationConfig struct {
// contains filtered or unexported fields
}
func NewOrganizationConfig ¶ added in v1.0.0
func NewOrganizationConfig(og *OrganizationGroup) *OrganizationConfig
func (*OrganizationConfig) Commit ¶ added in v1.0.0
func (oc *OrganizationConfig) Commit()
func (OrganizationConfig) Deserialize ¶ added in v1.0.0
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
func (*OrganizationConfig) Validate ¶ added in v1.0.0
func (oc *OrganizationConfig) Validate(tx interface{}, groups map[string]ValueProposer) error
Validate returns whether the configuration is valid
type OrganizationGroup ¶ added in v1.0.0
type OrganizationGroup struct { *Proposer *OrganizationConfig // contains filtered or unexported fields }
Config stores common configuration information for organizations
func NewOrganizationGroup ¶ added in v1.0.0
func NewOrganizationGroup(name string, mspConfigHandler *mspconfig.MSPConfigHandler) *OrganizationGroup
NewConfig creates an instnace of the organization Config
func (*OrganizationGroup) Allocate ¶ added in v1.0.0
func (og *OrganizationGroup) Allocate() Values
Allocate creates the proto resources neeeded for a proposal
func (OrganizationGroup) Deserialize ¶ added in v1.0.0
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
func (*OrganizationGroup) MSPID ¶ added in v1.0.0
func (og *OrganizationGroup) MSPID() string
MSPID returns the MSP ID associated with this org
func (*OrganizationGroup) Name ¶ added in v1.0.0
func (og *OrganizationGroup) Name() string
Name returns the name this org is referred to in config
func (*OrganizationGroup) NewGroup ¶ added in v1.0.0
func (og *OrganizationGroup) NewGroup(name string) (ValueProposer, error)
NewGroup always errors
type OrganizationProtos ¶ added in v1.0.0
type Proposer ¶ added in v1.0.0
type Proposer struct {
// contains filtered or unexported fields
}
func NewProposer ¶ added in v1.0.0
func (*Proposer) BeginValueProposals ¶ added in v1.0.0
func (p *Proposer) BeginValueProposals(tx interface{}, groups []string) (ValueDeserializer, []ValueProposer, error)
BeginValueProposals called when a config proposal is begun
func (*Proposer) CommitProposals ¶ added in v1.0.0
func (p *Proposer) CommitProposals(tx interface{})
CommitProposals called when a config proposal is committed
func (*Proposer) PreCommit ¶ added in v1.0.0
Validate ensures that the new config values is a valid change
func (*Proposer) RollbackProposals ¶ added in v1.0.0
func (p *Proposer) RollbackProposals(tx interface{})
RollbackProposals called when a config proposal is abandoned
type Root ¶ added in v1.0.0
type Root struct {
// contains filtered or unexported fields
}
Root acts as the object which anchors the rest of the config Note, yes, this is a stuttering name, but, the intent is to move this up one level at the end of refactoring
func NewRoot ¶ added in v1.0.0
func NewRoot(mspConfigHandler *msp.MSPConfigHandler) *Root
NewRoot creates a new instance of the Root
func (*Root) Application ¶ added in v1.0.0
func (r *Root) Application() *ApplicationGroup
Application returns the associated Application level config
func (*Root) BeginValueProposals ¶ added in v1.0.0
func (r *Root) BeginValueProposals(tx interface{}, groups []string) (ValueDeserializer, []ValueProposer, error)
BeginValueProposals is used to start a new config proposal
func (*Root) Channel ¶ added in v1.0.0
func (r *Root) Channel() *ChannelGroup
Channel returns the associated Channel level config
func (*Root) CommitProposals ¶ added in v1.0.0
func (r *Root) CommitProposals(tx interface{})
CommitConfig is used to commit a new config proposal
func (*Root) Consortiums ¶ added in v1.0.0
func (r *Root) Consortiums() *ConsortiumsGroup
func (*Root) Orderer ¶ added in v1.0.0
func (r *Root) Orderer() *OrdererGroup
Orderer returns the associated Orderer level config
func (*Root) PreCommit ¶ added in v1.0.0
PreCommit is used to verify total configuration before commit
func (*Root) RollbackProposals ¶ added in v1.0.0
func (r *Root) RollbackProposals(tx interface{})
RollbackConfig is used to abandon a new config proposal
type ValueDeserializer ¶ added in v1.0.0
type ValueDeserializer interface { // Deserialize takes a Value key as a string, and a marshaled Value value as bytes // and returns the deserialized version of that value. Note, this function operates // with side effects intended. Using a ValueDeserializer to deserialize a message will // generally set the value in the Values interface that the ValueDeserializer derived from // Therefore, the proto.Message may be safely discarded, but may be retained for // inspection and or debugging purposes. Deserialize(key string, value []byte) (proto.Message, error) }
ValueDeserializer provides a mechanism to retrieve proto messages to deserialize config values into
type ValueProposer ¶ added in v1.0.0
type ValueProposer interface { // BeginValueProposals called when a config proposal is begun BeginValueProposals(tx interface{}, groups []string) (ValueDeserializer, []ValueProposer, error) // RollbackProposals called when a config proposal is abandoned RollbackProposals(tx interface{}) // PreCommit is invoked before committing the config to catch // any errors which cannot be caught on a per proposal basis // TODO, rename other methods to remove Value/Proposal references PreCommit(tx interface{}) error // CommitProposals called when a config proposal is committed CommitProposals(tx interface{}) }
type Values ¶ added in v1.0.0
type Values interface { ValueDeserializer // Validate should ensure that the values set into the proto messages are correct // and that the new group values are allowed. It also includes a tx ID in case cross // Handler invocations (ie to the MSP Config Manager) must be made Validate(interface{}, map[string]ValueProposer) error // Commit should call back into the Value handler to update the config Commit() }
Values defines a mechanism to supply messages to unamrshal from config and a mechanism to validate the results