encoder

package
v0.0.0-...-f69b815 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2023 License: Apache-2.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
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"
)

Variables

This section is empty.

Functions

func ConfigTemplateFromGroup

func ConfigTemplateFromGroup(conf *genesisconfig.Profile, cg *cb.ConfigGroup) (*cb.ConfigGroup, error)

func DefaultConfigTemplate

func DefaultConfigTemplate(conf *genesisconfig.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

func HasSkippedForeignOrgs(conf *genesisconfig.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

func MakeChannelCreationTransaction(channelID string, signer crypto.LocalSigner, conf *genesisconfig.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

func MakeChannelCreationTransactionFromTemplate(channelID string, signer crypto.LocalSigner, conf *genesisconfig.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

func MakeChannelCreationTransactionWithSystemChannelContext(channelID string, signer crypto.LocalSigner, conf, systemChannelConf *genesisconfig.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

func NewApplicationGroup(conf *genesisconfig.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 *genesisconfig.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

func NewChannelCreateConfigUpdate(channelID string, conf *genesisconfig.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

func NewChannelGroup(conf *genesisconfig.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

func NewConsortiumGroup(conf *genesisconfig.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 *genesisconfig.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]*genesisconfig.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

func NewOrdererGroup(conf *genesisconfig.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

func NewOrdererOrgGroup(conf *genesisconfig.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".

Types

type Bootstrapper

type Bootstrapper struct {
	// contains filtered or unexported fields
}

Bootstrapper is a wrapper around NewChannelConfigGroup which can produce genesis blocks

func New

func New(config *genesisconfig.Profile) *Bootstrapper

New creates a new Bootstrapper for generating genesis blocks

func NewBootstrapper

func NewBootstrapper(config *genesisconfig.Profile) (*Bootstrapper, error)

NewBootstrapper creates a bootstrapper but returns an error instead of panic-ing

func (*Bootstrapper) GenesisBlock

func (bs *Bootstrapper) GenesisBlock() *cb.Block

GenesisBlock produces a genesis block for the default test chain id

func (*Bootstrapper) GenesisBlockForChannel

func (bs *Bootstrapper) GenesisBlockForChannel(channelID string) *cb.Block

GenesisBlockForChannel produces a genesis block for a given channel ID

type SignerSerializer

type SignerSerializer interface {
	crypto.Signer
	crypto.IdentitySerializer
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL