storage

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 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 OperatorInformation

type OperatorInformation struct {
	PublicKey    string         `json:"publicKey"`
	Name         string         `json:"name"`
	OwnerAddress common.Address `json:"ownerAddress"`
	Index        int64          `json:"index"`
}

OperatorInformation the public data of an operator

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

OperatorNodeLink links a validator to an operator

type OperatorsCollection

type OperatorsCollection interface {
	GetOperatorInformation(operatorPubKey string) (*OperatorInformation, error)
	SaveOperatorInformation(operatorInformation *OperatorInformation) error
	ListOperators(from int64, to int64) ([]OperatorInformation, error)
}

OperatorsCollection is the interface for managing operators information

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, error)
	SaveValidatorInformation(validatorInformation *ValidatorInformation) error
	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