store

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WalletHighestAttestationPath = "highestAttestations/"
	WalletHighestProposalsBase   = "proposals/%s" // account/proposal
)

Paths

View Source
const (
	WalletDataPath = "wallet/data"
	AccountBase    = "wallet/accounts/"
	AccountPath    = AccountBase + "%s"
)

Paths

Variables

This section is empty.

Functions

This section is empty.

Types

type HashicorpVaultStore

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

HashicorpVaultStore implements store.Store interface using Vault.

func FromInMemoryStore

func FromInMemoryStore(ctx context.Context, newStorage *inmemory.InMemStore, existingStorage logical.Storage) (*HashicorpVaultStore, error)

FromInMemoryStore creates the HashicorpVaultStore based on the given in-memory store.

func FromInMemoryStoreV2 added in v1.3.8

func FromInMemoryStoreV2(ctx context.Context, newStorage *inmemory.InMemStore, existingStorage logical.Storage) (*HashicorpVaultStore, error)

FromInMemoryStoreV2 updates HashicorpVaultStore with new accounts.

func NewHashicorpVaultStore

func NewHashicorpVaultStore(ctx context.Context, storage logical.Storage, network core.Network) *HashicorpVaultStore

NewHashicorpVaultStore is the constructor of HashicorpVaultStore.

func (*HashicorpVaultStore) DeleteAccount

func (store *HashicorpVaultStore) DeleteAccount(accountID uuid.UUID) error

DeleteAccount deletes the given account

func (*HashicorpVaultStore) ListAccounts

func (store *HashicorpVaultStore) ListAccounts() ([]core.ValidatorAccount, error)

ListAccounts returns an empty array for no accounts

func (*HashicorpVaultStore) Name

func (store *HashicorpVaultStore) Name() string

Name returns the name of the store.

func (*HashicorpVaultStore) Network

func (store *HashicorpVaultStore) Network() core.Network

Network returns the network the storage is related to.

func (*HashicorpVaultStore) OpenAccount

func (store *HashicorpVaultStore) OpenAccount(accountID uuid.UUID) (core.ValidatorAccount, error)

OpenAccount opens an account by the given ID. Returns nil,nil if no account was found.

func (*HashicorpVaultStore) OpenWallet

func (store *HashicorpVaultStore) OpenWallet() (core.Wallet, error)

OpenWallet returns nil,nil if no wallet was found

func (*HashicorpVaultStore) RetrieveHighestAttestation

func (store *HashicorpVaultStore) RetrieveHighestAttestation(pubKey []byte) (*phase0.AttestationData, bool, error)

RetrieveHighestAttestation retrieves highest attestation

func (*HashicorpVaultStore) RetrieveHighestProposal

func (store *HashicorpVaultStore) RetrieveHighestProposal(pubKey []byte) (phase0.Slot, bool, error)

RetrieveHighestProposal implements Storage interface.

func (*HashicorpVaultStore) SaveAccount

func (store *HashicorpVaultStore) SaveAccount(account core.ValidatorAccount) error

SaveAccount stores the given account in DB.

func (*HashicorpVaultStore) SaveHighestAttestation

func (store *HashicorpVaultStore) SaveHighestAttestation(pubKey []byte, attestation *phase0.AttestationData) error

SaveHighestAttestation saves highest attestation

func (*HashicorpVaultStore) SaveHighestProposal

func (store *HashicorpVaultStore) SaveHighestProposal(pubKey []byte, slot phase0.Slot) error

SaveHighestProposal implements Storage interface.

func (*HashicorpVaultStore) SaveWallet

func (store *HashicorpVaultStore) SaveWallet(wallet core.Wallet) error

SaveWallet implements Storage interface.

func (*HashicorpVaultStore) SetEncryptor

func (store *HashicorpVaultStore) SetEncryptor(encryptor encryptor.Encryptor, password []byte)

SetEncryptor sets the given encryptor. Could be nil value.

Jump to

Keyboard shortcuts

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