lead

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecWithRetry

func ExecWithRetry(f func() error) error

Types

type Client

type Client struct {
	Config    config.Shard
	Client    cluster_pb.ClusterClient
	Connected bool
}

type Node

type Node struct {
	Off      bool
	Peer     *peer.Peer
	NewBlock chan *dbi.Block
	SyncDone chan struct{}
	Verbose  bool
}

func NewNode

func NewNode() *Node

func (*Node) GetBlock

func (n *Node) GetBlock(heightBack int64) (*chainhash.Hash, error)

func (*Node) SaveBlock

func (n *Node) SaveBlock(dbi.BlockInfo) error

func (*Node) SaveTxs

func (n *Node) SaveTxs(ctx context.Context, b *dbi.Block) error

func (*Node) Start

func (n *Node) Start(memPool, syncDone bool)

func (*Node) Stop

func (n *Node) Stop()

type Processor

type Processor struct {
	Clients     map[int]*Client
	ErrorChan   chan error
	BlockNode   *Node
	MemPoolNode *Node
	Verbose     bool
	Synced      bool
}

func NewProcessor

func NewProcessor(verbose bool) *Processor

func (*Processor) ProcessBlock

func (p *Processor) ProcessBlock(block *dbi.Block, loc string) bool

func (*Processor) Run

func (p *Processor) Run() error

func (*Processor) SaveBlockShards

func (p *Processor) SaveBlockShards(height int64, seen time.Time, shardBlocks map[uint32]*cluster_pb.Block) bool

type ShardError

type ShardError struct {
	Shard int
	Error error
}

Jump to

Keyboard shortcuts

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