Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type Database
- func (db *Database) AddValidator(pubkey beacon.ValidatorPubkey, withdrawalCredentials common.Hash) (*Validator, error)
- func (db *Database) Clone() *Database
- func (db *Database) GetAllValidators() []*Validator
- func (db *Database) GetCurrentSlot() uint64
- func (db *Database) GetHighestSlot() uint64
- func (db *Database) GetValidatorByIndex(index uint) *Validator
- func (db *Database) GetValidatorByPubkey(pubkey beacon.ValidatorPubkey) *Validator
- func (db *Database) SetCurrentSlot(slot uint64)
- type Validator
Constants ¶
View Source
const ( DefaultChainID uint64 = 0x90de5e7 DefaultDepositContractAddressString string = "0xde905175eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" )
View Source
const ( FarFutureEpoch uint64 = 0xffffffffffffffff StartingBalance uint64 = 32e9 )
Variables ¶
View Source
var ( // Default config DefaultDepositContractAddress common.Address = common.HexToAddress(DefaultDepositContractAddressString) )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Basic settings
ChainID uint64
SecondsPerSlot uint64
SlotsPerEpoch uint64
EpochsPerSyncCommitteePeriod uint64
DepositContract common.Address
// Genesis info
GenesisTime time.Time
GenesisForkVersion []byte
GenesisValidatorsRoot []byte
// Altair info
AltairForkVersion []byte
AltairForkEpoch uint64
// Bellatrix info
BellatrixForkVersion []byte
BellatrixForkEpoch uint64
// Capella info
CapellaForkVersion []byte
CapellaForkEpoch uint64
// Deneb info
DenebForkVersion []byte
DenebForkEpoch uint64
}
Basic Beacon Chain configuration
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Beacon mock database
func (*Database) AddValidator ¶
func (db *Database) AddValidator(pubkey beacon.ValidatorPubkey, withdrawalCredentials common.Hash) (*Validator, error)
Add a new validator to the database. Returns an error if the validator already exists.
func (*Database) GetAllValidators ¶
Get all validators
func (*Database) GetHighestSlot ¶
Get the highest slot on the chain
func (*Database) GetValidatorByIndex ¶
Get a validator by its index. Returns nil if it doesn't exist.
func (*Database) GetValidatorByPubkey ¶
func (db *Database) GetValidatorByPubkey(pubkey beacon.ValidatorPubkey) *Validator
Get a validator by its pubkey. Returns nil if it doesn't exist.
func (*Database) SetCurrentSlot ¶
Set the current slot - this will also update the highest slot if the new slot is higher
type Validator ¶
type Validator struct {
Pubkey beacon.ValidatorPubkey
Index uint64
WithdrawalCredentials common.Hash
Balance uint64
Status beacon.ValidatorState
EffectiveBalance uint64
Slashed bool
ActivationEligibilityEpoch uint64
ActivationEpoch uint64
ExitEpoch uint64
WithdrawableEpoch uint64
}
func NewValidator ¶
func (*Validator) GetValidatorMeta ¶
func (*Validator) SetBalance ¶
func (*Validator) SetStatus ¶
func (v *Validator) SetStatus(status beacon.ValidatorState)
Click to show internal directories.
Click to hide internal directories.