syntax = "proto3"; package vm; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "io/prometheus/client/metrics.proto"; option go_package = "github.com/ava-labs/avalanchego/proto/pb/vm"; service VM { // ChainVM rpc Initialize(InitializeRequest) returns (InitializeResponse); rpc SetState(SetStateRequest) returns (SetStateResponse); rpc Shutdown(google.protobuf.Empty) returns (google.protobuf.Empty); rpc CreateHandlers(google.protobuf.Empty) returns (CreateHandlersResponse); rpc CreateStaticHandlers(google.protobuf.Empty) returns (CreateStaticHandlersResponse); rpc Connected(ConnectedRequest) returns (google.protobuf.Empty); rpc Disconnected(DisconnectedRequest) returns (google.protobuf.Empty); rpc BuildBlock(google.protobuf.Empty) returns (BuildBlockResponse); rpc ParseBlock(ParseBlockRequest) returns (ParseBlockResponse); rpc GetBlock(GetBlockRequest) returns (GetBlockResponse); rpc SetPreference(SetPreferenceRequest) returns (google.protobuf.Empty); rpc Health(google.protobuf.Empty) returns (HealthResponse); rpc Version(google.protobuf.Empty) returns (VersionResponse); rpc AppRequest(AppRequestMsg) returns (google.protobuf.Empty); rpc AppRequestFailed(AppRequestFailedMsg) returns (google.protobuf.Empty); rpc AppResponse(AppResponseMsg) returns (google.protobuf.Empty); rpc AppGossip(AppGossipMsg) returns (google.protobuf.Empty); rpc Gather(google.protobuf.Empty) returns (GatherResponse); rpc CrossChainAppRequest(CrossChainAppRequestMsg) returns (google.protobuf.Empty); rpc CrossChainAppRequestFailed(CrossChainAppRequestFailedMsg) returns (google.protobuf.Empty); rpc CrossChainAppResponse(CrossChainAppResponseMsg) returns (google.protobuf.Empty); // BatchedChainVM rpc GetAncestors(GetAncestorsRequest) returns (GetAncestorsResponse); rpc BatchedParseBlock(BatchedParseBlockRequest) returns (BatchedParseBlockResponse); // HeightIndexedChainVM rpc VerifyHeightIndex(google.protobuf.Empty) returns (VerifyHeightIndexResponse); rpc GetBlockIDAtHeight(GetBlockIDAtHeightRequest) returns (GetBlockIDAtHeightResponse); // StateSyncableVM rpc StateSyncEnabled(google.protobuf.Empty) returns (StateSyncEnabledResponse); rpc GetOngoingSyncStateSummary(google.protobuf.Empty) returns (GetOngoingSyncStateSummaryResponse); rpc GetLastStateSummary(google.protobuf.Empty) returns (GetLastStateSummaryResponse); rpc ParseStateSummary(ParseStateSummaryRequest) returns (ParseStateSummaryResponse); rpc GetStateSummary(GetStateSummaryRequest) returns (GetStateSummaryResponse); // Block rpc BlockVerify(BlockVerifyRequest) returns (BlockVerifyResponse); rpc BlockAccept(BlockAcceptRequest) returns (google.protobuf.Empty); rpc BlockReject(BlockRejectRequest) returns (google.protobuf.Empty); // StateSummary rpc StateSummaryAccept(StateSummaryAcceptRequest) returns (StateSummaryAcceptResponse); } message InitializeRequest { uint32 network_id = 1; bytes subnet_id = 2; bytes chain_id = 3; bytes node_id = 4; bytes x_chain_id = 5; bytes avax_asset_id = 6; bytes genesis_bytes = 7; bytes upgrade_bytes = 8; bytes config_bytes = 9; repeated VersionedDBServer db_servers = 10; // server_addr is the address of the gRPC server which serves // the messenger, keystore, shared memory, blockchain alias, // subnet alias, and appSender services string server_addr = 11; } message InitializeResponse { bytes last_accepted_id = 1; bytes last_accepted_parent_id = 2; uint64 height = 3; bytes bytes = 4; google.protobuf.Timestamp timestamp = 5; } message VersionedDBServer { string version = 1; // server_addr is the address of the gRPC server which serves the // Database service string server_addr = 2; } message SetStateRequest { uint32 state = 1; } message SetStateResponse { bytes last_accepted_id = 1; bytes last_accepted_parent_id = 2; uint64 height = 3; bytes bytes = 4; google.protobuf.Timestamp timestamp = 5; } message CreateHandlersResponse { repeated Handler handlers = 1; } message CreateStaticHandlersResponse { repeated Handler handlers = 1; } message Handler { string prefix = 1; uint32 lock_options = 2; // server_addr is the address of the gRPC server which serves the // HTTP service string server_addr = 3; } message BuildBlockResponse { bytes id = 1; bytes parent_id = 2; bytes bytes = 3; uint64 height = 4; google.protobuf.Timestamp timestamp = 5; // status is always processing } message ParseBlockRequest { bytes bytes = 1; } message ParseBlockResponse { bytes id = 1; bytes parent_id = 2; uint32 status = 3; uint64 height = 4; google.protobuf.Timestamp timestamp = 5; } message GetBlockRequest { bytes id = 1; } message GetBlockResponse { bytes parent_id = 1; bytes bytes = 2; uint32 status = 3; uint64 height = 4; google.protobuf.Timestamp timestamp = 5; // used to propagate database.ErrNotFound through RPC uint32 err = 6; } message SetPreferenceRequest { bytes id = 1; } message BlockVerifyRequest { bytes bytes = 1; } message BlockVerifyResponse { google.protobuf.Timestamp timestamp = 1; } message BlockAcceptRequest { bytes id = 1; } message BlockRejectRequest { bytes id = 1; } message HealthResponse { bytes details = 1; } message VersionResponse { string version = 1; } message AppRequestMsg { // The node that sent us this request bytes node_id = 1; // The ID of this request uint32 request_id = 2; // deadline for this request google.protobuf.Timestamp deadline = 3; // The request body bytes request = 4; } message AppRequestFailedMsg { // The node that we failed to get a response from bytes node_id = 1; // The ID of the request we sent and didn't get a response to uint32 request_id = 2; } message AppResponseMsg { // The node that we got a response from bytes node_id = 1; // Request ID of request that this is in response to uint32 request_id = 2; // The response body bytes response = 3; } message AppGossipMsg { // The node that sent us a gossip message bytes node_id = 1; // The message body bytes msg = 2; } message CrossChainAppRequestMsg { // The chain that sent us this request bytes chain_id = 1; // The ID of this request uint32 request_id = 2; // deadline for this request google.protobuf.Timestamp deadline = 3; // The request body bytes request = 4; } message CrossChainAppRequestFailedMsg { // The chain that we failed to get a response from bytes chain_id = 1; // The ID of the request we sent and didn't get a response to uint32 request_id = 2; } message CrossChainAppResponseMsg { // The chain that we got a response from bytes chain_id = 1; // Request ID of request that this is in response to uint32 request_id = 2; // The response body bytes response = 3; } message ConnectedRequest { bytes node_id = 1; string version = 2; } message DisconnectedRequest { bytes node_id = 1; } message GetAncestorsRequest { bytes blk_id = 1; int32 max_blocks_num = 2; int32 max_blocks_size = 3; int64 max_blocks_retrival_time = 4; } message GetAncestorsResponse { repeated bytes blks_bytes = 1; } message BatchedParseBlockRequest { repeated bytes request = 1; } message BatchedParseBlockResponse { repeated ParseBlockResponse response = 1; } message VerifyHeightIndexResponse { uint32 err = 1; } message GetBlockIDAtHeightRequest { uint64 height = 1; } message GetBlockIDAtHeightResponse { bytes blk_id = 1; uint32 err = 2; } message GatherResponse { repeated io.prometheus.client.MetricFamily metric_families = 1; } message StateSyncEnabledResponse { bool enabled = 1; uint32 err = 2; } message GetOngoingSyncStateSummaryResponse { bytes id = 1; uint64 height = 2; bytes bytes = 3; uint32 err = 4; } message GetLastStateSummaryResponse { bytes id = 1; uint64 height = 2; bytes bytes = 3; uint32 err = 4; } message ParseStateSummaryRequest { bytes bytes = 1; } message ParseStateSummaryResponse { bytes id = 1; uint64 height = 2; uint32 err = 3; } message GetStateSummaryRequest { uint64 height = 1; } message GetStateSummaryResponse { bytes id = 1; bytes bytes = 2; uint32 err = 3; } message StateSummaryAcceptRequest { bytes bytes = 1; } message StateSummaryAcceptResponse { bool accepted = 1; uint32 err = 2; }