Documentation ¶
Overview ¶
Package 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.
Index ¶
- type BlockWriter
- type ChainSupport
- func (cs *ChainSupport) BlockCutter() blockcutter.Receiver
- func (cs *ChainSupport) ChainID() string
- func (cs *ChainSupport) ConfigEnvelope() *cb.ConfigEnvelope
- func (cs *ChainSupport) ProposeConfigUpdate(configtx *cb.Envelope) (*cb.ConfigEnvelope, error)
- func (cs *ChainSupport) Reader() ledger.Reader
- func (cs *ChainSupport) Sequence() uint64
- func (cs *ChainSupport) Signer() crypto.LocalSigner
- func (cs *ChainSupport) Validate(configEnv *cb.ConfigEnvelope) error
- type Registrar
- func (r *Registrar) BroadcastChannelSupport(msg *cb.Envelope) (*cb.ChannelHeader, bool, *ChainSupport, error)
- func (r *Registrar) ChannelsCount() int
- func (r *Registrar) CreateBundle(channelID string, config *cb.Config) (channelconfig.Resources, error)
- func (r *Registrar) GetChain(chainID string) (*ChainSupport, bool)
- func (r *Registrar) NewChannelConfig(envConfigUpdate *cb.Envelope) (channelconfig.Resources, error)
- func (r *Registrar) SystemChannelID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockWriter ¶
type BlockWriter struct {
// contains filtered or unexported fields
}
BlockWriter 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.
func (*BlockWriter) CreateNextBlock ¶
func (bw *BlockWriter) CreateNextBlock(messages []*cb.Envelope) *cb.Block
CreateNextBlock creates a new block with the next block number, and the given contents.
func (*BlockWriter) WriteBlock ¶
func (bw *BlockWriter) WriteBlock(block *cb.Block, encodedMetadataValue []byte)
WriteBlock 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.
func (*BlockWriter) WriteConfigBlock ¶
func (bw *BlockWriter) WriteConfigBlock(block *cb.Block, encodedMetadataValue []byte)
WriteConfigBlock 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.
type ChainSupport ¶
type ChainSupport struct { msgprocessor.Processor *BlockWriter consensus.Chain crypto.LocalSigner // contains filtered or unexported fields }
ChainSupport holds the resources for a particular channel.
func (*ChainSupport) BlockCutter ¶
func (cs *ChainSupport) BlockCutter() blockcutter.Receiver
BlockCutter returns the blockcutter.Receiver instance for this channel.
func (*ChainSupport) ChainID ¶
func (cs *ChainSupport) ChainID() string
ChainID passes through to the underlying configtxapi.Manager
func (*ChainSupport) ConfigEnvelope ¶
func (cs *ChainSupport) ConfigEnvelope() *cb.ConfigEnvelope
ConfigEnvelope passes through to the underlying configtxapi.Manager
func (*ChainSupport) ProposeConfigUpdate ¶
func (cs *ChainSupport) ProposeConfigUpdate(configtx *cb.Envelope) (*cb.ConfigEnvelope, error)
ProposeConfigUpdate passes through to the underlying configtxapi.Manager
func (*ChainSupport) Reader ¶
func (cs *ChainSupport) Reader() ledger.Reader
func (*ChainSupport) Sequence ¶
func (cs *ChainSupport) Sequence() uint64
Sequence passes through to the underlying configtxapi.Manager
func (*ChainSupport) Signer ¶
func (cs *ChainSupport) Signer() crypto.LocalSigner
Signer returns the crypto.Localsigner for this channel.
func (*ChainSupport) Validate ¶
func (cs *ChainSupport) Validate(configEnv *cb.ConfigEnvelope) error
Validate passes through to the underlying configtxapi.Manager
type Registrar ¶
type Registrar struct {
// contains filtered or unexported fields
}
Registrar serves as a point of access and control for the individual channel resources.
func NewRegistrar ¶
func NewRegistrar(ledgerFactory ledger.Factory, consenters map[string]consensus.Consenter, signer crypto.LocalSigner, callbacks ...func(bundle *channelconfig.Bundle)) *Registrar
NewRegistrar produces an instance of a *Registrar.
func (*Registrar) BroadcastChannelSupport ¶
func (r *Registrar) BroadcastChannelSupport(msg *cb.Envelope) (*cb.ChannelHeader, bool, *ChainSupport, error)
BroadcastChannelSupport 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)
func (*Registrar) ChannelsCount ¶
ChannelsCount returns the count of the current total number of channels.
func (*Registrar) CreateBundle ¶
func (r *Registrar) CreateBundle(channelID string, config *cb.Config) (channelconfig.Resources, error)
CreateBundle calls channelconfig.NewBundle
func (*Registrar) GetChain ¶
func (r *Registrar) GetChain(chainID string) (*ChainSupport, bool)
GetChain retrieves the chain support for a chain (and whether it exists)
func (*Registrar) NewChannelConfig ¶
NewChannelConfig produces a new template channel configuration based on the system channel's current config.