storage

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: GPL-3.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HashedPrivateKey = "hashed-private-key"

Functions

This section is empty.

Types

type ConfigLock added in v1.1.0

type ConfigLock struct {
	NetworkName      string `json:"network_name"`
	UsingLocalEvents bool   `json:"using_local_events"`
}

func (*ConfigLock) EnsureSameWith added in v1.1.0

func (stored *ConfigLock) EnsureSameWith(current *ConfigLock) error

type Storage

type Storage interface {
	Begin() basedb.Txn
	BeginRead() basedb.ReadTxn

	SaveLastProcessedBlock(rw basedb.ReadWriter, offset *big.Int) error
	GetLastProcessedBlock(r basedb.Reader) (*big.Int, bool, error)

	GetConfig(rw basedb.ReadWriter) (*ConfigLock, bool, error)
	SaveConfig(rw basedb.ReadWriter, config *ConfigLock) error
	DeleteConfig(rw basedb.ReadWriter) error

	registry.RegistryStore

	registrystorage.Operators
	registrystorage.Recipients
	Shares() registrystorage.Shares

	GetPrivateKey() (*rsa.PrivateKey, bool, error)
	SetupPrivateKey(operatorKeyBase64 string) ([]byte, error)
}

Storage represents the interface for ssv node storage

func NewNodeStorage

func NewNodeStorage(logger *zap.Logger, db basedb.Database) (Storage, error)

NewNodeStorage creates a new instance of Storage

Jump to

Keyboard shortcuts

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