onboarding

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 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 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 (*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)

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