unverifiedblockstore

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnverifiedBlockStore

type UnverifiedBlockStore struct {
	// contains filtered or unexported fields
}

UnverifiedBlockStore holds an in memory cache of receied blocks from the network that have not been verified to be part of a traversal

func New

New initializes a new unverified store with the given storer function for writing to permaneant storage if the block is verified

func (*UnverifiedBlockStore) AddUnverifiedBlock

func (ubs *UnverifiedBlockStore) AddUnverifiedBlock(traceLink trace.Link, lnk ipld.Link, data []byte)

AddUnverifiedBlock adds a new unverified block to the in memory cache as it comes in as part of a traversal.

func (*UnverifiedBlockStore) PruneBlock added in v0.3.0

func (ubs *UnverifiedBlockStore) PruneBlock(link ipld.Link)

PruneBlock deletes an individual block from the store

func (*UnverifiedBlockStore) PruneBlocks

func (ubs *UnverifiedBlockStore) PruneBlocks(shouldPrune func(ipld.Link, uint64) bool)

PruneBlocks removes blocks from the unverified store without committing them, if the passed in function returns true for the given link

func (*UnverifiedBlockStore) VerifyBlock

func (ubs *UnverifiedBlockStore) VerifyBlock(lnk ipld.Link, linkContext ipld.LinkContext) ([]byte, error)

VerifyBlock verifies the data for the given link as being part of a traversal, removes it from the unverified store, and writes it to permaneant storage.

Jump to

Keyboard shortcuts

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