Documentation ¶
Overview ¶
Package fetcher contains the sequencer announcement based synchronisation.
Copyright © 2019 Annchain Authors <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func InitLoggers(logger *logrus.Logger, logdir string)
- type Fetcher
- func (f *Fetcher) Enqueue(peer string, sequencer *types.Sequencer) error
- func (f *Fetcher) FilterBodies(peer string, transactions []types.Txis, sequencers archive.Sequencers, ...) []types.Txis
- func (f *Fetcher) FilterHeaders(peer string, headers dagmessage.SequencerHeaders, time time.Time) []*dagmessage.SequencerHeader
- func (f *Fetcher) Notify(peer string, hash types2.Hash, number uint64, time time.Time, ...) error
- func (f *Fetcher) Start()
- func (f *Fetcher) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLoggers ¶
Types ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher is responsible for accumulating sequencer announcements from various peers and scheduling them for retrieval.
func New ¶
func New(getsequencer sequencerRetrievalFn, chainHeight chainHeightFn, insertChain chainInsertFn, dropPeer peerDropFn) *Fetcher
New creates a sequencer fetcher to retrieve sequencers based on hash announcements.
func (*Fetcher) FilterBodies ¶
func (f *Fetcher) FilterBodies(peer string, transactions []types.Txis, sequencers archive.Sequencers, time time.Time) []types.Txis
FilterBodies extracts all the sequencer bodies that were explicitly requested by the fetcher, returning those that should be handled differently.
func (*Fetcher) FilterHeaders ¶
func (f *Fetcher) FilterHeaders(peer string, headers dagmessage.SequencerHeaders, time time.Time) []*dagmessage.SequencerHeader
FilterHeaders extracts all the headers that were explicitly requested by the fetcher, returning those that should be handled differently.
func (*Fetcher) Notify ¶
func (f *Fetcher) Notify(peer string, hash types2.Hash, number uint64, time time.Time, headerFetcher headerRequesterFn, bodyFetcher bodyRequesterFn) error
Notify announces the fetcher of the potential availability of a new sequencer in the network.