Documentation
¶
Index ¶
- Variables
- type AccountIndexEntry
- type AccountsDb
- func (accountsDb *AccountsDb) AddProgramToCache(pubkey solana.PublicKey, programEntry *ProgramCacheEntry)
- func (accountsDb *AccountsDb) AllKeys() [][]byte
- func (accountsDb *AccountsDb) CloseDb()
- func (accountsDb *AccountsDb) GetAccount(slot uint64, pubkey solana.PublicKey) (*accounts.Account, error)
- func (db *AccountsDb) GetAccountsBatch(ctx context.Context, slot uint64, pks []solana.PublicKey) ([]*accounts.Account, error)
- func (accountsDb *AccountsDb) GetBankHashForSlot(slot uint64) ([]byte, error)
- func (accountsDb *AccountsDb) InitCaches()
- func (accountsDb *AccountsDb) KeysBetweenPrefixes(startPrefix uint64, endPrefix uint64) []solana.PublicKey
- func (accountsDb *AccountsDb) MaybeGetProgramFromCache(pubkey solana.PublicKey) (*ProgramCacheEntry, bool)
- func (accountsDb *AccountsDb) RemoveProgramFromCache(pubkey solana.PublicKey)
- func (accountsDb *AccountsDb) StoreAccounts(accts []*accounts.Account, slot uint64) error
- func (accountsDb *AccountsDb) StoreBankHashForSlot(slot uint64, bankHash []byte) error
- type AppendVecAccount
- type ProgramCacheEntry
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoAccount = errors.New("ErrNoAccount")
)
Functions ¶
This section is empty.
Types ¶
type AccountIndexEntry ¶
func BuildIndexEntriesFromAppendVecs ¶
func BuildIndexEntriesFromAppendVecs(data []byte, fileSize uint64, slot uint64, fileId uint64) ([]solana.PublicKey, []AccountIndexEntry, []solana.PublicKey, error)
BuildIndexEntriesFromAppendVecs parses an appendvec and returns: - pubkeys: all account pubkeys - acctIdxEntries: index entries for each account - stakePubkeys: pubkeys of accounts owned by the stake program
func (AccountIndexEntry) Marshal ¶
func (entry AccountIndexEntry) Marshal(out *[24]byte)
func (*AccountIndexEntry) Unmarshal ¶
func (entry *AccountIndexEntry) Unmarshal(in *[24]byte)
type AccountsDb ¶
type AccountsDb struct {
Index *pebble.DB
BankHashStore *pebble.DB
AcctsDir string
LargestFileId atomic.Uint64
VoteAcctCache otter.Cache[solana.PublicKey, *accounts.Account]
CommonAcctsCache otter.Cache[solana.PublicKey, *accounts.Account]
ProgramCache otter.Cache[solana.PublicKey, *ProgramCacheEntry]
}
func OpenDb ¶
func OpenDb(accountsDbDir string) (*AccountsDb, error)
func (*AccountsDb) AddProgramToCache ¶
func (accountsDb *AccountsDb) AddProgramToCache(pubkey solana.PublicKey, programEntry *ProgramCacheEntry)
func (*AccountsDb) AllKeys ¶
func (accountsDb *AccountsDb) AllKeys() [][]byte
func (*AccountsDb) CloseDb ¶
func (accountsDb *AccountsDb) CloseDb()
func (*AccountsDb) GetAccount ¶
func (*AccountsDb) GetAccountsBatch ¶
func (*AccountsDb) GetBankHashForSlot ¶
func (accountsDb *AccountsDb) GetBankHashForSlot(slot uint64) ([]byte, error)
func (*AccountsDb) InitCaches ¶
func (accountsDb *AccountsDb) InitCaches()
func (*AccountsDb) KeysBetweenPrefixes ¶
func (accountsDb *AccountsDb) KeysBetweenPrefixes(startPrefix uint64, endPrefix uint64) []solana.PublicKey
func (*AccountsDb) MaybeGetProgramFromCache ¶
func (accountsDb *AccountsDb) MaybeGetProgramFromCache(pubkey solana.PublicKey) (*ProgramCacheEntry, bool)
func (*AccountsDb) RemoveProgramFromCache ¶
func (accountsDb *AccountsDb) RemoveProgramFromCache(pubkey solana.PublicKey)
func (*AccountsDb) StoreAccounts ¶
func (accountsDb *AccountsDb) StoreAccounts(accts []*accounts.Account, slot uint64) error
func (*AccountsDb) StoreBankHashForSlot ¶
func (accountsDb *AccountsDb) StoreBankHashForSlot(slot uint64, bankHash []byte) 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) ToAccount ¶
func (appendVecAcct *AppendVecAccount) ToAccount() *accounts.Account
type ProgramCacheEntry ¶
Click to show internal directories.
Click to hide internal directories.