const ( // ConsensusTypeSolo identifies the solo consensus implementation. ConsensusTypeSolo = "solo" // ConsensusTypeKafka identifies the Kafka-based consensus implementation. ConsensusTypeKafka = "kafka" // ConsensusTypeKafka identifies the etcdraft-based consensus implementation. ConsensusTypeEtcdRaft = "etcdraft" // ConsensusTypeSmartBFT identifies the SmartBFT-based consensus implementation. ConsensusTypeSmartBFT = "smartbft" // BlockValidationPolicyKey TODO 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" // ImplicitOrdererPolicyType is the 'Type' string for implicit orderer policies ImplicitOrdererPolicyType = "ImplicitOrderer" )
func ConfigTemplateFromGroup(conf *localconfig.Profile, cg *cb.ConfigGroup) (*cb.ConfigGroup, error)
func DefaultConfigTemplate(conf *localconfig.Profile) (*cb.ConfigGroup, error)
DefaultConfigTemplate generates a config template based on the assumption that the input profile is a channel creation template and no system channel context is available.
func HasSkippedForeignOrgs(conf *localconfig.Profile) error
HasSkippedForeignOrgs is used to detect whether a configuration includes org definitions which should not be parsed because this tool is being run in a context where the user does not have access to that org's info
func MakeChannelCreationTransaction( channelID string, signer SignerSerializer, conf *localconfig.Profile, ) (*cb.Envelope, error)
MakeChannelCreationTransaction is a handy utility function for creating transactions for channel creation. It assumes the invoker has no system channel context so ignores all but the application section.
func MakeChannelCreationTransactionFromTemplate( channelID string, signer SignerSerializer, conf *localconfig.Profile, template *cb.ConfigGroup, ) (*cb.Envelope, error)
MakeChannelCreationTransactionFromTemplate creates a transaction for creating a channel. It uses the given template to produce the config update set. Usually, the caller will want to invoke MakeChannelCreationTransaction or MakeChannelCreationTransactionWithSystemChannelContext.
func MakeChannelCreationTransactionWithSystemChannelContext( channelID string, signer SignerSerializer, conf, systemChannelConf *localconfig.Profile, ) (*cb.Envelope, error)
MakeChannelCreationTransactionWithSystemChannelContext is a utility function for creating channel creation txes. It requires a configuration representing the orderer system channel to allow more sophisticated channel creation transactions modifying pieces of the configuration like the orderer set.
func NewApplicationGroup(conf *localconfig.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(conf *localconfig.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 NewChannelCreateConfigUpdate(channelID string, conf *localconfig.Profile, templateConfig *cb.ConfigGroup) (*cb.ConfigUpdate, error)
NewChannelCreateConfigUpdate generates a ConfigUpdate which can be sent to the orderer to create a new channel. Optionally, the channel group of the ordering system channel may be passed in, and the resulting ConfigUpdate will extract the appropriate versions from this file.
func NewChannelGroup(conf *localconfig.Profile) (*cb.ConfigGroup, error)
NewChannelGroup defines the root of the channel configuration. It defines basic operating principles like the hashing algorithm used for the blocks, as well as the location of the ordering service. It will recursively call into the NewOrdererGroup, NewConsortiumsGroup, and NewApplicationGroup depending on whether these sub-elements are set in the configuration. All mod_policy values are set to "Admins" for this group, with the exception of the OrdererAddresses value which is set to "/Channel/Orderer/Admins".
func NewConsortiumGroup(conf *localconfig.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(conf *localconfig.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(conf map[string]*localconfig.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 NewOrdererGroup(conf *localconfig.Orderer) (*cb.ConfigGroup, error)
NewOrdererGroup returns the orderer component of the channel configuration. It defines parameters of the ordering service about how large blocks should be, how frequently they should be emitted, etc. as well as the organizations of the ordering network. It sets the mod_policy of all elements to "Admins". This group is always present in any channel configuration.
func NewOrdererOrgGroup(conf *localconfig.Organization) (*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".
Bootstrapper is a wrapper around NewChannelConfigGroup which can produce genesis blocks
type Bootstrapper struct {
// contains filtered or unexported fields
}
func New(config *localconfig.Profile) *Bootstrapper
New creates a new Bootstrapper for generating genesis blocks
func NewBootstrapper(config *localconfig.Profile) (*Bootstrapper, error)
NewBootstrapper creates a bootstrapper but returns an error instead of panic-ing
func (bs *Bootstrapper) GenesisBlock() *cb.Block
GenesisBlock produces a genesis block for the default test chain id
func (bs *Bootstrapper) GenesisBlockForChannel(channelID string) *cb.Block
GenesisBlockForChannel produces a genesis block for a given channel ID
type LocalSigner struct { Signer crypto.LocalSigner SS SignerSerializer }
func (ls *LocalSigner) NewSignatureHeader() (*cb.SignatureHeader, error)
func (ls *LocalSigner) Serialize() ([]byte, error)
func (ls *LocalSigner) Sign(message []byte) ([]byte, error)
type SignerSerializer interface { crypto.Signer crypto.IdentitySerializer }