{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package multichannel\n\nPackage multichannel tracks the channel resources for the orderer.  It initially loads the set of existing channels, and provides an interface for users of these channels to retrieve them, or create new ones.\n\n## Functions\n\n```go\nfunc ConfigBlock(reader blockledger.Reader) *cb.Block\n```\nConfigBlock retrieves the last configuration block from the given ledger. Panics on failure.\n\n## Types\n\n```go\ntype BlockWriter struct {\n\t// contains filtered or unexported fields\n}\n```\nBlockWriter efficiently writes the blockchain to disk. To safely use BlockWriter, only one thread should interact with it. BlockWriter will spawn additional committing go routines and handle locking so that these other go routines safely interact with the calling one.\n\n```go\nfunc (bw *BlockWriter) CreateNextBlock(messages []*cb.Envelope) *cb.Block\n```\nCreateNextBlock creates a new block with the next block number, and the given contents.\n\n```go\nfunc (bw *BlockWriter) WriteBlock(block *cb.Block, encodedMetadataValue []byte)\n```\nWriteBlock should be invoked for blocks which contain normal transactions. It sets the target block as the pending next block, and returns before it is committed. Before returning, it acquires the committing lock, and spawns a go routine which will annotate the block with metadata and signatures, and write the block to the ledger then release the lock.  This allows the calling thread to begin assembling the next block before the commit phase is complete.\n\n```go\nfunc (bw *BlockWriter) WriteConfigBlock(block *cb.Block, encodedMetadataValue []byte)\n```\nWriteConfigBlock should be invoked for blocks which contain a config transaction. This call will block until the new config has taken effect, then will return while the block is written asynchronously to disk.\n\n```go\ntype ChainSupport struct {\n\tmsgprocessor.Processor\n\t*BlockWriter\n\tconsensus.Chain\n\n\tcrypto.LocalSigner\n\t// contains filtered or unexported fields\n}\n```\nChainSupport holds the resources for a particular channel.\n\n```go\nfunc (cs *ChainSupport) Append(block *cb.Block) error\n```\nAppend appends a new block to the ledger in its raw form, unlike WriteBlock that also mutates its metadata.\n\n```go\nfunc (cs *ChainSupport) Block(number uint64) *cb.Block\n```\nBlock returns a block with the following number, or nil if such a block doesn't exist.\n\n```go\nfunc (cs *ChainSupport) BlockCutter() blockcutter.Receiver\n```\nBlockCutter returns the blockcutter.Receiver instance for this channel.\n\n```go\nfunc (cs *ChainSupport) ChainID() string\n```\nChainID passes through to the underlying configtx.Validator\n\n```go\nfunc (cs *ChainSupport) ConfigProto() *cb.Config\n```\nConfigProto passes through to the underlying configtx.Validator\n\n```go\nfunc (cs *ChainSupport) ProposeConfigUpdate(configtx *cb.Envelope) (*cb.ConfigEnvelope, error)\n```\nProposeConfigUpdate passes through to the underlying configtx.Validator\n\n```go\nfunc (cs *ChainSupport) Reader() blockledger.Reader\n```\n\n```go\nfunc (cs *ChainSupport) Sequence() uint64\n```\nSequence passes through to the underlying configtx.Validator\n\n```go\nfunc (cs *ChainSupport) Signer() crypto.LocalSigner\n```\nSigner returns the crypto.Localsigner for this channel.\n\n```go\nfunc (cs *ChainSupport) Validate(configEnv *cb.ConfigEnvelope) error\n```\nValidate passes through to the underlying configtx.Validator\n\n```go\nfunc (cs *ChainSupport) VerifyBlockSignature(sd []*cb.SignedData, envelope *cb.ConfigEnvelope) error\n```\nVerifyBlockSignature verifies a signature of a block. It has an optional argument of a configuration envelope which would make the block verification to use validation rules based on the given configuration in the ConfigEnvelope. If the config envelope passed is nil, then the validation rules used are the ones that were applied at commit of previous blocks.\n\n```go\ntype Registrar struct {\n\t// contains filtered or unexported fields\n}\n```\nRegistrar serves as a point of access and control for the individual channel resources.\n\n```go\nfunc NewRegistrar(\n\tconfig localconfig.TopLevel,\n\tledgerFactory blockledger.Factory,\n\tsigner crypto.LocalSigner,\n\tmetricsProvider metrics.Provider,\n\tcallbacks ...channelconfig.BundleActor) *Registrar\n```\nNewRegistrar produces an instance of a \\*Registrar.\n\n```go\nfunc (r *Registrar) BroadcastChannelSupport(msg *cb.Envelope) (*cb.ChannelHeader, bool, *ChainSupport, error)\n```\nBroadcastChannelSupport returns the message channel header, whether the message is a config update and the channel resources for a message or an error if the message is not a message which can be processed directly (like CONFIG and ORDERER\\_TRANSACTION messages)\n\n```go\nfunc (r *Registrar) ChannelsCount() int\n```\nChannelsCount returns the count of the current total number of channels.\n\n```go\nfunc (r *Registrar) CreateBundle(channelID string, config *cb.Config) (channelconfig.Resources, error)\n```\nCreateBundle calls channelconfig.NewBundle\n\n```go\nfunc (r *Registrar) CreateChain(chainName string)\n```\nCreateChain makes the Registrar create a chain with the given name.\n\n```go\nfunc (r *Registrar) GetChain(chainID string) *ChainSupport\n```\nGetChain retrieves the chain support for a chain if it exists.\n\n```go\nfunc (r *Registrar) Initialize(consenters map[string]consensus.Consenter)\n```\n\n```go\nfunc (r *Registrar) NewChannelConfig(envConfigUpdate *cb.Envelope) (channelconfig.Resources, error)\n```\nNewChannelConfig produces a new template channel configuration based on the system channel's current config.\n\n```go\nfunc (r *Registrar) SystemChannelID() string\n```\nSystemChannelID returns the ChannelID for the system channel.\n\n","path":"github.com/eric-erki/https-hyperledger.org/orderer/common/multichannel","name":"multichannel","synopsis":"Package multichannel tracks the channel resources for the orderer.","isRedistributable":true}
