-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathnode.proto
172 lines (148 loc) · 5.46 KB
/
node.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
// Copyright 2020 Prysmatic Labs.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package ethereum.eth.v1alpha1;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "eth/ext/options.proto";
option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "NodeProto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";
// Node service API
//
// Node service provides general information about the node itself, the services
// it supports, chain information and node version.
service Node {
// Retrieve the current network sync status of the node.
rpc GetSyncStatus(google.protobuf.Empty) returns (SyncStatus) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/syncing"
};
}
// Retrieve information about the genesis of Ethereum proof of stake.
rpc GetGenesis(google.protobuf.Empty) returns (Genesis) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/genesis"
};
}
// Retrieve information about the running Ethereum Beacon Node.
rpc GetVersion(google.protobuf.Empty) returns (Version) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/version"
};
}
// Retrieve the list of services implemented and enabled by this node.
//
// Any service not present in this list may return UNIMPLEMENTED or
// PERMISSION_DENIED. The server may also support fetching services by grpc
// reflection.
rpc ListImplementedServices(google.protobuf.Empty) returns (ImplementedServices) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/services"
};
}
// Retrieves the peer data of the local peer.
rpc GetHost(google.protobuf.Empty) returns (HostData) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/p2p"
};
}
// Retrieve the peer corresponding to the provided peer id.
rpc GetPeer(PeerRequest) returns (Peer) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/peer"
};
}
// Retrieve the list of peers currently connected to this node.
rpc ListPeers(google.protobuf.Empty) returns (Peers) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/peers"
};
}
}
// Information about the current network sync status of the node.
message SyncStatus {
// Whether or not the node is currently syncing.
bool syncing = 1;
}
// Information about the genesis of Ethereum proof of stake.
message Genesis {
// UTC time specified in the chain start event in the deposit contract.
google.protobuf.Timestamp genesis_time = 1;
// Address of the deposit contract in the Ethereum 1 chain.
bytes deposit_contract_address = 2;
// Root of the genesis validators deposits; used for domain separation
// when signing data structures for this chain.
bytes genesis_validators_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
}
// Information about the node version.
message Version {
// A string that uniquely identifies the node and its version.
string version = 1;
// Additional metadata that the node would like to provide. This field may
// be used to list any meaningful data to the client.
string metadata = 2;
}
message ImplementedServices {
repeated string services = 1;
}
message PeerRequest {
// Peer id of the peer requested.
string peer_id = 1;
}
// Peers is a list of peer messages.
message Peers {
repeated Peer peers = 1;
}
// Peer provides details of a peer on the network.
message Peer {
// The address of the peer, as a full multiaddr, for example:
// /ip4/37.221.192.134/tcp/13000/p2p/16Uiu2HAm8maLMjag1TAUM52zPfmLbVMGFdwUAWgoHu1HDQLR6e17
string address = 1;
// The direction of the connection (inbound/outbound).
PeerDirection direction = 2;
// The connection state of the peer at the moment of the request. (e.g. Connecting)
ConnectionState connection_state = 3;
// The peer id of the peer.
string peer_id = 4;
// The latest ENR of the peer that's in the record.
string enr = 5;
}
// P2P Data on the local host.
message HostData{
// All the multiaddress of the peer, specified as a full multiaddr, for example:
// /ip4/37.221.192.134/tcp/13000/p2p/16Uiu2HAm8maLMjag1TAUM52zPfmLbVMGFdwUAWgoHu1HDQLR6e17
repeated string addresses = 1;
// The peer id of the peer.
string peer_id = 2;
// The latest ENR of the local peer.
string enr = 3;
}
// PeerDirection states the direction of the connection to a peer.
enum PeerDirection {
UNKNOWN = 0;
INBOUND = 1;
OUTBOUND = 2;
}
// ConnectionState states the current status of the peer.
enum ConnectionState {
DISCONNECTED = 0;
DISCONNECTING = 1;
CONNECTED = 2;
CONNECTING = 3;
}