encoder

package
v1.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2018 License: 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"

	// 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"
)

Variables

This section is empty.

Functions

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

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) (*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 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 (*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

Jump to

Keyboard shortcuts

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