Documentation ¶
Index ¶
- type BlockEligibilityValidatorMock
- type BlockListener
- type Configuration
- type MeshValidatorMock
- func (m *MeshValidatorMock) ContextualValidity(id types.BlockID) bool
- func (m *MeshValidatorMock) GetGoodPatternBlocks(layer types.LayerID) (map[types.BlockID]struct{}, error)
- func (m *MeshValidatorMock) HandleIncomingLayer(lyr *types.Layer) (types.LayerID, types.LayerID)
- func (m *MeshValidatorMock) HandleLateBlock(bl *types.Block) (types.LayerID, types.LayerID)
- func (m *MeshValidatorMock) LatestComplete() types.LayerID
- func (m *MeshValidatorMock) PersistTortoise() error
- func (m *MeshValidatorMock) RegisterLayerCallback(func(id types.LayerID))
- type MockClock
- type MockIStore
- type MockState
- func (MockState) AddressExists(addr types.Address) bool
- func (MockState) ApplyRewards(layer types.LayerID, miners []types.Address, reward *big.Int)
- func (MockState) ApplyTransactions(layer types.LayerID, txs []*types.Transaction) (int, error)
- func (MockState) GetLayerApplied(txID types.TransactionId) *types.LayerID
- func (s MockState) GetStateRoot() types.Hash32
- func (s MockState) LoadState(layer types.LayerID) error
- func (MockState) ValidateNonceAndBalance(transaction *types.Transaction) error
- func (MockState) ValidateSignature(signed types.Signed) (types.Address, error)
- type Syncer
- func (s *Syncer) Await() chan struct{}
- func (s *Syncer) Close()
- func (s *Syncer) FetchPoetProof(poetProofRef []byte) error
- func (s *Syncer) ForceSync()
- func (ms Syncer) GetExit() chan struct{}
- func (ms Syncer) GetTimeout() time.Duration
- func (s *Syncer) IsSynced() bool
- func (s *Syncer) ListenToGossip() bool
- func (s *Syncer) Start()
- type ValidatorMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockEligibilityValidatorMock ¶
type BlockEligibilityValidatorMock struct { }
func (BlockEligibilityValidatorMock) BlockSignedAndEligible ¶
func (BlockEligibilityValidatorMock) BlockSignedAndEligible(block *types.Block) (bool, error)
type BlockListener ¶
BlockListener Listens to blocks propagated in gossip
func NewBlockListener ¶
func NewBlockListener(net service.Service, sync *Syncer, concurrency int, logger log.Log) *BlockListener
NewBlockListener creates a new instance of BlockListener
func (BlockListener) GetTimeout ¶
func (*BlockListener) Start ¶
func (bl *BlockListener) Start()
Start starts the main listening goroutine
type Configuration ¶
type Configuration struct { LayersPerEpoch uint16 Concurrency int //number of workers for sync method LayerSize int RequestTimeout time.Duration SyncInterval time.Duration ValidationDelta time.Duration AtxsLimit int Hdist int }
Configuration represents all config params needed by syncer
type MeshValidatorMock ¶
type MeshValidatorMock struct {
// contains filtered or unexported fields
}
func (*MeshValidatorMock) ContextualValidity ¶
func (m *MeshValidatorMock) ContextualValidity(id types.BlockID) bool
func (*MeshValidatorMock) GetGoodPatternBlocks ¶
func (*MeshValidatorMock) HandleIncomingLayer ¶
func (*MeshValidatorMock) HandleLateBlock ¶
func (*MeshValidatorMock) LatestComplete ¶
func (m *MeshValidatorMock) LatestComplete() types.LayerID
func (*MeshValidatorMock) PersistTortoise ¶
func (m *MeshValidatorMock) PersistTortoise() error
func (*MeshValidatorMock) RegisterLayerCallback ¶
func (m *MeshValidatorMock) RegisterLayerCallback(func(id types.LayerID))
type MockClock ¶
type MockClock struct { Interval duration.Duration Layer types.LayerID // contains filtered or unexported fields }
func (*MockClock) GetCurrentLayer ¶
func (*MockClock) LayerToTime ¶ added in v0.1.6
func (*MockClock) Subscribe ¶
func (m *MockClock) Subscribe() timesync.LayerTimer
func (*MockClock) Unsubscribe ¶
func (m *MockClock) Unsubscribe(timer timesync.LayerTimer)
type MockIStore ¶
type MockIStore struct { }
func (*MockIStore) GetIdentity ¶
func (*MockIStore) GetIdentity(id string) (types.NodeId, error)
func (*MockIStore) StoreNodeIdentity ¶
func (*MockIStore) StoreNodeIdentity(id types.NodeId) error
type MockState ¶
type MockState struct{}
func (MockState) ApplyRewards ¶
func (MockState) ApplyTransactions ¶
func (MockState) GetLayerApplied ¶
func (MockState) GetLayerApplied(txID types.TransactionId) *types.LayerID
func (MockState) GetStateRoot ¶
func (MockState) ValidateNonceAndBalance ¶
func (MockState) ValidateNonceAndBalance(transaction *types.Transaction) error
type Syncer ¶
type Syncer struct { log.Log Configuration *mesh.Mesh // contains filtered or unexported fields }
Syncer is used to sync the node with the network periodically the Syncer will check if the node is synced with the rest of the network and will follow the sync protocol in order to fetch all missing data and become synced again
func NewSync ¶
func NewSync(srv service.Service, layers *mesh.Mesh, txpool txMemPool, atxpool atxMemPool, bv blockEligibilityValidator, poetdb poetDb, conf Configuration, clock ticker, logger log.Log) *Syncer
NewSync fires a sync every sm.SyncInterval or on force space from outside
func (*Syncer) Await ¶
func (s *Syncer) Await() chan struct{}
Await returns a channel that blocks until the node is synced
func (*Syncer) FetchPoetProof ¶
FetchPoetProof fetches a poet proof from network peers
func (*Syncer) ForceSync ¶
func (s *Syncer) ForceSync()
ForceSync signals syncer to run the synchronise flow
func (Syncer) GetTimeout ¶
func (*Syncer) ListenToGossip ¶
ListenToGossip enables other modules to check if they should listen to gossip
type ValidatorMock ¶
type ValidatorMock struct{}