syncstrategy

package
v0.0.0-...-667e438 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Applier

type Applier interface {
	Blocks(context.Context) error
	Full(context.Context) error
}

any strategy applier has two simple entrances: one for blocks only and another for blocks and the full world-state, by anymeans except for executing txs in blocks (e.g. sync state directly or statedelta) each method will just block until the process finish strategy may left partial syncing results after encounter any error

type StateTransfer

type StateTransfer interface {
	Start() // Start the block transfer go routine
	Stop()  // Stop up the block transfer go routine

	// SyncToTarget attempts to move the state to the given target, returning an error, and whether this target might succeed if attempted at a later time
	SyncToTarget(blockNumber uint64, blockHash []byte, peerIDs []*pb.PeerID) (error, bool)
}

type SyncEntry

type SyncEntry struct {
	// contains filtered or unexported fields
}

func GetSyncStrategyEntry

func GetSyncStrategyEntry(sstub *pb.StreamStub) *SyncEntry

func (*SyncEntry) Configure

func (se *SyncEntry) Configure(vp *viper.Viper) error

func (*SyncEntry) FromTopStrategy

func (se *SyncEntry) FromTopStrategy(l *ledger.Ledger, h uint64, blockh []byte) *syncStrategyFromTop

func (*SyncEntry) Start

func (*SyncEntry) Start()

func (*SyncEntry) Stop

func (*SyncEntry) Stop()

func (*SyncEntry) SyncToTarget

func (*SyncEntry) SyncToTarget(blockNumber uint64, blockHash []byte, peerIDs []*pb.PeerID) (error, bool)

func (*SyncEntry) SyncTransactions

func (se *SyncEntry) SyncTransactions(ctx context.Context, txids []string) ([]*pb.Transaction, []string)

a base implement, should have no alter way...

Jump to

Keyboard shortcuts

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