update

package
v1.0.106 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrContainerKeyAlreadyExists = errors.New("provided key already exists in container")

ErrContainerKeyAlreadyExists signals that an element was already set in the container's map

View Source
var ErrEndOfFile = errors.New("end of file")

ErrEndOfFile signals that end of file was reached

View Source
var ErrHashMissmatch = errors.New("hash missmatch")

ErrHashMissmatch signals that received hash is not equal with processed one

View Source
var ErrIncorrectHardforkMessage = errors.New("incorrect hardfork message")

ErrIncorrectHardforkMessage signals that the hardfork message is incorrectly formatted

View Source
var ErrInvalidContainerKey = errors.New("element does not exist in container")

ErrInvalidContainerKey signals that an element does not exist in the container's map

View Source
var ErrInvalidFolderName = errors.New("invalid folder name")

ErrInvalidFolderName signals that folder name is nil

View Source
var ErrInvalidValue = errors.New("invalid value")

ErrInvalidValue signals that the value provided is invalid

View Source
var ErrInvalidWaitTime = errors.New("invalid wait time")

ErrInvalidWaitTime signals that nil provided wait time is invalid

View Source
var ErrLenMismatch = errors.New("lengths mismatch")

ErrLenMismatch signals that 2 or more slices have different lengths

View Source
var ErrNilAccounts = errors.New("nil accounts")

ErrNilAccounts signals that nil accounts was provided

View Source
var ErrNilAccountsDBSyncContainer = errors.New("nil accounts db sync container")

ErrNilAccountsDBSyncContainer signals that nil accounts sync container was provided

View Source
var ErrNilAntiFloodHandler = errors.New("nil anti flood handler")

ErrNilAntiFloodHandler signals that nil anti flood handler has been provided

View Source
var ErrNilBlockKeyGen = errors.New("nil block key gen")

ErrNilBlockKeyGen signals that nil block key gen was provided

View Source
var ErrNilBlockSigner = errors.New("nil block signer")

ErrNilBlockSigner signals the nil block signer was provided

View Source
var ErrNilCacher = errors.New("nil cacher")

ErrNilCacher signals that nil cacher was provided

View Source
var ErrNilContainerElement = errors.New("element cannot be nil")

ErrNilContainerElement signals when trying to add a nil element in the container

View Source
var ErrNilDataPoolHolder = errors.New("nil data pool holder")

ErrNilDataPoolHolder signals that the data pool holder is nil

View Source
var ErrNilDataReader = errors.New("nil data reader")

ErrNilDataReader signals that data reader is nil

View Source
var ErrNilDataTrieContainer = errors.New("nil data trie container")

ErrNilDataTrieContainer signals that data trie container is nil

View Source
var ErrNilDataWriter = errors.New("nil data writer")

ErrNilDataWriter signals that data writer is nil

View Source
var ErrNilEpochHandler = errors.New("nil epoch handler")

ErrNilEpochHandler signals that nil epoch handler was provided

View Source
var ErrNilHandler = errors.New("nil handler")

ErrNilHandler signals that a nil trigger handler was provided

View Source
var ErrNilHasher = errors.New("nil Hasher")

ErrNilHasher signals that an operation has been attempted to or with a nil hasher implementation

View Source
var ErrNilHeaderSigVerifier = errors.New("nil header sig verifier")

ErrNilHeaderSigVerifier signals that nil header sig verifier was provided

View Source
var ErrNilHeaderSyncHandler = errors.New("nil header sync handler")

ErrNilHeaderSyncHandler signals that nil header sync handler was provided

View Source
var ErrNilHeaderValidator = errors.New("nil header validator")

ErrNilHeaderValidator signals that nil header validator has been provided

View Source
var ErrNilInterceptorsContainer = errors.New("nil interceptors container")

ErrNilInterceptorsContainer signals that a nil interceptors container has been provided

View Source
var ErrNilKeyGenerator = errors.New("nil key generator")

ErrNilKeyGenerator signals that nil key generator was provided

View Source
var ErrNilMarshalizer = errors.New("nil Marshalizer")

ErrNilMarshalizer signals that an operation has been attempted to or with a nil Marshalizer implementation

View Source
var ErrNilMessenger = errors.New("nil Messenger")

ErrNilMessenger signals that a nil Messenger object was provided

View Source
var ErrNilMiniBlocksSyncHandler = errors.New("nil miniblocks sync handler")

ErrNilMiniBlocksSyncHandler signals that nil miniblocks sync handler was provided

View Source
var ErrNilMultiFileReader = errors.New("nil multi file reader")

ErrNilMultiFileReader signals that nil multi file reader was provided

View Source
var ErrNilMultiSigner = errors.New("nil multi signer")

ErrNilMultiSigner signals that nil multi signer was provided

View Source
var ErrNilNodesCoordinator = errors.New("nil nodes coordinator")

ErrNilNodesCoordinator signals that nil nodes coordinator was provided

View Source
var ErrNilPubkeyConverter = errors.New("nil public key converter")

ErrNilPubkeyConverter signals that a nil public key converter was provided

View Source
var ErrNilRequestHandler = errors.New("nil request handler")

ErrNilRequestHandler signals that a nil request handler interface was provided

View Source
var ErrNilResolverContainer = errors.New("nil resolver container")

ErrNilResolverContainer signals that a nil resolver container was provided

View Source
var ErrNilShardCoordinator = errors.New("nil shard coordinator")

ErrNilShardCoordinator signals that an operation has been attempted to or with a nil shard coordinator

View Source
var ErrNilSingleSigner = errors.New("nil single signer")

ErrNilSingleSigner signals that nil single signer was provided

View Source
var ErrNilStateSyncer = errors.New("nil state syncer")

ErrNilStateSyncer signals that state syncer is nil

View Source
var ErrNilStorage = errors.New("nil storage")

ErrNilStorage signals that storage is nil

View Source
var ErrNilStorageManager = errors.New("nil trie storage manager")

ErrNilStorageManager signals that nil storage manager has been provided

View Source
var ErrNilTransactionsSyncHandler = errors.New("nil transaction sync handler")

ErrNilTransactionsSyncHandler signals that nil transactions sync handler was provided

View Source
var ErrNilTrieDataGetter = errors.New("nil trie data getter provided")

ErrNilTrieDataGetter signals that a nil trie data getter has been provided

View Source
var ErrNilTrieSyncers = errors.New("nil trie syncers")

ErrNilTrieSyncers signals that trie syncers container is nil

View Source
var ErrNilUint64Converter = errors.New("unit64converter is nil")

ErrNilUint64Converter signals that uint64converter is nil

View Source
var ErrNilValidityAttester = errors.New("nil validity attester")

ErrNilValidityAttester signals that nil validity was provided

View Source
var ErrNilWhiteListHandler = errors.New("nil white list handler")

ErrNilWhiteListHandler signals that white list handler is nil

View Source
var ErrNoFileToImport = errors.New("no files to import")

ErrNoFileToImport signals that there are no files to import

View Source
var ErrNotEpochStartBlock = errors.New("not epoch start block")

ErrNotEpochStartBlock signals that block is not of type epoch start

View Source
var ErrNotSynced = errors.New("not synced")

ErrNotSynced signals that syncing has not been finished yet

View Source
var ErrTimeIsOut = errors.New("time is out")

ErrTimeIsOut signals that time is out

View Source
var ErrTriggerNotEnabled = errors.New("trigger is not enabled")

ErrTriggerNotEnabled signals that the trigger is not enabled

View Source
var ErrTriggerPubKeyMismatch = errors.New("trigger public key mismatch")

ErrTriggerPubKeyMismatch signals that there is a mismatch between the public key received and the one read from the config

View Source
var ErrUnknownType = errors.New("unknown type")

ErrUnknownType signals that type is unknown

View Source
var ErrWrongTypeAssertion = errors.New("wrong type assertion")

ErrWrongTypeAssertion signals wrong type assertion

View Source
var ErrWrongTypeInContainer = errors.New("wrong type of object inside container")

ErrWrongTypeInContainer signals that a wrong type of object was found in container

View Source
var ErrWrongUnfinishedMetaHdrsMap = errors.New("wrong unfinished meta headers map")

ErrWrongUnfinishedMetaHdrsMap signals that wrong unfinished meta headers map was provided

Functions

This section is empty.

Types

type AccountsDBSyncContainer

type AccountsDBSyncContainer interface {
	Get(key string) (AccountsDBSyncer, error)
	Add(key string, val AccountsDBSyncer) error
	AddMultiple(keys []string, values []AccountsDBSyncer) error
	Replace(key string, val AccountsDBSyncer) error
	Remove(key string)
	Len() int
	IsInterfaceNil() bool
}

AccountsDBSyncContainer keep a list of TrieSyncer

type AccountsDBSyncer

type AccountsDBSyncer interface {
	GetSyncedTries() map[string]data.Trie
	SyncAccounts(rootHash []byte) error
	IsInterfaceNil() bool
}

AccountsDBSyncer defines the methods for the accounts db syncer

type DataReader

type DataReader interface {
	Text() string
	Scan() bool
	Err() error
}

DataReader defines the methods to read data

type DataWriter

type DataWriter interface {
	WriteString(s string) (int, error)
	Flush() error
}

DataWriter defines the methods to write data

type EpochStartPendingMiniBlocksSyncHandler

type EpochStartPendingMiniBlocksSyncHandler interface {
	SyncPendingMiniBlocksFromMeta(epochStart *block.MetaBlock, unFinished map[string]*block.MetaBlock, ctx context.Context) error
	GetMiniBlocks() (map[string]*block.MiniBlock, error)
	IsInterfaceNil() bool
}

EpochStartPendingMiniBlocksSyncHandler defines the methods to sync all pending miniblocks

type EpochStartTriesSyncHandler

type EpochStartTriesSyncHandler interface {
	SyncTriesFrom(meta *block.MetaBlock, waitTime time.Duration) error
	GetTries() (map[string]data.Trie, error)
	IsInterfaceNil() bool
}

EpochStartTriesSyncHandler defines the methods to sync all tries from a given epoch start metablock

type EpochStartVerifier

type EpochStartVerifier interface {
	IsEpochStart() bool
	Epoch() uint32
	EpochStartMetaHdrHash() []byte
	IsInterfaceNil() bool
}

EpochStartVerifier defines the functionality needed by sync all state from epochTrigger

type ExportHandler

type ExportHandler interface {
	ExportAll(epoch uint32) error
	IsInterfaceNil() bool
}

ExportHandler defines the methods to export the current state of the blockchain

type HeaderSyncHandler

type HeaderSyncHandler interface {
	SyncUnFinishedMetaHeaders(epoch uint32) error
	GetEpochStartMetaBlock() (*block.MetaBlock, error)
	GetUnfinishedMetaBlocks() (map[string]*block.MetaBlock, error)
	IsInterfaceNil() bool
}

HeaderSyncHandler defines the methods to sync and get the epoch start metablock

type HistoryStorer

type HistoryStorer interface {
	Put(key, data []byte) error
	Get(key []byte) ([]byte, error)
	Has(key []byte) error
	Remove(key []byte) error
	ClearCache()
	DestroyUnit() error
	GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
	HasInEpoch(key []byte, epoch uint32) error

	IsInterfaceNil() bool
}

HistoryStorer provides storage services in a two layered storage construct, where the first layer is represented by a cache and second layer by a persitent storage (DB-like)

type ImportHandler

type ImportHandler interface {
	ImportAll() error
	GetAllGenesisBlocks() map[uint32]data.HeaderHandler
	IsInterfaceNil() bool
}

ImportHandler defines the methods to import the full state of the blockchain

type MissingHeadersByHashSyncer

type MissingHeadersByHashSyncer interface {
	SyncMissingHeadersByHash(shardIDs []uint32, headersHashes [][]byte, ctx context.Context) error
	GetHeaders() (map[string]data.HeaderHandler, error)
	ClearFields()
	IsInterfaceNil() bool
}

MissingHeadersByHashSyncer defines the methods to sync all missing headers by hash

type MultiFileReader

type MultiFileReader interface {
	GetFileNames() []string
	ReadNextItem(fileName string) (string, []byte, error)
	Finish()
	IsInterfaceNil() bool
}

MultiFileReader reads data from several files in a buffered way

type MultiFileWriter

type MultiFileWriter interface {
	NewFile(name string) error
	Write(fileName string, key string, value []byte) error
	Finish()
	IsInterfaceNil() bool
}

MultiFileWriter writes several files in a buffered manner

type PendingTransactionsSyncHandler

type PendingTransactionsSyncHandler interface {
	SyncPendingTransactionsFor(miniBlocks map[string]*block.MiniBlock, epoch uint32, ctx context.Context) error
	GetTransactions() (map[string]data.TransactionHandler, error)
	IsInterfaceNil() bool
}

PendingTransactionsSyncHandler defines the methods to sync all transactions from a set of miniblocks

type RequestHandler

type RequestHandler interface {
	RequestTransaction(shardId uint32, txHashes [][]byte)
	RequestUnsignedTransactions(destShardID uint32, scrHashes [][]byte)
	RequestRewardTransactions(destShardID uint32, txHashes [][]byte)
	RequestMiniBlock(shardId uint32, miniblockHash []byte)
	RequestStartOfEpochMetaBlock(epoch uint32)
	RequestShardHeader(shardId uint32, hash []byte)
	RequestMetaHeader(hash []byte)
	RequestMetaHeaderByNonce(nonce uint64)
	RequestShardHeaderByNonce(shardId uint32, nonce uint64)
	RequestTrieNodes(destShardID uint32, hash []byte, topic string)
	RequestInterval() time.Duration
	SetNumPeersToQuery(key string, intra int, cross int) error
	GetNumPeersToQuery(key string) (int, int, error)
	IsInterfaceNil() bool
}

RequestHandler defines the methods through which request to data can be made

type SigVerifier

type SigVerifier interface {
	Verify(message []byte, sig []byte, pk []byte) error
	IsInterfaceNil() bool
}

SigVerifier is used to verify the signature on a provided message

type StateSyncer

type StateSyncer interface {
	GetEpochStartMetaBlock() (*block.MetaBlock, error)
	GetUnfinishedMetaBlocks() (map[string]*block.MetaBlock, error)
	SyncAllState(epoch uint32) error
	GetAllTries() (map[string]data.Trie, error)
	GetAllTransactions() (map[string]data.TransactionHandler, error)
	GetAllMiniBlocks() (map[string]*block.MiniBlock, error)
	IsInterfaceNil() bool
}

StateSyncer interface defines the methods needed to sync and get all states

type TrieSyncContainer

type TrieSyncContainer interface {
	Get(key string) (TrieSyncer, error)
	Add(key string, val TrieSyncer) error
	AddMultiple(keys []string, interceptors []TrieSyncer) error
	Replace(key string, val TrieSyncer) error
	Remove(key string)
	Len() int
	IsInterfaceNil() bool
}

TrieSyncContainer keep a list of TrieSyncer

type TrieSyncer

type TrieSyncer interface {
	StartSyncing(rootHash []byte, ctx context.Context) error
	Trie() data.Trie
	IsInterfaceNil() bool
}

TrieSyncer synchronizes the trie, asking on the network for the missing nodes

type WhiteListHandler

type WhiteListHandler interface {
	Remove(keys [][]byte)
	Add(keys [][]byte)
	IsWhiteListed(interceptedData process.InterceptedData) bool
	IsInterfaceNil() bool
}

WhiteListHandler is the interface needed to add whitelisted data

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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