Documentation ¶
Overview ¶
Package layerfetcher fetches layers from remote peers
Index ¶
- Constants
- type Config
- type Future
- type LayerPromiseResult
- type Logic
- func (l *Logic) FetchAtx(id types.ATXID) error
- func (l *Logic) FetchBlock(id types.BlockID) error
- func (l *Logic) FetchFlow()
- func (l *Logic) GetAtxs(IDs []types.ATXID) error
- func (l *Logic) GetBlocks(IDs []types.BlockID) error
- func (l *Logic) GetEpochATXs(id types.EpochID) error
- func (l *Logic) GetPoetProof(id types.Hash32) error
- func (l *Logic) GetTxs(IDs []types.TransactionID) error
- func (l *Logic) IsSynced() bool
- func (l *Logic) LayerHashBlocksReceiver(msg []byte) []byte
- func (l *Logic) LayerHashReqReceiver(msg []byte) []byte
- func (l *Logic) ListenToGossip() bool
- func (l *Logic) PollLayer(layer types.LayerID) chan LayerPromiseResult
Constants ¶
const ( BlockDB = 1 LayerBlocksDB = 2 ATXDB = 3 TXDB = 4 POETDB = 5 LayerHashDB = 6 ATXIDsDB = 7 )
DB hints per DB
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
RequestTimeout int
}
Config defines configuration for layer fetching logic
type Future ¶
type Future struct {
// contains filtered or unexported fields
}
Future is a preparation for using actual futures in the code, this will allow to truly execute asynchronous reads and receive result only when needed
type LayerPromiseResult ¶
LayerPromiseResult is the result of trying to fetch an entire layer- if this fails the error will be added to result
type Logic ¶
type Logic struct {
// contains filtered or unexported fields
}
Logic is the struct containing components needed to follow layer fetching logic
func NewLogic ¶
func NewLogic(cfg Config, blocks blockHandler, atxs atxHandler, poet poetDb, network service.Service, fetcher fetch.Fetcher, log log.Log) *Logic
NewLogic creates a new instance of layer fetching logic
func (*Logic) FetchBlock ¶
FetchBlock gets data for a single block id and validates it
func (*Logic) GetAtxs ¶
GetAtxs gets the data for given atx ids IDs and validates them. returns an error if at least one ATX cannot be fetched
func (*Logic) GetBlocks ¶
GetBlocks gets the data for given block ids and validates the blocks. returns an error if a single atx failed to be fetched or validated
func (*Logic) GetEpochATXs ¶
GetEpochATXs fetches all atxs received by peer for given layer
func (*Logic) GetPoetProof ¶
GetPoetProof gets poet proof from remote peer
func (*Logic) GetTxs ¶
func (l *Logic) GetTxs(IDs []types.TransactionID) error
GetTxs fetches the txs provided as IDs and validates them, returns an error if one TX failed to be fetched
func (*Logic) LayerHashBlocksReceiver ¶
LayerHashBlocksReceiver returns the block IDs for the specified layer hash, it also returns the validation vector for this hash and latest blocks received in gossip
func (*Logic) LayerHashReqReceiver ¶
LayerHashReqReceiver returns the layer hash for the given layer ID
func (*Logic) ListenToGossip ¶
ListenToGossip indicates if node is currently accepting packets from gossip