leveldb_ethdb_rpc

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOGRUS_LEVEL = "LOGRUS_LEVEL"
	LOGRUS_FILE  = "LOGRUS_FILE"

	IPC_ENABLED   = "IPC_ENABLED"
	IPC_ENDPOINT  = "IPC_PATH"
	HTTP_ENABLED  = "HTTP_ENABLED"
	HTTP_ENDPOINT = "HTTP_PATH"

	LEVELDB_PATH         = "LEVELDB_PATH"
	LEVELDB_CACHE_SIZE   = "LEVELDB_CACHE_SIZE"
	LEVELDB_ANCIENT_PATH = "LEVELDB_ANCIENT_PATH"
	LEVELDB_NAMESPACE    = "LEVELDB_NAMESPACE"

	TOML_LOGRUS_LEVEL = "log.level"
	TOML_LOGRUS_FILE  = "log.file"

	TOML_IPC_ENABLED   = "leveldb.ipcEnabled"
	TOML_IPC_ENDPOINT  = "leveldb.ipcPath"
	TOML_HTTP_ENABLED  = "leveldb.httpEnabled"
	TOML_HTTP_ENDPOINT = "leveldb.httpPath"

	TOML_LEVELDB_PATH         = "leveldb.path"
	TOML_LEVELDB_CACHE_SIZE   = "leveldb.cacheSize"
	TOML_LEVELDB_ANCIENT_PATH = "leveldb.ancient"
	TOML_LEVELDB_NAMESPACE    = "leveldb.namespace"
)
View Source
const APIName = "leveldb"

APIName is the namespace used for the state diffing service API

View Source
const APIVersion = "0.0.1"

APIVersion is the version of the state diffing service API

Variables

This section is empty.

Functions

func MakeDatabaseHandles

func MakeDatabaseHandles() (int, error)

MakeDatabaseHandles raises out the number of allowed file handles per process for Geth and returns half of the allowance to assign to the database.

Types

type Config

type Config struct {
	IPCEnabled   bool
	IPCEndpoint  string
	HTTPEnabled  bool
	HTTPEndpoint string

	FilePath    string
	Cache       int
	Handles     int
	FreezerPath string
	Namespace   string
}

Config struct holds the configuration parameters for the levelDB RPC service

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns a new Config from viper parameters

type LevelDBBackend

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

func NewLevelDBBackend

func NewLevelDBBackend(conf *Config) (*LevelDBBackend, error)

NewLevelDBBackend creates a new levelDB RPC server backend

func (*LevelDBBackend) Ancient

func (s *LevelDBBackend) Ancient(kind string, number uint64) ([]byte, error)

func (*LevelDBBackend) AncientDatadir

func (d *LevelDBBackend) AncientDatadir() (string, error)

AncientDatadir returns an error as we don't have a backing chain freezer.

func (*LevelDBBackend) AncientRange

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

func (*LevelDBBackend) AncientSize

func (s *LevelDBBackend) AncientSize(kind string) (uint64, error)

func (*LevelDBBackend) Ancients

func (s *LevelDBBackend) Ancients() (uint64, error)

func (*LevelDBBackend) Close

func (s *LevelDBBackend) Close() error

func (*LevelDBBackend) Compact

func (s *LevelDBBackend) Compact(_ []byte, _ []byte) error

func (*LevelDBBackend) Delete

func (s *LevelDBBackend) Delete(_ []byte) error

func (*LevelDBBackend) Get

func (s *LevelDBBackend) Get(key []byte) ([]byte, error)

func (*LevelDBBackend) Has

func (s *LevelDBBackend) Has(key []byte) (bool, error)

func (*LevelDBBackend) HasAncient

func (s *LevelDBBackend) HasAncient(kind string, number uint64) (bool, error)

func (*LevelDBBackend) MigrateTable

func (s *LevelDBBackend) MigrateTable(string, func([]byte) ([]byte, error)) error

func (*LevelDBBackend) ModifyAncients

func (s *LevelDBBackend) ModifyAncients(f func(ethdb.AncientWriteOp) error) (int64, error)

func (*LevelDBBackend) NewBatch

func (s *LevelDBBackend) NewBatch() ethdb.Batch

func (*LevelDBBackend) NewBatchWithSize

func (d *LevelDBBackend) NewBatchWithSize(size int) ethdb.Batch

func (*LevelDBBackend) NewIterator

func (s *LevelDBBackend) NewIterator(_ []byte, _ []byte) ethdb.Iterator

func (*LevelDBBackend) NewSnapshot

func (s *LevelDBBackend) NewSnapshot() (ethdb.Snapshot, error)

func (*LevelDBBackend) Put

func (s *LevelDBBackend) Put(_ []byte, _ []byte) error

func (*LevelDBBackend) ReadAncients

func (s *LevelDBBackend) ReadAncients(fn func(ethdb.AncientReaderOp) error) error

func (*LevelDBBackend) Stat

func (s *LevelDBBackend) Stat(property string) (string, error)

func (*LevelDBBackend) Sync

func (s *LevelDBBackend) Sync() error

func (*LevelDBBackend) Tail

func (s *LevelDBBackend) Tail() (uint64, error)

func (*LevelDBBackend) TruncateAncients

func (s *LevelDBBackend) TruncateAncients(n uint64) error

func (*LevelDBBackend) TruncateHead

func (s *LevelDBBackend) TruncateHead(n uint64) error

func (*LevelDBBackend) TruncateTail

func (s *LevelDBBackend) TruncateTail(n uint64) error

type PublicLevelDBAPI

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

func NewPublicLevelDBAPI

func NewPublicLevelDBAPI(b *LevelDBBackend) *PublicLevelDBAPI

func (*PublicLevelDBAPI) Ancient

func (s *PublicLevelDBAPI) Ancient(ctx context.Context, kind string, number uint64) ([]byte, error)

func (*PublicLevelDBAPI) AncientRange

func (s *PublicLevelDBAPI) AncientRange(ctx context.Context, kind string, start, count, maxBytes uint64) ([][]byte, error)

func (*PublicLevelDBAPI) AncientSize

func (s *PublicLevelDBAPI) AncientSize(ctx context.Context, kind string) (uint64, error)

func (*PublicLevelDBAPI) Ancients

func (s *PublicLevelDBAPI) Ancients(ctx context.Context) (uint64, error)

func (*PublicLevelDBAPI) Get

func (s *PublicLevelDBAPI) Get(ctx context.Context, key []byte) ([]byte, error)

func (*PublicLevelDBAPI) Has

func (s *PublicLevelDBAPI) Has(ctx context.Context, key []byte) (bool, error)

func (*PublicLevelDBAPI) HasAncient

func (s *PublicLevelDBAPI) HasAncient(ctx context.Context, kind string, number uint64) (bool, error)

func (*PublicLevelDBAPI) Stat

func (s *PublicLevelDBAPI) Stat(ctx context.Context, property string) (string, error)

type Server

type Server interface {
	ethnode.Lifecycle
	APIs() []rpc.API
	Protocols() []p2p.Protocol
	Serve(wg *sync.WaitGroup)
}

Server is the top level interface for exposing a remote RPC wrapper around levelDB ethdb.Database

func NewServer

func NewServer(conf *Config) (Server, error)

NewServer creates a new Server using an underlying Service struct

type Service

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

Service is the underlying struct for the watcher

func (*Service) APIs

func (sap *Service) APIs() []rpc.API

APIs returns the RPC descriptors the watcher service offers

func (*Service) Protocols

func (sap *Service) Protocols() []p2p.Protocol

Protocols exports the services p2p protocols, this service has none

func (*Service) Serve

func (sap *Service) Serve(wg *sync.WaitGroup)

Serve is the listening loop

func (*Service) Start

func (sap *Service) Start() error

Start is used to begin the service This is mostly just to satisfy the node.Service interface

func (*Service) Stop

func (sap *Service) Stop() error

Stop is used to close down the service This is mostly just to satisfy the node.Service interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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