|
| 1 | +// copied from https://github.com/ava-labs/avalanchego/blob/v1.7.10/proto/vm/vm.proto |
| 2 | + |
| 3 | +syntax = "proto3"; |
| 4 | + |
| 5 | +package vm; |
| 6 | + |
| 7 | +import "google/protobuf/empty.proto"; |
| 8 | +import "io/prometheus/client/metrics.proto"; |
| 9 | + |
| 10 | +option go_package = "github.com/ava-labs/avalanchego/proto/pb/vm"; |
| 11 | + |
| 12 | +service VM { |
| 13 | + rpc Initialize(InitializeRequest) returns (InitializeResponse); |
| 14 | + rpc SetState(SetStateRequest) returns (google.protobuf.Empty); |
| 15 | + rpc Shutdown(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 16 | + rpc CreateHandlers(google.protobuf.Empty) returns (CreateHandlersResponse); |
| 17 | + rpc CreateStaticHandlers(google.protobuf.Empty) returns (CreateStaticHandlersResponse); |
| 18 | + rpc Connected(ConnectedRequest) returns (google.protobuf.Empty); |
| 19 | + rpc Disconnected(DisconnectedRequest) returns (google.protobuf.Empty); |
| 20 | + rpc BuildBlock(google.protobuf.Empty) returns (BuildBlockResponse); |
| 21 | + rpc ParseBlock(ParseBlockRequest) returns (ParseBlockResponse); |
| 22 | + rpc GetBlock(GetBlockRequest) returns (GetBlockResponse); |
| 23 | + rpc SetPreference(SetPreferenceRequest) returns (google.protobuf.Empty); |
| 24 | + rpc Health(HealthRequest) returns (HealthResponse); |
| 25 | + rpc Version(google.protobuf.Empty) returns (VersionResponse); |
| 26 | + rpc AppRequest(AppRequestMsg) returns (google.protobuf.Empty); |
| 27 | + rpc AppRequestFailed(AppRequestFailedMsg) returns (google.protobuf.Empty); |
| 28 | + rpc AppResponse(AppResponseMsg) returns (google.protobuf.Empty); |
| 29 | + rpc AppGossip(AppGossipMsg) returns (google.protobuf.Empty); |
| 30 | + rpc Gather(google.protobuf.Empty) returns (GatherResponse); |
| 31 | + rpc BlockVerify(BlockVerifyRequest) returns (BlockVerifyResponse); |
| 32 | + rpc BlockAccept(BlockAcceptRequest) returns (google.protobuf.Empty); |
| 33 | + rpc BlockReject(BlockRejectRequest) returns (google.protobuf.Empty); |
| 34 | + rpc GetAncestors(GetAncestorsRequest) returns (GetAncestorsResponse); |
| 35 | + rpc BatchedParseBlock(BatchedParseBlockRequest) returns (BatchedParseBlockResponse); |
| 36 | + rpc VerifyHeightIndex(google.protobuf.Empty) returns (VerifyHeightIndexResponse); |
| 37 | + rpc GetBlockIDAtHeight(GetBlockIDAtHeightRequest) returns (GetBlockIDAtHeightResponse); |
| 38 | +} |
| 39 | + |
| 40 | +message InitializeRequest { |
| 41 | + // reserved for backward compatibility |
| 42 | + // avalanchego <=v1.7.9 used the fields "11-19" as an id to |
| 43 | + // identify the gRPC server address which served the messenger, |
| 44 | + // keystore, shared memory, blockchain alias, subnet alias, and |
| 45 | + // appSender services via the now removed service broker |
| 46 | + reserved 11 to 19; |
| 47 | + uint32 network_id = 1; |
| 48 | + bytes subnet_id = 2; |
| 49 | + bytes chain_id = 3; |
| 50 | + bytes node_id = 4; |
| 51 | + bytes x_chain_id = 5; |
| 52 | + bytes avax_asset_id = 6; |
| 53 | + bytes genesis_bytes = 7; |
| 54 | + bytes upgrade_bytes = 8; |
| 55 | + bytes config_bytes = 9; |
| 56 | + repeated VersionedDBServer db_servers = 10; |
| 57 | + // server_addr is the address of the gRPC server which serves |
| 58 | + // the messenger, keystore, shared memory, blockchain alias, |
| 59 | + // subnet alias, and appSender services |
| 60 | + string server_addr = 20; |
| 61 | +} |
| 62 | + |
| 63 | +message SetStateRequest { |
| 64 | + uint32 state = 1; |
| 65 | +} |
| 66 | + |
| 67 | +message InitializeResponse { |
| 68 | + bytes last_accepted_id = 1; |
| 69 | + bytes last_accepted_parent_id = 2; |
| 70 | + uint32 status = 3; |
| 71 | + uint64 height = 4; |
| 72 | + bytes bytes = 5; |
| 73 | + bytes timestamp = 6; |
| 74 | +} |
| 75 | + |
| 76 | +message VersionedDBServer { |
| 77 | + // reserved for backward compatibility |
| 78 | + // avalanchego <=v1.7.9 used the field "1" as an id to identify the gRPC server |
| 79 | + // address which served the Database service via the now removed service broker |
| 80 | + reserved 1; |
| 81 | + string version = 2; |
| 82 | + // server_addr is the address of the gRPC server which serves the |
| 83 | + // Database service |
| 84 | + string server_addr = 3; |
| 85 | +} |
| 86 | + |
| 87 | +message CreateHandlersResponse { |
| 88 | + repeated Handler handlers = 1; |
| 89 | +} |
| 90 | + |
| 91 | +message CreateStaticHandlersResponse { |
| 92 | + repeated Handler handlers = 1; |
| 93 | +} |
| 94 | + |
| 95 | +message Handler { |
| 96 | + // reserved for backward compatibility |
| 97 | + // avalanchego <=v1.7.9 used the field "3" as an id to identify the gRPC server |
| 98 | + // address which served the HTTP service via the now removed service broker |
| 99 | + reserved 3; |
| 100 | + string prefix = 1; |
| 101 | + uint32 lock_options = 2; |
| 102 | + // server_addr is the address of the gRPC server which serves the |
| 103 | + // HTTP service |
| 104 | + string server_addr = 4; |
| 105 | +} |
| 106 | + |
| 107 | +message BuildBlockResponse { |
| 108 | + bytes id = 1; |
| 109 | + bytes parent_id = 2; |
| 110 | + bytes bytes = 3; |
| 111 | + uint64 height = 4; |
| 112 | + bytes timestamp = 5; |
| 113 | + // status is always processing |
| 114 | +} |
| 115 | + |
| 116 | +message ParseBlockRequest { |
| 117 | + bytes bytes = 1; |
| 118 | +} |
| 119 | + |
| 120 | +message ParseBlockResponse { |
| 121 | + bytes id = 1; |
| 122 | + bytes parent_id = 2; |
| 123 | + uint32 status = 3; |
| 124 | + uint64 height = 4; |
| 125 | + bytes timestamp = 5; |
| 126 | +} |
| 127 | + |
| 128 | +message GetBlockRequest { |
| 129 | + bytes id = 1; |
| 130 | +} |
| 131 | + |
| 132 | +message GetBlockResponse { |
| 133 | + bytes parent_id = 1; |
| 134 | + bytes bytes = 2; |
| 135 | + uint32 status = 3; |
| 136 | + uint64 height = 4; |
| 137 | + bytes timestamp = 5; |
| 138 | +} |
| 139 | + |
| 140 | +message SetPreferenceRequest { |
| 141 | + bytes id = 1; |
| 142 | +} |
| 143 | + |
| 144 | +message BlockVerifyRequest { |
| 145 | + bytes bytes = 1; |
| 146 | +} |
| 147 | + |
| 148 | +message BlockVerifyResponse { |
| 149 | + bytes timestamp = 1; |
| 150 | +} |
| 151 | + |
| 152 | +message BlockAcceptRequest { |
| 153 | + bytes id = 1; |
| 154 | +} |
| 155 | + |
| 156 | +message BlockRejectRequest { |
| 157 | + bytes id = 1; |
| 158 | +} |
| 159 | + |
| 160 | +message HealthRequest { |
| 161 | + // grpc_checks is a map [name]=address of the gRPC servers to perform the |
| 162 | + // health check agaist. |
| 163 | + map<string, string> grpc_checks = 1; |
| 164 | +} |
| 165 | + |
| 166 | +message HealthResponse { |
| 167 | + string details = 1; |
| 168 | +} |
| 169 | + |
| 170 | +message VersionResponse { |
| 171 | + string version = 1; |
| 172 | +} |
| 173 | + |
| 174 | +message AppRequestMsg { |
| 175 | + // The node that sent us this request |
| 176 | + bytes node_id = 1; |
| 177 | + // The ID of this request |
| 178 | + uint32 request_id = 2; |
| 179 | + // deadline for this request |
| 180 | + bytes deadline = 3; |
| 181 | + // The request body |
| 182 | + bytes request = 4; |
| 183 | +} |
| 184 | + |
| 185 | +message AppRequestFailedMsg { |
| 186 | + // The node that we failed to get a response from |
| 187 | + bytes node_id = 1; |
| 188 | + // The ID of the request we sent and didn't get a response to |
| 189 | + uint32 request_id = 2; |
| 190 | +} |
| 191 | + |
| 192 | +message AppResponseMsg { |
| 193 | + // The node that we got a response from |
| 194 | + bytes node_id = 1; |
| 195 | + // Request ID of request that this is in response to |
| 196 | + uint32 request_id = 2; |
| 197 | + // The response body |
| 198 | + bytes response = 3; |
| 199 | +} |
| 200 | + |
| 201 | +message AppGossipMsg { |
| 202 | + // The node that sent us a gossip message |
| 203 | + bytes node_id = 1; |
| 204 | + // The message body |
| 205 | + bytes msg = 2; |
| 206 | +} |
| 207 | + |
| 208 | +message ConnectedRequest { |
| 209 | + bytes node_id = 1; |
| 210 | + string version = 2; |
| 211 | +} |
| 212 | + |
| 213 | +message DisconnectedRequest { |
| 214 | + bytes node_id = 1; |
| 215 | +} |
| 216 | + |
| 217 | +message GetAncestorsRequest { |
| 218 | + bytes blk_id = 1; |
| 219 | + int32 max_blocks_num = 2; |
| 220 | + int32 max_blocks_size = 3; |
| 221 | + int64 max_blocks_retrival_time = 4; |
| 222 | +} |
| 223 | + |
| 224 | +message GetAncestorsResponse { |
| 225 | + repeated bytes blks_bytes = 1; |
| 226 | +} |
| 227 | + |
| 228 | +message BatchedParseBlockRequest { |
| 229 | + repeated bytes request = 1; |
| 230 | +} |
| 231 | + |
| 232 | +message BatchedParseBlockResponse { |
| 233 | + repeated ParseBlockResponse response = 1; |
| 234 | +} |
| 235 | + |
| 236 | +// HeightIndexedVM related messages |
| 237 | +message VerifyHeightIndexResponse { |
| 238 | + uint32 err = 1; |
| 239 | +} |
| 240 | + |
| 241 | +message GetBlockIDAtHeightRequest { |
| 242 | + uint64 height = 1; |
| 243 | +} |
| 244 | + |
| 245 | +message GetBlockIDAtHeightResponse { |
| 246 | + bytes blk_id = 1; |
| 247 | + uint32 err = 2; |
| 248 | +} |
| 249 | + |
| 250 | +message GatherResponse { |
| 251 | + repeated io.prometheus.client.MetricFamily metric_families = 1; |
| 252 | +} |
0 commit comments