public

package
v2.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Normal = iota
	DiscTooManyPeers
	DownloaderCall
	ServerSimpleCall
	ServerSignedCall
	FetcherSyncCall
	FetcherHeadCall
	FetcherKnownCall
	FetcherTimerCall
	FetcherDeliverCall
	FetcherAnnounceCall
	FetcherFastTimerCall
	SyncValidateCall
	SyncCheckpointCall
	FreeRegisterCall
	DropClientCall

	FruitHead = iota + 1
	Fruit
)

Variables

View Source
var (
	// DefaultServerIndexerConfig wraps a set of configs as a default indexer config for server side.
	DefaultServerIndexerConfig = &IndexerConfig{
		ChtSize:           params.CHTFrequency,
		ChtConfirms:       params.HelperTrieProcessConfirmations,
		BloomSize:         params.BloomBitsBlocks,
		BloomConfirms:     params.BloomConfirms,
		BloomTrieSize:     params.BloomTrieFrequency,
		BloomTrieConfirms: params.HelperTrieProcessConfirmations,
	}
	// DefaultClientIndexerConfig wraps a set of configs as a default indexer config for client side.
	DefaultClientIndexerConfig = &IndexerConfig{
		ChtSize:           params.CHTFrequency,
		ChtConfirms:       params.HelperTrieConfirmations,
		BloomSize:         params.BloomBitsBlocksClient,
		BloomConfirms:     params.HelperTrieConfirmations,
		BloomTrieSize:     params.BloomTrieFrequency,
		BloomTrieConfirms: params.HelperTrieConfirmations,
	}
	// TestServerIndexerConfig wraps a set of configs as a test indexer config for server side.
	TestServerIndexerConfig = &IndexerConfig{
		ChtSize:           512,
		ChtConfirms:       4,
		BloomSize:         64,
		BloomConfirms:     4,
		BloomTrieSize:     512,
		BloomTrieConfirms: 4,
	}
	// TestClientIndexerConfig wraps a set of configs as a test indexer config for client side.
	TestClientIndexerConfig = &IndexerConfig{
		ChtSize:           512,
		ChtConfirms:       32,
		BloomSize:         512,
		BloomConfirms:     32,
		BloomTrieSize:     512,
		BloomTrieConfirms: 32,
	}
)

Functions

This section is empty.

Types

type IndexerConfig

type IndexerConfig struct {
	// The block frequency for creating CHTs.
	ChtSize uint64

	// The number of confirmations needed to generate/accept a canonical hash help trie.
	ChtConfirms uint64

	// The block frequency for creating new bloom bits.
	BloomSize uint64

	// The number of confirmation needed before a bloom section is considered probably final and its rotated bits
	// are calculated.
	BloomConfirms uint64

	// The block frequency for creating BloomTrie.
	BloomTrieSize uint64

	// The number of confirmations needed to generate/accept a bloom trie.
	BloomTrieConfirms uint64

	//the cht hash
	Hash common.Hash
}

IndexerConfig includes a set of configs for chain indexers.

func (*IndexerConfig) SetDatasetRoot

func (ic *IndexerConfig) SetDatasetRoot(hash common.Hash)

StoreResult stores the retrieved data in local database

type NodeList

type NodeList []rlp.RawValue

NodeList stores an ordered list of trie nodes. It implements etruedb.Putter.

func (NodeList) DataSize

func (n NodeList) DataSize() int

DataSize returns the aggregated data size of nodes in the list

func (*NodeList) Delete

func (n *NodeList) Delete(key []byte) error

Delete panics as there's no reason to remove a node from the list.

func (NodeList) NodeSet

func (n NodeList) NodeSet() *NodeSet

NodeSet converts the node list to a NodeSet

func (*NodeList) Put

func (n *NodeList) Put(key []byte, value []byte) error

Put stores a new node at the end of the list

func (NodeList) Store

func (n NodeList) Store(db etruedb.Putter)

Store writes the contents of the list to the given database

type NodeSet

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

NodeSet stores a set of trie nodes. It implements trie.Database and can also act as a cache for another trie.Database.

func NewNodeSet

func NewNodeSet() *NodeSet

NewNodeSet creates an empty node set

func (*NodeSet) DataSize

func (db *NodeSet) DataSize() int

DataSize returns the aggregated data size of nodes in the set

func (*NodeSet) Delete

func (db *NodeSet) Delete(key []byte) error

Delete removes a node from the set

func (*NodeSet) Get

func (db *NodeSet) Get(key []byte) ([]byte, error)

Get returns a stored node

func (*NodeSet) Has

func (db *NodeSet) Has(key []byte) (bool, error)

Has returns true if the node set contains the given key

func (*NodeSet) KeyCount

func (db *NodeSet) KeyCount() int

KeyCount returns the number of nodes in the set

func (*NodeSet) NodeList

func (db *NodeSet) NodeList() NodeList

NodeList converts the node set to a NodeList

func (*NodeSet) Put

func (db *NodeSet) Put(key []byte, value []byte) error

Put stores a new node in the set

func (*NodeSet) Store

func (db *NodeSet) Store(target etruedb.Putter)

Store writes the contents of the set to the given database

Jump to

Keyboard shortcuts

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