trie_gc

package
v1.2.3-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBKP_CLEARED_HEIGHT  = byte(1)
	DBKP_MARKED_HEIGHT   = byte(2)
	DBKP_MARKED_HASHLIST = byte(3)
)
View Source
const (
	STATUS_STOPPED              = 1
	STATUS_STARTED              = 2
	STATUS_MARKING_AND_CLEANING = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain interface {
	vm_context.Chain

	NewGenesisSnapshotBlock() ledger.SnapshotBlock
	NewSecondSnapshotBlock() ledger.SnapshotBlock
	NewGenesisMintageBlock() (ledger.AccountBlock, vmctxt_interface.VmDatabase)
	NewGenesisMintageSendBlock() (ledger.AccountBlock, vmctxt_interface.VmDatabase)
	NewGenesisConsensusGroupBlock() (ledger.AccountBlock, vmctxt_interface.VmDatabase)
	NewGenesisRegisterBlock() (ledger.AccountBlock, vmctxt_interface.VmDatabase)

	AccountType(address *types.Address) (uint64, error)
	GetLatestBlockEventId() (uint64, error)
	GetEvent(eventId uint64) (byte, []types.Hash, error)
	ChainDb() *chain_db.ChainDb

	TrieDb() *leveldb.DB
	CleanTrieNodePool()
	GenStateTrieFromDb(prevStateHash types.Hash, snapshotContent ledger.SnapshotContent) (*trie.Trie, error)

	IsGenesisSnapshotBlock(block *ledger.SnapshotBlock) bool
	IsGenesisAccountBlock(block *ledger.AccountBlock) bool

	StopSaveTrie()
	StartSaveTrie()
}

type Collector

type Collector interface {
	Start()
	Stop()
	Status() uint8
	Recover() (returnErr error)
}

func NewCollector

func NewCollector(chain Chain, ledgerGcRetain uint64) Collector

type Marker

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

func NewMarker

func NewMarker(chain Chain, retainSnapshotHeight uint64) *Marker

func (*Marker) MarkAndClean

func (m *Marker) MarkAndClean(terminal <-chan struct{}) error

Jump to

Keyboard shortcuts

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