Documentation ¶
Index ¶
- Constants
- func MakeDatabaseHandles() (int, error)
- type Config
- type LevelDBBackend
- func (s *LevelDBBackend) Ancient(kind string, number uint64) ([]byte, error)
- func (d *LevelDBBackend) AncientDatadir() (string, error)
- func (s *LevelDBBackend) AncientRange(kind string, start, count, maxBytes uint64) ([][]byte, error)
- func (s *LevelDBBackend) AncientSize(kind string) (uint64, error)
- func (s *LevelDBBackend) Ancients() (uint64, error)
- func (s *LevelDBBackend) Close() error
- func (s *LevelDBBackend) Compact(_ []byte, _ []byte) error
- func (s *LevelDBBackend) Delete(_ []byte) error
- func (s *LevelDBBackend) Get(key []byte) ([]byte, error)
- func (s *LevelDBBackend) Has(key []byte) (bool, error)
- func (s *LevelDBBackend) HasAncient(kind string, number uint64) (bool, error)
- func (s *LevelDBBackend) MigrateTable(string, func([]byte) ([]byte, error)) error
- func (s *LevelDBBackend) ModifyAncients(f func(ethdb.AncientWriteOp) error) (int64, error)
- func (s *LevelDBBackend) NewBatch() ethdb.Batch
- func (d *LevelDBBackend) NewBatchWithSize(size int) ethdb.Batch
- func (s *LevelDBBackend) NewIterator(_ []byte, _ []byte) ethdb.Iterator
- func (s *LevelDBBackend) NewSnapshot() (ethdb.Snapshot, error)
- func (s *LevelDBBackend) Put(_ []byte, _ []byte) error
- func (s *LevelDBBackend) ReadAncients(fn func(ethdb.AncientReaderOp) error) error
- func (s *LevelDBBackend) Stat(property string) (string, error)
- func (s *LevelDBBackend) Sync() error
- func (s *LevelDBBackend) Tail() (uint64, error)
- func (s *LevelDBBackend) TruncateAncients(n uint64) error
- func (s *LevelDBBackend) TruncateHead(n uint64) error
- func (s *LevelDBBackend) TruncateTail(n uint64) error
- type PublicLevelDBAPI
- func (s *PublicLevelDBAPI) Ancient(ctx context.Context, kind string, number uint64) ([]byte, error)
- func (s *PublicLevelDBAPI) AncientRange(ctx context.Context, kind string, start, count, maxBytes uint64) ([][]byte, error)
- func (s *PublicLevelDBAPI) AncientSize(ctx context.Context, kind string) (uint64, error)
- func (s *PublicLevelDBAPI) Ancients(ctx context.Context) (uint64, error)
- func (s *PublicLevelDBAPI) Get(ctx context.Context, key []byte) ([]byte, error)
- func (s *PublicLevelDBAPI) Has(ctx context.Context, key []byte) (bool, error)
- func (s *PublicLevelDBAPI) HasAncient(ctx context.Context, kind string, number uint64) (bool, error)
- func (s *PublicLevelDBAPI) Stat(ctx context.Context, property string) (string, error)
- type Server
- type Service
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 ¶
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
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) Delete ¶
func (s *LevelDBBackend) Delete(_ []byte) error
func (*LevelDBBackend) HasAncient ¶
func (s *LevelDBBackend) HasAncient(kind string, number uint64) (bool, error)
func (*LevelDBBackend) MigrateTable ¶
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) ReadAncients ¶
func (s *LevelDBBackend) ReadAncients(fn func(ethdb.AncientReaderOp) error) 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) AncientRange ¶
func (*PublicLevelDBAPI) AncientSize ¶
func (*PublicLevelDBAPI) Ancients ¶
func (s *PublicLevelDBAPI) Ancients(ctx context.Context) (uint64, error)
func (*PublicLevelDBAPI) HasAncient ¶
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
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the underlying struct for the watcher
Click to show internal directories.
Click to hide internal directories.