Documentation
¶
Index ¶
- Variables
- type Block
- type Fork
- type Head
- type HistoryProvider
- type Leash
- type Leasher
- type Linkage
- func (l *Linkage) ActiveHeads() ([]Head, error)
- func (l *Linkage) Block(id proto.BlockID) (Block, error)
- func (l *Linkage) Close()
- func (l *Linkage) Fork(peer netip.Addr) (Fork, error)
- func (l *Linkage) Forks(peers []netip.Addr) ([]Fork, error)
- func (l *Linkage) HasBlock(id proto.BlockID) (bool, error)
- func (l *Linkage) HasLeash(addr netip.Addr) (bool, error)
- func (l *Linkage) Heads() ([]Head, error)
- func (l *Linkage) LCB(peer netip.Addr) (proto.BlockID, error)
- func (l *Linkage) LastIDs(id proto.BlockID, count int) ([]proto.BlockID, error)
- func (l *Linkage) Leash(addr netip.Addr) (proto.BlockID, error)
- func (l *Linkage) LeashScore(addr netip.Addr) (*proto.Score, error)
- func (l *Linkage) Leashes() ([]Leash, error)
- func (l *Linkage) LogInitialStats()
- func (l *Linkage) MoveLeash(id proto.BlockID, addr netip.Addr) error
- func (l *Linkage) PutBlock(block *proto.Block, addr netip.Addr) error
- func (l *Linkage) PutMicroBlock(inv *proto.MicroBlockInv, addr netip.Addr) error
- func (l *Linkage) Stats() (Stats, error)
- type Stats
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrParentNotFound = fmt.Errorf("parent not found") ErrRefNotFound = fmt.Errorf("reference block not found") )
Functions ¶
This section is empty.
Types ¶
type Fork ¶
type Fork struct { Longest bool `json:"longest"` // Indicates that the fork is the longest. HeadBlock proto.BlockID `json:"head_block"` // The last block of the fork. HeadTimestamp time.Time `json:"head_timestamp"` // The timestamp of the last block of the fork. HeadGenerator proto.WavesAddress `json:"head_generator"` // The generator of the last block of the fork. HeadHeight uint32 `json:"head_height"` // The height of the last block of the fork. Score *big.Int `json:"score"` // The score of the fork. PeersCount int `json:"peers_count"` // The number of peers that seen the fork. Peers []netip.Addr `json:"peers"` // Peers that seen on the fork. LastCommonBlock proto.BlockID `json:"last_common_block"` // The last common block with the longest fork. Length int `json:"length"` // The number of blocks since the last common block. }
type HistoryProvider ¶
type Linkage ¶
type Linkage struct {
// contains filtered or unexported fields
}
func NewLinkage ¶
func (*Linkage) ActiveHeads ¶
ActiveHeads returns list of heads pointed by peers.
func (*Linkage) LCB ¶ added in v0.3.2
LCB returns the last common block with the longest chain. For the unleashed peer the genesis block ID is returned.
func (*Linkage) Leash ¶
Leash return the block ID the peer is leashed to. For an unleashed peer the genesis block ID is returned.
func (*Linkage) LeashScore ¶
LeashScore returns the score of the peer's leash. For an unleashed peer the score of genesis block is returned. Error indicates a general storage failure.
func (*Linkage) LogInitialStats ¶
func (l *Linkage) LogInitialStats()
func (*Linkage) PutMicroBlock ¶
Click to show internal directories.
Click to hide internal directories.