Documentation ¶
Index ¶
Constants ¶
View Source
const ( RoleTypeUnknown = iota RoleTypeAttester RoleTypeAggregator RoleTypeProposer )
List of roles
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Beacon ¶
type Beacon interface { // ExtendIndexMap extanding the pubkeys map of the client (in order to prevent redundant call to fetch pubkeys from node) ExtendIndexMap(index spec.ValidatorIndex, pubKey spec.BLSPubKey) // StartReceivingBlocks continuously fetching blocks and update latest block StartReceivingBlocks() // GetDuties returns duties for the passed validators indices GetDuties(epoch spec.Epoch, validatorIndices []spec.ValidatorIndex) ([]*api.AttesterDuty, error) // GetIndices returns indices for each pubkey from the node GetIndices(validatorPubKeys []spec.BLSPubKey) (map[spec.ValidatorIndex]*api.Validator, error) // GetAttestationData returns attestation data by the given slot and committee index GetAttestationData(slot spec.Slot, committeeIndex spec.CommitteeIndex) (*spec.AttestationData, error) // SignAttestation signs the given attestation SignAttestation(data *spec.AttestationData, duty *Duty, shareKey *bls.SecretKey) (*spec.Attestation, []byte, error) // SubmitAttestation submit the attestation to the node SubmitAttestation(attestation *spec.Attestation) error }
Beacon represents the behavior of the beacon node connector
type Duty ¶ added in v0.0.7
type Duty struct { // Type is the duty type (attest, propose) Type RoleType // PubKey is the public key of the validator that should attest. PubKey spec.BLSPubKey // Slot is the slot in which the validator should attest. Slot spec.Slot // ValidatorIndex is the index of the validator that should attest. ValidatorIndex spec.ValidatorIndex // CommitteeIndex is the index of the committee in which the attesting validator has been placed. CommitteeIndex spec.CommitteeIndex // CommitteeLength is the length of the committee in which the attesting validator has been placed. CommitteeLength uint64 // CommitteesAtSlot is the number of committees in the slot. CommitteesAtSlot uint64 // ValidatorCommitteeIndex is the index of the validator in the list of validators in the committee. ValidatorCommitteeIndex uint64 }
Duty represent data regarding the duty type with the duty data
type DutyData ¶ added in v0.0.7
type DutyData struct { // Types that are valid to be assigned to Data: // *InputValueAttestationData // *InputValue_AggregationData // *InputValue_BeaconBlock Data IsInputValueData `protobuf_oneof:"data"` // Types that are valid to be assigned to SignedData: // *InputValueAttestation // *InputValue_Aggregation // *InputValue_Block SignedData IsInputValueSignedData `protobuf_oneof:"signed_data"` }
DutyData represent unified duty types data
func (*DutyData) GetAttestation ¶ added in v0.0.7
func (m *DutyData) GetAttestation() *phase0.Attestation
GetAttestation return cast attestation input data
func (*DutyData) GetAttestationData ¶ added in v0.0.7
func (m *DutyData) GetAttestationData() *phase0.AttestationData
GetAttestationData return cast input data
func (*DutyData) GetData ¶ added in v0.0.7
func (m *DutyData) GetData() IsInputValueData
GetData returns input data
func (*DutyData) GetSignedData ¶ added in v0.0.7
func (m *DutyData) GetSignedData() IsInputValueSignedData
GetSignedData returns input data
type InputValueAttestation ¶ added in v0.0.7
type InputValueAttestation struct {
Attestation *phase0.Attestation
}
InputValueAttestation implementing IsInputValueSignedData
type InputValueAttestationData ¶ added in v0.0.7
type InputValueAttestationData struct {
AttestationData *phase0.AttestationData
}
InputValueAttestationData implementing IsInputValueData
type IsInputValueData ¶ added in v0.0.7
type IsInputValueData interface {
// contains filtered or unexported methods
}
IsInputValueData interface representing input data
type IsInputValueSignedData ¶ added in v0.0.7
type IsInputValueSignedData interface {
// contains filtered or unexported methods
}
IsInputValueSignedData interface representing input signed data
type Options ¶ added in v0.0.7
type Options struct { Context context.Context Logger *zap.Logger Network string `yaml:"Network" env:"NETWORK" env-default:"prater"` BeaconNodeAddr string `yaml:"BeaconNodeAddr" env:"BEACON_NODE_ADDR" env-required:"true"` Graffiti []byte }
Options for controller struct creation
Click to show internal directories.
Click to hide internal directories.