2021-08-13 09:12:18 +00:00
|
|
|
// 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";
|
|
|
|
|
2021-08-13 10:55:24 +00:00
|
|
|
package ethereum.eth.service;
|
2021-08-13 09:12:18 +00:00
|
|
|
|
|
|
|
import "google/api/annotations.proto";
|
|
|
|
import "google/protobuf/descriptor.proto";
|
|
|
|
import "google/protobuf/empty.proto";
|
|
|
|
|
|
|
|
import "proto/eth/v1/node.proto";
|
|
|
|
|
2021-08-13 10:55:24 +00:00
|
|
|
option csharp_namespace = "Ethereum.Eth.Service";
|
2022-08-16 12:20:13 +00:00
|
|
|
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/service";
|
2021-08-13 09:12:18 +00:00
|
|
|
option java_multiple_files = true;
|
|
|
|
option java_outer_classname = "NodeServiceProto";
|
2021-08-13 10:55:24 +00:00
|
|
|
option java_package = "org.ethereum.eth.service";
|
|
|
|
option php_namespace = "Ethereum\\Eth\\Service";
|
2021-08-13 09:12:18 +00:00
|
|
|
|
|
|
|
// Beacon chain node API
|
|
|
|
//
|
|
|
|
// The beacon chain node API is a set of endpoints to query node information.
|
|
|
|
service BeaconNode {
|
|
|
|
// GetIdentity retrieves data about the node's network presence.
|
2022-06-21 14:29:44 +00:00
|
|
|
//
|
|
|
|
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getNetworkIdentity
|
2021-08-13 10:55:24 +00:00
|
|
|
rpc GetIdentity(google.protobuf.Empty) returns (v1.IdentityResponse) {
|
2021-09-21 19:20:57 +00:00
|
|
|
option (google.api.http) = {get: "/internal/eth/v1/node/identity"};
|
2021-08-13 09:12:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ListPeers retrieves data about the node's network peers.
|
2022-06-21 14:29:44 +00:00
|
|
|
//
|
|
|
|
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getPeers
|
2021-08-13 10:55:24 +00:00
|
|
|
rpc ListPeers(v1.PeersRequest) returns (v1.PeersResponse) {
|
2021-09-21 19:20:57 +00:00
|
|
|
option (google.api.http) = {get: "/internal/eth/v1/node/peers"};
|
2021-08-13 09:12:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetPeer retrieves data about the given peer.
|
2022-06-21 14:29:44 +00:00
|
|
|
//
|
|
|
|
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getPeer
|
2021-08-13 10:55:24 +00:00
|
|
|
rpc GetPeer(v1.PeerRequest) returns (v1.PeerResponse) {
|
2021-09-21 19:20:57 +00:00
|
|
|
option (google.api.http) = {get: "/internal/eth/v1/node/peers/{peer_id}"};
|
2021-08-13 09:12:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// PeerCount retrieves number of known peers.
|
2022-06-21 14:29:44 +00:00
|
|
|
//
|
|
|
|
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getPeerCount
|
2021-08-13 10:55:24 +00:00
|
|
|
rpc PeerCount(google.protobuf.Empty) returns (v1.PeerCountResponse) {
|
2021-09-21 19:20:57 +00:00
|
|
|
option (google.api.http) = {get: "/internal/eth/v1/node/peer_count"};
|
2021-08-13 09:12:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetSyncStatus requests the beacon node to describe if it's currently syncing or not, and
|
|
|
|
// if it is, what block it is up to.
|
2022-06-21 14:29:44 +00:00
|
|
|
//
|
|
|
|
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getSyncingStatus
|
2021-08-13 10:55:24 +00:00
|
|
|
rpc GetSyncStatus(google.protobuf.Empty) returns (v1.SyncingResponse) {
|
2021-09-21 19:20:57 +00:00
|
|
|
option (google.api.http) = {get: "/internal/eth/v1/node/syncing"};
|
2021-08-13 09:12:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetVersion requests that the beacon node identify information about its implementation in a
|
|
|
|
// format similar to a HTTP User-Agent field.
|
2022-06-21 14:29:44 +00:00
|
|
|
//
|
|
|
|
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getNodeVersion
|
2021-08-13 10:55:24 +00:00
|
|
|
rpc GetVersion(google.protobuf.Empty) returns (v1.VersionResponse) {
|
2021-09-21 19:20:57 +00:00
|
|
|
option (google.api.http) = {get: "/internal/eth/v1/node/version"};
|
2021-08-13 09:12:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetHealth returns node health status in http status codes. Useful for load balancers.
|
|
|
|
// Response Usage:
|
|
|
|
// "200":
|
|
|
|
// description: Node is ready
|
|
|
|
// "206":
|
|
|
|
// description: Node is syncing but can serve incomplete data
|
|
|
|
// "503":
|
|
|
|
// description: Node not initialized or having issues
|
2022-06-21 14:29:44 +00:00
|
|
|
//
|
|
|
|
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getHealth
|
2021-08-13 09:12:18 +00:00
|
|
|
rpc GetHealth(google.protobuf.Empty) returns (google.protobuf.Empty) {
|
2021-09-21 19:20:57 +00:00
|
|
|
option (google.api.http) = {get: "/internal/eth/v1/node/health"};
|
2021-08-13 09:12:18 +00:00
|
|
|
}
|
|
|
|
}
|