github.com/shrimpyuk/bor@v0.2.15-0.20220224151350-fb4ec6020bae/internal/cli/server/proto/server.proto (about) 1 syntax = "proto3"; 2 3 package proto; 4 5 import "google/protobuf/empty.proto"; 6 7 option go_package = "/command/server/proto"; 8 9 service Bor { 10 rpc Pprof(PprofRequest) returns (stream PprofResponse); 11 12 rpc PeersAdd(PeersAddRequest) returns (PeersAddResponse); 13 14 rpc PeersRemove(PeersRemoveRequest) returns (PeersRemoveResponse); 15 16 rpc PeersList(PeersListRequest) returns (PeersListResponse); 17 18 rpc PeersStatus(PeersStatusRequest) returns (PeersStatusResponse); 19 20 rpc ChainSetHead(ChainSetHeadRequest) returns (ChainSetHeadResponse); 21 22 rpc Status(google.protobuf.Empty) returns (StatusResponse); 23 24 rpc ChainWatch(ChainWatchRequest) returns (stream ChainWatchResponse); 25 } 26 27 message ChainWatchRequest { 28 29 } 30 31 message ChainWatchResponse { 32 repeated BlockStub oldchain = 1; 33 repeated BlockStub newchain = 2; 34 string type = 3; 35 } 36 37 message BlockStub { 38 string hash = 1; 39 uint64 number = 2; 40 } 41 42 message PeersAddRequest { 43 string enode = 1; 44 bool trusted = 2; 45 } 46 47 message PeersAddResponse { 48 } 49 50 message PeersRemoveRequest { 51 string enode = 1; 52 bool trusted = 2; 53 } 54 55 message PeersRemoveResponse { 56 } 57 58 message PeersListRequest { 59 } 60 61 message PeersListResponse { 62 repeated Peer peers = 1; 63 } 64 65 message PeersStatusRequest { 66 string enode = 1; 67 } 68 69 message PeersStatusResponse { 70 Peer peer = 1; 71 } 72 73 message Peer { 74 string id = 1; 75 string enode = 2; 76 string enr = 3; 77 repeated string caps = 4; 78 string name = 5; 79 bool trusted = 6; 80 bool static = 7; 81 } 82 83 message ChainSetHeadRequest { 84 uint64 number = 1; 85 } 86 87 message ChainSetHeadResponse { 88 } 89 90 message StatusResponse { 91 Header currentBlock = 1; 92 Header currentHeader = 2; 93 int64 numPeers = 3; 94 string syncMode = 4; 95 Syncing syncing = 5; 96 repeated Fork forks = 6; 97 98 message Fork { 99 string name = 1; 100 int64 block = 2; 101 bool disabled = 3; 102 } 103 104 message Syncing { 105 int64 startingBlock = 1; 106 int64 highestBlock = 2; 107 int64 currentBlock = 3; 108 } 109 } 110 111 message Header { 112 string hash = 1; 113 uint64 number = 2; 114 } 115 116 message PprofRequest { 117 Type type = 1; 118 119 string profile = 2; 120 121 int64 seconds = 3; 122 123 enum Type { 124 LOOKUP = 0; 125 CPU = 1; 126 TRACE = 2; 127 } 128 } 129 130 message PprofResponse { 131 oneof event { 132 Open open = 1; 133 Input input = 2; 134 google.protobuf.Empty eof = 3; 135 } 136 137 message Open { 138 map<string, string> headers = 1; 139 int64 size = 2; 140 } 141 142 message Input { 143 bytes data = 1; 144 } 145 }