fabric: github.com/hyperledger/fabric/common/tools/configtxgen/encoder Index | Files | Directories

package encoder

import "github.com/hyperledger/fabric/common/tools/configtxgen/encoder"


Package Files



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"

func ConfigTemplateFromGroup Uses

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

func DefaultConfigTemplate Uses

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 MakeChannelCreationTransaction Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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".

type Bootstrapper Uses

type Bootstrapper struct {
    // contains filtered or unexported fields

Bootstrapper is a wrapper around NewChannelConfigGroup which can produce genesis blocks

func New Uses

func New(config *genesisconfig.Profile) *Bootstrapper

New creates a new Bootstrapper for generating genesis blocks

func (*Bootstrapper) GenesisBlock Uses

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

GenesisBlock produces a genesis block for the default test chain id

func (*Bootstrapper) GenesisBlockForChannel Uses

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

GenesisBlockForChannel produces a genesis block for a given channel ID


mockCode generated by counterfeiter.

Package encoder imports 16 packages (graph) and is imported by 5 packages. Updated 2019-08-07. Refresh now. Tools for package owners.