mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-10 13:01:21 +00:00
7554428884
* Splitting sentry and downloader - the beginning * A bit more * More on sentry * More gRPC * Sentry and downloader separated * Update binding for stable version of grpc * Better bufferSize flag * Fix lint * Send pelanties * Fix lint * Remove hard-coded tips on connect * Tidy the logs a bit * Deal with hardTips on Recovery * Print hard tips * Hide empty anchors * Request headers after receiving a message * Better waking up * Print hard-coded block numbers * Print outgoing requests * Debug logging * In the middle protection * Sentry not to lose peers when core disconnects
51 lines
1.2 KiB
Protocol Buffer
51 lines
1.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
import "google/protobuf/empty.proto";
|
|
|
|
package proto;
|
|
|
|
option go_package = "./proto;proto";
|
|
option java_multiple_files = true;
|
|
option java_package = "io.turbo-geth.p2p";
|
|
option java_outer_classname = "P2pSentry";
|
|
|
|
enum OutboundMessageId { GetBlockHeaders = 0; GetBlockBodies = 1; }
|
|
|
|
message OutboundMessageData {
|
|
OutboundMessageId id = 1;
|
|
bytes data = 2;
|
|
}
|
|
|
|
message SendMessageByMinBlockRequest {
|
|
OutboundMessageData data = 1;
|
|
uint64 min_block = 2;
|
|
}
|
|
|
|
message SendMessageByIdRequest {
|
|
OutboundMessageData data = 1;
|
|
bytes peer_id = 2;
|
|
}
|
|
|
|
message SendMessageToRandomPeersRequest {
|
|
OutboundMessageData data = 1;
|
|
uint64 max_peers = 2;
|
|
}
|
|
|
|
message SentPeers { repeated bytes peers = 1; }
|
|
|
|
enum PenaltyKind { Kick = 0; }
|
|
|
|
message PenalizePeerRequest {
|
|
bytes peer_id = 1;
|
|
PenaltyKind penalty = 2;
|
|
}
|
|
|
|
service Sentry {
|
|
rpc PenalizePeer(PenalizePeerRequest) returns(google.protobuf.Empty);
|
|
rpc SendMessageByMinBlock(SendMessageByMinBlockRequest) returns(SentPeers);
|
|
rpc SendMessageById(SendMessageByIdRequest) returns(SentPeers);
|
|
rpc SendMessageToRandomPeers(SendMessageToRandomPeersRequest)
|
|
returns(SentPeers);
|
|
rpc SendMessageToAll(OutboundMessageData) returns(SentPeers);
|
|
}
|