onboarding

package
v0.0.0-...-b544036 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultReplicationBackgroundRefreshInterval = time.Minute * 5
)

Variables

This section is empty.

Functions

func ValidateBootstrapBlock

func ValidateBootstrapBlock(block *common.Block, bccsp bccsp.BCCSP) error

ValidateBootstrapBlock returns whether this block can be used as a bootstrap block. A bootstrap block is a block of a system channel, and needs to have a ConsortiumsConfig.

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

func (i *InactiveChainReplicator) Close()

func (*InactiveChainReplicator) Run

func (i *InactiveChainReplicator) Run()

func (*InactiveChainReplicator) Stop

func (i *InactiveChainReplicator) Stop()

Stop stops the inactive chain replicator. This is used when removing the system channel.

func (*InactiveChainReplicator) TrackChain

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

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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