Documentation ¶
Index ¶
- Constants
- func AddPolicies(cg *cb.ConfigGroup, policyMap map[string]*Policy, modPolicy string) error
- func NewApplicationGroup(conf *Application) (*cb.ConfigGroup, error)
- func NewApplicationOrgGroup(conf *Organization) (*cb.ConfigGroup, error)
- func NewConsortiumGroup(conf *Consortium) (*cb.ConfigGroup, error)
- func NewConsortiumOrgGroup(conf *Organization) (*cb.ConfigGroup, error)
- func NewConsortiumsGroup(conf map[string]*Consortium) (*cb.ConfigGroup, error)
- func NewOrdererOrgGroup(conf *Organization, mspConfig *msp.MSPConfig) (*cb.ConfigGroup, error)
- func ValidateOrg(org *Organization) error
- type AnchorPeer
- type Application
- type BatchSize
- type ConfigTx
- type Consortium
- type Kafka
- type Orderer
- type Organization
- type Policy
- type Profile
- func (p *Profile) AddConsortium(name string, consortium *Consortium) error
- func (p *Profile) AddOrdererAddress(address string)
- func (p *Profile) AddOrgToConsortium(name string, org *Organization) error
- func (p *Profile) AddOrgToOrderer(org *Organization) error
- func (p *Profile) AddRaftConsentingNode(consenter *etcdraft.Consenter) error
- func (p *Profile) Block(channelID string, channelGroup *cb.ConfigGroup) *cb.Block
- func (p *Profile) GenerateBlock(channelID string, mspConfigs map[string]*msp.MSPConfig) ([]byte, error)
- func (p *Profile) NewChannelConfigGroup(mspConfigs map[string]*msp.MSPConfig) (*cb.ConfigGroup, error)
- func (p *Profile) NewOrdererGroup(conf *Orderer, mspConfigs map[string]*msp.MSPConfig) (*cb.ConfigGroup, error)
- func (p *Profile) SetCapabilitiesForOrderer(capabilities map[string]bool)
- func (p *Profile) SetChannelPolicy(policies map[string]*Policy)
- func (p *Profile) SetMaxChannel(max uint64)
- func (p *Profile) SetOrdererType(ordererType string)
- type Resources
- type TopLevel
Constants ¶
const ( // ConsensusTypeSolo identifies the solo consensus implementation. ConsensusTypeSolo = "solo" // ConsensusTypeKafka identifies the Kafka-based consensus implementation. ConsensusTypeKafka = "kafka" // ConsensusTypeKafka identifies the Kafka-based consensus implementation. ConsensusTypeEtcdRaft = "etcdraft" // BlockValidationPolicyKey BlockValidationPolicyKey = "BlockValidation" // OrdererAdminsPolicy is the absolute path to the orderer admins policy OrdererAdminsPolicy = "/Channel/Orderer/Admins" // SignaturePolicyType is the 'Type' string for signature policies SignaturePolicyType = "Signature" // ImplicitMetaPolicyType is the 'Type' string for implicit meta policies ImplicitMetaPolicyType = "ImplicitMeta" // AdminRoleAdminPrincipal is set as AdminRole to cause the MSP role of // type Admin to be used as the admin principal default AdminRoleAdminPrincipal = "Role.ADMIN" )
Variables ¶
This section is empty.
Functions ¶
func AddPolicies ¶
func NewApplicationGroup ¶
func NewApplicationGroup(conf *Application) (*cb.ConfigGroup, error)
NewApplicationGroup returns the application component of the channel configuration. It defines the organizations which are involved in application logic like chaincodes, and how these members may interact with the orderer. It sets the mod_policy of all elements to "Admins".
func NewApplicationOrgGroup ¶
func NewApplicationOrgGroup(conf *Organization) (*cb.ConfigGroup, error)
NewApplicationOrgGroup returns an application org component of the channel configuration. It defines the crypto material for the organization (its MSP) as well as its anchor peers for use by the gossip network. It sets the mod_policy of all elements to "Admins".
func NewConsortiumGroup ¶
func NewConsortiumGroup(conf *Consortium) (*cb.ConfigGroup, error)
NewConsortiums returns a consortiums component of the channel configuration. Each consortium defines the organizations which may be involved in channel creation, as well as the channel creation policy the orderer checks at channel creation time to authorize the action. It sets the mod_policy of all elements to "/Channel/Orderer/Admins".
func NewConsortiumOrgGroup ¶
func NewConsortiumOrgGroup(conf *Organization) (*cb.ConfigGroup, error)
NewConsortiumsGroup returns an org component of the channel configuration. It defines the crypto material for the organization (its MSP). It sets the mod_policy of all elements to "Admins".
func NewConsortiumsGroup ¶
func NewConsortiumsGroup(conf map[string]*Consortium) (*cb.ConfigGroup, error)
NewConsortiumsGroup returns the consortiums component of the channel configuration. This element is only defined for the ordering system channel. It sets the mod_policy for all elements to "/Channel/Orderer/Admins".
func NewOrdererOrgGroup ¶
func NewOrdererOrgGroup(conf *Organization, mspConfig *msp.MSPConfig) (*cb.ConfigGroup, error)
NewOrdererOrgGroup returns an orderer org component of the channel configuration. It defines the crypto material for the organization (its MSP). It sets the mod_policy of all elements to "Admins".
func ValidateOrg ¶
func ValidateOrg(org *Organization) error
Types ¶
type AnchorPeer ¶
AnchorPeer encodes the necessary fields to identify an anchor peer.
type Application ¶
type Application struct { Organizations []*Organization `yaml:"Organizations"` Capabilities map[string]bool `yaml:"Capabilities"` Resources *Resources `yaml:"Resources"` Policies map[string]*Policy `yaml:"Policies"` ACLs map[string]string `yaml:"ACLs"` }
Application encodes the application-level configuration needed in config transactions.
type BatchSize ¶
type BatchSize struct { MaxMessageCount uint32 `yaml:"MaxMessageCount"` AbsoluteMaxBytes uint32 `yaml:"AbsoluteMaxBytes"` PreferredMaxBytes uint32 `yaml:"PreferredMaxBytes"` }
BatchSize contains configuration affecting the size of batches.
type ConfigTx ¶
type ConfigTx struct {
Config *TopLevel
}
func (*ConfigTx) CompleteOrdererInitialization ¶
func (*ConfigTx) CompleteProfileInitialization ¶
type Consortium ¶
type Consortium struct {
Organizations []*Organization `yaml:"Organizations"`
}
Consortium represents a group of organizations which may create channels with each other
type Kafka ¶
type Kafka struct {
Brokers []string `yaml:"Brokers"`
}
Kafka contains configuration for the Kafka-based orderer.
type Orderer ¶
type Orderer struct { OrdererType string `yaml:"OrdererType"` Addresses []string `yaml:"Addresses"` BatchTimeout time.Duration `yaml:"BatchTimeout"` BatchSize BatchSize `yaml:"BatchSize"` Kafka Kafka `yaml:"Kafka"` EtcdRaft *etcdraft.ConfigMetadata `yaml:"EtcdRaft"` Organizations []*Organization `yaml:"Organizations"` MaxChannels uint64 `yaml:"MaxChannels"` Capabilities map[string]bool `yaml:"Capabilities"` Policies map[string]*Policy `yaml:"Policies"` }
Orderer contains configuration associated to a channel.
type Organization ¶
type Organization struct { Name string `yaml:"Name"` ID string `yaml:"ID"` MSPDir string `yaml:"MSPDir"` MSPType string `yaml:"MSPType"` Policies map[string]*Policy `yaml:"Policies"` // Note: Viper deserialization does not seem to care for // embedding of types, so we use one organization struct // for both orderers and applications. AnchorPeers []*AnchorPeer `yaml:"AnchorPeers"` OrdererEndpoints []string `yaml:"OrdererEndpoints"` // AdminPrincipal is deprecated and may be removed in a future release // it was used for modifying the default policy generation, but policies // may now be specified explicitly so it is redundant and unnecessary AdminPrincipal string `yaml:"AdminPrincipal"` // SkipAsForeign indicates that this org definition is actually unknown to this // instance of the tool, so, parsing of this org's parameters should be ignored. SkipAsForeign bool }
Organization encodes the organization-level configuration needed in config transactions.
type Profile ¶
type Profile struct { Consortium string `yaml:"Consortium"` Application *Application `yaml:"Application"` Orderer *Orderer `yaml:"Orderer"` Consortiums map[string]*Consortium `yaml:"Consortiums"` Capabilities map[string]bool `yaml:"Capabilities"` Policies map[string]*Policy `yaml:"Policies"` }
Profile encodes orderer/application configuration combinations for the configtxgen tool.
func (*Profile) AddConsortium ¶
func (p *Profile) AddConsortium(name string, consortium *Consortium) error
func (*Profile) AddOrdererAddress ¶
func (*Profile) AddOrgToConsortium ¶
func (p *Profile) AddOrgToConsortium(name string, org *Organization) error
func (*Profile) AddOrgToOrderer ¶
func (p *Profile) AddOrgToOrderer(org *Organization) error
func (*Profile) AddRaftConsentingNode ¶
func (*Profile) GenerateBlock ¶
func (*Profile) NewChannelConfigGroup ¶
func (*Profile) NewOrdererGroup ¶
func (*Profile) SetCapabilitiesForOrderer ¶
func (*Profile) SetChannelPolicy ¶
func (*Profile) SetMaxChannel ¶
func (*Profile) SetOrdererType ¶
type Resources ¶
type Resources struct {
DefaultModPolicy string
}
Resources encodes the application-level resources configuration needed to seed the resource tree
type TopLevel ¶
type TopLevel struct { Profiles map[string]*Profile `yaml:"Profiles"` Organizations []*Organization `yaml:"Organizations"` Channel *Profile `yaml:"Channel"` Application *Application `yaml:"Application"` Orderer *Orderer `yaml:"Orderer"` Capabilities map[string]map[string]bool `yaml:"Capabilities"` Resources *Resources `yaml:"Resources"` }
TopLevel consists of the structs used by the configtxgen tool.