storage

package
v0.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OperatorNodeLink struct {
	ID        uint64 `json:"nodeId"`
	PublicKey string `json:"publicKey"`
}

OperatorNodeLink links a validator to an operator

type Storage

Storage represents the interface of exporter storage

func NewExporterStorage

func NewExporterStorage(db basedb.IDb, logger *zap.Logger) Storage

NewExporterStorage creates a new instance of Storage

type ValidatorInformation

type ValidatorInformation struct {
	Index     int64              `json:"index"`
	PublicKey string             `json:"publicKey"`
	Operators []OperatorNodeLink `json:"operators"`
}

ValidatorInformation represents a validator

type ValidatorsCollection

type ValidatorsCollection interface {
	GetValidatorInformation(validatorPubKey string) (*ValidatorInformation, bool, error)
	SaveValidatorInformation(validatorInformation *ValidatorInformation) error
	// ListValidators TODO: should use uint64 instead of int64
	ListValidators(from int64, to int64) ([]ValidatorInformation, error)
}

ValidatorsCollection is the interface for managing validators information

Jump to

Keyboard shortcuts

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