Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultReplicationBackgroundRefreshInterval = time.Minute * 5
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChainReplicator ¶
type ChainReplicator interface { // ReplicateChains replicates the given chains using the given last system channel config block. // It returns the names of the chains that were successfully replicated. ReplicateChains(lastConfigBlock *common.Block, chains []string) []string }
ChainReplicator replicates chains
type Factory ¶
type Factory interface { // GetOrCreate gets an existing ledger (if it exists) // or creates it if it does not GetOrCreate(chainID string) (blockledger.ReadWriter, error) // ChannelIDs returns the channel IDs the Factory is aware of ChannelIDs() []string // Close releases all resources acquired by the factory Close() }
Factory retrieves or creates new ledgers by chainID
type InactiveChainReplicator ¶
type InactiveChainReplicator struct {
// contains filtered or unexported fields
}
InactiveChainReplicator tracks disabled chains and replicates them upon demand
func NewInactiveChainReplicator ¶
func NewInactiveChainReplicator( chainReplicator ChainReplicator, getSysChannelConfigBlockFunc func() *common.Block, registerChainFunc func(chain string), replicationRefreshInterval time.Duration, ) *InactiveChainReplicator
func (*InactiveChainReplicator) Channels ¶
func (dc *InactiveChainReplicator) Channels() []cluster.ChannelGenesisBlock
func (*InactiveChainReplicator) Close ¶
func (dc *InactiveChainReplicator) Close()
func (*InactiveChainReplicator) Run ¶
func (dc *InactiveChainReplicator) Run()
func (*InactiveChainReplicator) TrackChain ¶
func (dc *InactiveChainReplicator) TrackChain(chain string, genesisBlock *common.Block, createChainCallback func())
TrackChain tracks a chain with the given name, and calls the given callback when this chain should be activated.
type ReplicationInitiator ¶
type ReplicationInitiator struct { RegisterChain func(chain string) ChannelLister cluster.ChannelLister // contains filtered or unexported fields }
func NewReplicationInitiator ¶
func NewReplicationInitiator( lf blockledger.Factory, bootstrapBlock *common.Block, conf *localconfig.TopLevel, secOpts comm.SecureOptions, signer identity.SignerSerializer, bccsp bccsp.BCCSP, ) *ReplicationInitiator
func (*ReplicationInitiator) ReplicateChains ¶
func (ri *ReplicationInitiator) ReplicateChains(lastConfigBlock *common.Block, chains []string) []string
ReplicateChains replicates the given chains with the assistance of the given last system channel config block, and returns the names of the chains that were successfully replicated.
func (*ReplicationInitiator) ReplicateIfNeeded ¶
func (ri *ReplicationInitiator) ReplicateIfNeeded(bootstrapBlock *common.Block)
Click to show internal directories.
Click to hide internal directories.