-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathethereum.go
39 lines (33 loc) · 1.33 KB
/
ethereum.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package events
import (
"time"
"github.com/protolambda/zrnt/eth2/beacon/phase0"
)
// EthereumAttestation contains the data for an Ethereum Attestation that was received
type EthereumAttestation struct {
Attestation *phase0.Attestation `json:"attestation"`
}
// TimedEthereumAttestation contains the data for an Ethereum Attestation that was received
// along with extra data such as when it arrived and who sent it
type TimedEthereumAttestation struct {
Attestation *phase0.Attestation `json:"attestation"`
AttestationExtraData *AttestationExtraData `json:"attestation_extra_data"`
PeerInfo *PeerInfo `json:"peer_info"`
}
// PeerInfo contains information about a peer
type PeerInfo struct {
ID string `json:"id"`
IP string `json:"ip"`
Port int `json:"port"`
UserAgent string `json:"user_agent"`
Latency time.Duration `json:"latency"`
Protocols []string `json:"protocols"`
ProtocolVersion string `json:"protocol_version"`
}
// AttestationExtraData contains extra data for an attestation
type AttestationExtraData struct {
ArrivedAt time.Time `json:"arrived_at"`
P2PMsgID string `json:"peer_msg_id"`
Subnet int `json:"subnet"`
TimeInSlot time.Duration `json:"time_in_slot"`
}