-
Notifications
You must be signed in to change notification settings - Fork 0
/
beaconspot.proto
173 lines (144 loc) · 5.81 KB
/
beaconspot.proto
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
syntax = "proto3";
option go_package = "github.com/begmaroman/beaconspot/proto/beaconspot;beaconspotproto";
package beaconspotproto;
import "proto/eth/ext/options.proto";
import "proto/prysm/v1alpha1/validator.proto";
import "proto/prysm/v1alpha1/attestation.proto";
import "proto/prysm/v1alpha1/beacon_block.proto";
import "google/protobuf/empty.proto";
import "github.com/begmaroman/beaconspot/proto/health/health.proto";
import "github.com/begmaroman/beaconspot/proto/status/status.proto";
// BeaconSpotService represents service definitions of beacon spot
service BeaconSpotService {
rpc Health(google.protobuf.Empty) returns (health.HealthResponse) {}
rpc Ping(google.protobuf.Empty) returns (google.protobuf.Empty) {}
// DomainData returns domain data by the given request
rpc DomainData(DomainDataRequest) returns (DomainDataResponse) {}
// GetAttestation returns attestation data by the given request parameters.
rpc GetAttestation(GetAttestationRequest) returns (GetAttestationResponse) {}
// ProposeAttestation submits the given signed attestation to the beacon nodes.
// This endpoint submits attestation to all nodes and waits for response from all of them.
rpc ProposeAttestation(ProposeAttestationRequest) returns (ProposeAttestationResponse) {}
// GetAggregateSelectionProof returns aggregation data by the given params.
rpc GetAggregateSelectionProof(GetAggregateSelectionProofRequest) returns (GetAggregateSelectionProofResponse) {}
// SubmitSignedAggregateSelectionProof submits signed aggregation data to the beacon nodes.
// This endpoint submits aggregation to all nodes and waits for response from all of them.
rpc SubmitSignedAggregateSelectionProof(SubmitSignedAggregateSelectionProofRequest) returns (SubmitSignedAggregateSelectionProofResponse) {}
// GetBlock returns a block by the given request.
rpc GetBlock(GetBlockRequest) returns (GetBlockResponse) {}
// ProposeBlock proposes the given signed block to beacon nodes.
// This endpoint submits signed block to all nodes and waits for response from all of them.
rpc ProposeBlock(ProposeBlockRequest) returns (ProposeBlockResponse) {}
// SubnetsSubscribe sends a request to nodes to subscribe on the given subnets.
rpc SubnetsSubscribe(SubnetsSubscribeRequest) returns (SubnetsSubscribeResponse) {}
// StreamDuties opens duties streaming from the beacon nodes.
rpc StreamDuties(StreamDutiesRequest) returns (stream StreamDutiesResponse) {}
}
// DomainData operation
message DomainDataRequest {
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
bytes domain = 2;
}
message DomainDataResponse {
oneof result {
Status error = 1;
bytes domain_data = 2;
}
}
// GetAttestation operation
message GetAttestationRequest {
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
uint64 committee_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"];
}
message GetAttestationResponse {
oneof result {
Status error = 1;
ethereum.eth.v1alpha1.AttestationData attestation_data = 2;
}
}
// ProposeAttestation operation
message ProposeAttestationRequest {
ethereum.eth.v1alpha1.AttestationData attestation_data = 1;
bytes aggregation_bits = 2;
bytes signature = 3;
}
message ProposeAttestationResponse {
oneof result {
Status error = 1;
google.protobuf.Empty empty = 2;
}
}
// GetAggregateSelectionProof operation
message GetAggregateSelectionProofRequest {
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
uint64 committee_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"];
bytes public_key = 3;
bytes signature = 4;
}
message GetAggregateSelectionProofResponse {
oneof result {
Status error = 1;
ethereum.eth.v1alpha1.AggregateAttestationAndProof data = 2;
}
}
// GetAggregateSelectionProof operation
message SubmitSignedAggregateSelectionProofRequest {
bytes signature = 1;
ethereum.eth.v1alpha1.AggregateAttestationAndProof data = 2;
}
message SubmitSignedAggregateSelectionProofResponse {
oneof result {
Status error = 1;
google.protobuf.Empty empty = 2;
}
}
// GetBlock operation
message GetBlockRequest {
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
bytes randao_reveal = 2;
bytes graffiti = 3;
}
message GetBlockResponse {
oneof result {
Status error = 1;
ethereum.eth.v1alpha1.BeaconBlock beacon_block = 2;
}
}
// ProposeBlock operation
message ProposeBlockRequest {
bytes signature = 1;
ethereum.eth.v1alpha1.BeaconBlock beacon_block = 2;
}
message ProposeBlockResponse {
oneof result {
Status error = 1;
google.protobuf.Empty empty = 2;
}
}
// SubnetsSubscribe operation
message SubnetsSubscribeRequest {
repeated SubnetSubscription subscriptions = 1;
}
message SubnetsSubscribeResponse {
oneof result {
Status error = 1;
google.protobuf.Empty empty = 2;
}
}
message SubnetSubscription {
uint64 validator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
uint64 committee_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"];
uint64 committees_at_slot = 3;
uint64 slot = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
bool is_aggregator = 5;
}
// StreamDuties operation
message StreamDutiesRequest {
repeated bytes public_keys = 1;
}
message StreamDutiesResponse {
oneof result {
Status error = 1;
ethereum.eth.v1alpha1.DutiesResponse duties = 2;
}
}