Documentation
¶
Index ¶
- type EpochAuthorizedVotersCache
- type EpochStakesCache
- func (cache *EpochStakesCache) ClearEpochStakes(epoch uint64)
- func (cache *EpochStakesCache) DeserializeAndLoadEpoch(data []byte) (uint64, error)
- func (cache *EpochStakesCache) EpochStakes(epoch uint64) map[solana.PublicKey]uint64
- func (cache *EpochStakesCache) EpochStakesAccts(epoch uint64) map[solana.PublicKey]*VoteAccount
- func (cache *EpochStakesCache) GetAllEpochs() []uint64
- func (cache *EpochStakesCache) HasEpochStakes(epoch uint64) bool
- func (cache *EpochStakesCache) PutEntry(epoch uint64, pubkey solana.PublicKey, stake uint64, voteAcct *VoteAccount)
- func (cache *EpochStakesCache) PutTotalEpochStake(epoch uint64, totalStake uint64)
- func (cache *EpochStakesCache) SerializeEpoch(epoch uint64) ([]byte, error)
- func (cache *EpochStakesCache) TotalStake(epoch uint64) uint64
- type PersistedEpochStakes
- type VoteAccount
- type VoteAccountJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EpochAuthorizedVotersCache ¶
type EpochAuthorizedVotersCache struct {
// contains filtered or unexported fields
}
func NewEpochAuthorizedVotersCache ¶
func NewEpochAuthorizedVotersCache() *EpochAuthorizedVotersCache
func (*EpochAuthorizedVotersCache) IsAuthorizedVoter ¶
type EpochStakesCache ¶
type EpochStakesCache struct {
// contains filtered or unexported fields
}
func NewEpochStakesCache ¶
func NewEpochStakesCache() *EpochStakesCache
func (*EpochStakesCache) ClearEpochStakes ¶
func (cache *EpochStakesCache) ClearEpochStakes(epoch uint64)
ClearEpochStakes removes all stakes for a specific epoch. Used on resume to force rebuild from AccountsDB.
func (*EpochStakesCache) DeserializeAndLoadEpoch ¶
func (cache *EpochStakesCache) DeserializeAndLoadEpoch(data []byte) (uint64, error)
DeserializeAndLoadEpoch deserializes epoch stakes from JSON and loads into cache. Returns the epoch number that was loaded.
func (*EpochStakesCache) EpochStakes ¶
func (cache *EpochStakesCache) EpochStakes(epoch uint64) map[solana.PublicKey]uint64
func (*EpochStakesCache) EpochStakesAccts ¶
func (cache *EpochStakesCache) EpochStakesAccts(epoch uint64) map[solana.PublicKey]*VoteAccount
func (*EpochStakesCache) GetAllEpochs ¶
func (cache *EpochStakesCache) GetAllEpochs() []uint64
GetAllEpochs returns a list of all epochs in the cache.
func (*EpochStakesCache) HasEpochStakes ¶
func (cache *EpochStakesCache) HasEpochStakes(epoch uint64) bool
func (*EpochStakesCache) PutEntry ¶
func (cache *EpochStakesCache) PutEntry(epoch uint64, pubkey solana.PublicKey, stake uint64, voteAcct *VoteAccount)
func (*EpochStakesCache) PutTotalEpochStake ¶
func (cache *EpochStakesCache) PutTotalEpochStake(epoch uint64, totalStake uint64)
func (*EpochStakesCache) SerializeEpoch ¶
func (cache *EpochStakesCache) SerializeEpoch(epoch uint64) ([]byte, error)
SerializeEpoch serializes the stakes for a single epoch to JSON.
func (*EpochStakesCache) TotalStake ¶
func (cache *EpochStakesCache) TotalStake(epoch uint64) uint64
type PersistedEpochStakes ¶
type PersistedEpochStakes struct {
Epoch uint64 `json:"epoch"`
TotalStake uint64 `json:"total_stake"`
Stakes map[string]uint64 `json:"stakes"` // base58 pubkey → stake
VoteAccts map[string]*VoteAccountJSON `json:"vote_accts"` // base58 pubkey → metadata
}
PersistedEpochStakes is the JSON-serializable format for epoch stakes.
type VoteAccount ¶
type VoteAccountJSON ¶
type VoteAccountJSON struct {
Lamports uint64 `json:"lamports"`
NodePubkey string `json:"node_pubkey"`
LastTimestampTs int64 `json:"last_ts"`
LastTimestampSlot uint64 `json:"last_ts_slot"`
Owner string `json:"owner"`
Executable byte `json:"executable"`
RentEpoch uint64 `json:"rent_epoch"`
}
VoteAccountJSON is the JSON-serializable format for vote account metadata.
Click to show internal directories.
Click to hide internal directories.