remotedb

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package remotedb implements the key-value database layer based on a remote geth node. Under the hood, it utilises the `debug_dbGet` method to implement a read-only database. There really are no guarantees in this database, since the local geth does not exclusive access, but it can be used for basic diagnostics of a remote node.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(client *rpc.Client) ethdb.Database

Types

type Database

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

Database is a key-value lookup for a remote database via debug_dbGet.

func (*Database) Ancient

func (db *Database) Ancient(kind string, number uint64) ([]byte, error)

func (*Database) AncientDatadir

func (db *Database) AncientDatadir() (string, error)

func (*Database) AncientOffSet

func (db *Database) AncientOffSet() uint64

func (*Database) AncientRange

func (db *Database) AncientRange(kind string, start, count, maxBytes uint64) ([][]byte, error)

func (*Database) AncientReset

func (db *Database) AncientReset(tail, head uint64) error

func (*Database) AncientSize

func (db *Database) AncientSize(kind string) (uint64, error)

func (*Database) Ancients

func (db *Database) Ancients() (uint64, error)

func (*Database) BlockStore

func (db *Database) BlockStore() ethdb.Database

func (*Database) BlockStoreReader

func (db *Database) BlockStoreReader() ethdb.Reader

func (*Database) Close

func (db *Database) Close() error

func (*Database) Compact

func (db *Database) Compact(start []byte, limit []byte) error

func (*Database) Delete

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

func (*Database) DeleteRange

func (db *Database) DeleteRange(start, end []byte) error

func (*Database) DiffStore

func (db *Database) DiffStore() ethdb.KeyValueStore

func (*Database) Get

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

func (*Database) GetStateStore

func (db *Database) GetStateStore() ethdb.Database

func (*Database) Has

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

func (*Database) HasAncient

func (db *Database) HasAncient(kind string, number uint64) (bool, error)

func (*Database) HasSeparateBlockStore

func (db *Database) HasSeparateBlockStore() bool

func (*Database) ItemAmountInAncient

func (db *Database) ItemAmountInAncient() (uint64, error)

func (*Database) ModifyAncients

func (db *Database) ModifyAncients(f func(ethdb.AncientWriteOp) error) (int64, error)

func (*Database) NewBatch

func (db *Database) NewBatch() ethdb.Batch

func (*Database) NewBatchWithSize

func (db *Database) NewBatchWithSize(size int) ethdb.Batch

func (*Database) NewIterator

func (db *Database) NewIterator(prefix []byte, start []byte) ethdb.Iterator

func (*Database) Put

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

func (*Database) ReadAncients

func (db *Database) ReadAncients(fn func(op ethdb.AncientReaderOp) error) (err error)

func (*Database) ResetTable

func (db *Database) ResetTable(kind string, startAt uint64, onlyEmpty bool) error

ResetTable will reset certain table with new start point

func (*Database) SetBlockStore

func (db *Database) SetBlockStore(block ethdb.Database)

func (*Database) SetDiffStore

func (db *Database) SetDiffStore(diff ethdb.KeyValueStore)

func (*Database) SetStateStore

func (db *Database) SetStateStore(state ethdb.Database)

func (*Database) SetupFreezerEnv

func (db *Database) SetupFreezerEnv(env *ethdb.FreezerEnv) error

func (*Database) Stat

func (db *Database) Stat() (string, error)

func (*Database) StateStore

func (db *Database) StateStore() ethdb.Database

func (*Database) StateStoreReader

func (db *Database) StateStoreReader() ethdb.Reader

func (*Database) SyncAncient

func (db *Database) SyncAncient() error

func (*Database) SyncKeyValue

func (db *Database) SyncKeyValue() error

func (*Database) Tail

func (db *Database) Tail() (uint64, error)

func (*Database) TruncateHead

func (db *Database) TruncateHead(n uint64) (uint64, error)

func (*Database) TruncateTableTail

func (db *Database) TruncateTableTail(kind string, tail uint64) (uint64, error)

TruncateTableTail will truncate certain table to new tail

func (*Database) TruncateTail

func (db *Database) TruncateTail(n uint64) (uint64, error)

Jump to

Keyboard shortcuts

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