accountsdb

package
v0.0.0-...-49ff46f Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAccount = errors.New("ErrNoAccount")
)

Functions

This section is empty.

Types

type AccountIndexEntry

type AccountIndexEntry struct {
	Slot   uint64
	FileId uint64
	Offset uint64
}

func BuildIndexEntriesFromAppendVecs

func BuildIndexEntriesFromAppendVecs(data []byte, fileSize uint64, slot uint64, fileId uint64) ([]solana.PublicKey, []*AccountIndexEntry, error)

func (*AccountIndexEntry) MarshalWithEncoder

func (entry *AccountIndexEntry) MarshalWithEncoder(encoder *bin.Encoder) error

func (*AccountIndexEntry) UnmarshalWithDecoder

func (entry *AccountIndexEntry) UnmarshalWithDecoder(decoder *bin.Decoder) error

type AccountsDb

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

func OpenDb

func OpenDb(accountsDbDir string) (*AccountsDb, error)

func (*AccountsDb) BankHash

func (accountsDb *AccountsDb) BankHash() [32]byte

func (*AccountsDb) CloseDb

func (accountsDb *AccountsDb) CloseDb()

func (*AccountsDb) GetAccount

func (accountsDb *AccountsDb) GetAccount(pubkey solana.PublicKey) (*accounts.Account, error)

func (*AccountsDb) KeysBetweenPrefixes

func (accountsDb *AccountsDb) KeysBetweenPrefixes(startPrefix uint64, endPrefix uint64) []solana.PublicKey

func (*AccountsDb) StoreAccounts

func (accountsDb *AccountsDb) StoreAccounts(accts []*accounts.Account, slot uint64) error

type AppendVecAccount

type AppendVecAccount struct {
	WriteVersion uint64
	DataLen      uint64
	Pubkey       solana.PublicKey
	Lamports     uint64
	RentEpoch    uint64
	Owner        solana.PublicKey
	Executable   bool
	Padding      [7]byte
	Hash         [32]byte
	Data         []byte
}

func (*AppendVecAccount) Marshal

func (acct *AppendVecAccount) Marshal(buf io.Writer) error

TODO: optimise by rewriting without binary.Write(), which uses fairly expensive reflection

func (*AppendVecAccount) ToAccount

func (appendVecAcct *AppendVecAccount) ToAccount() *accounts.Account

func (*AppendVecAccount) Unmarshal

func (acct *AppendVecAccount) Unmarshal(buf io.Reader) error

TODO: optimise by rewriting without binary.Read(), which uses fairly expensive reflection

Jump to

Keyboard shortcuts

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