From 6765cafd68664dcfa269dd776039532eb4253e8a Mon Sep 17 00:00:00 2001 From: ghe0 Date: Sat, 12 Jul 2025 17:51:14 +0300 Subject: [PATCH] change uuid to vm_id and app_id --- proto/sgx/app.proto | 12 ++++++------ proto/shared/general.proto | 11 ++++++++++- proto/snp/vm.proto | 16 ++++++++-------- src/sgx/types/brain.rs | 6 +++--- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/proto/sgx/app.proto b/proto/sgx/app.proto index 7d86dcb..9919fa7 100644 --- a/proto/sgx/app.proto +++ b/proto/sgx/app.proto @@ -7,7 +7,7 @@ package app_proto; import "shared/common.proto"; message AppContract { - string uuid = 1; + string app_id = 1; string package_url = 2; string admin_pubkey = 3; string node_pubkey = 4; @@ -28,7 +28,7 @@ message NewAppReq { string package_url = 1; string node_pubkey = 2; AppResource resource = 3; - string uuid = 4; + string app_id = 4; string admin_pubkey = 5; uint64 price_per_unit = 6; uint64 locked_nano = 7; @@ -40,12 +40,12 @@ message NewAppReq { message AppResource { uint32 memory_mib = 1; uint32 disk_size_mib = 2; - uint32 vcpus = 3; + uint32 vcpus = 3; repeated uint32 ports = 4; } message NewAppRes { - string uuid = 1; + string app_id = 1; string ip_address = 2; repeated common_proto.MappedPort mapped_ports = 3; string error = 4; @@ -53,14 +53,14 @@ message NewAppRes { message DelAppReq { - string uuid= 1; + string app_id = 1; string admin_pubkey = 2; } message ListAppContractsReq { string admin_pubkey = 1; bool as_operator = 2; - string uuid = 3; + string app_id = 3; } diff --git a/proto/shared/general.proto b/proto/shared/general.proto index 93a94c5..a58a6ee 100644 --- a/proto/shared/general.proto +++ b/proto/shared/general.proto @@ -42,7 +42,7 @@ message RegOperatorReq { message KickReq { string operator_wallet = 1; - string contract_uuid = 2; + string contract_id = 2; string reason = 3; } @@ -71,6 +71,14 @@ message Account { uint64 tmp_locked = 3; } +message RecommendedVersions { + // the actual version of the brain, not a recommandation + string brain = 1; + // recommended versions for the other modules + string cli = 2; + string snp_daemon = 3; + string sgx_daemon = 4; +} service BrainGeneralCli { rpc GetBalance (common_proto.Pubkey) returns (AccountBalance); @@ -90,4 +98,5 @@ service BrainGeneralCli { returns (stream vm_proto.VmContract); rpc ListAllAppContracts (common_proto.Empty) returns (stream app_proto.AppContract); + rpc GetRecommendedVersions (common_proto.Empty) returns (RecommendedVersions); } diff --git a/proto/snp/vm.proto b/proto/snp/vm.proto index 00279a7..8391912 100644 --- a/proto/snp/vm.proto +++ b/proto/snp/vm.proto @@ -6,7 +6,7 @@ package vm_proto; import "shared/common.proto"; message VmContract { - string uuid = 1; + string vm_id = 1; string hostname = 2; string admin_pubkey = 3; string node_pubkey = 4; @@ -73,7 +73,7 @@ message VmNodeResources { } message NewVmReq { - string uuid = 1; + string vm_id = 1; string hostname = 2; string admin_pubkey = 3; string node_pubkey = 4; @@ -92,13 +92,13 @@ message NewVmReq { } message NewVmResp { - string uuid = 1; + string vm_id = 1; string error = 2; MeasurementArgs args = 3; } message UpdateVmReq { - string uuid = 1; + string vm_id = 1; string hostname = 2; string admin_pubkey = 3; uint32 disk_size_mib = 4; @@ -111,13 +111,13 @@ message UpdateVmReq { } message UpdateVmResp { - string uuid = 1; + string vm_id = 1; string error = 2; MeasurementArgs args = 3; } message DeleteVmReq { - string uuid = 1; + string vm_id = 1; string admin_pubkey = 2; } @@ -154,7 +154,7 @@ service BrainVmDaemon { message ListVmContractsReq { string wallet = 1; bool as_operator = 2; - string uuid = 3; + string vm_id = 3; } message VmNodeFilters { @@ -185,7 +185,7 @@ message VmNodeListResp { } message ExtendVmReq { - string uuid = 1; + string vm_id = 1; string admin_pubkey = 2; uint64 locked_nano = 3; } diff --git a/src/sgx/types/brain.rs b/src/sgx/types/brain.rs index 7e0116d..b1e7d67 100644 --- a/src/sgx/types/brain.rs +++ b/src/sgx/types/brain.rs @@ -39,7 +39,7 @@ pub struct AppDeployConfig { pub package_url: String, pub resource: Resource, #[serde(default)] - pub uuid: String, + pub app_id: String, #[serde(default)] pub admin_pubkey: String, pub node_pubkey: String, @@ -63,7 +63,7 @@ impl From for AppDeployConfig { Self { package_url: pb_val.package_url, resource: pb_val.resource.map(Resource::from).unwrap_or_default(), - uuid: pb_val.uuid, + app_id: pb_val.app_id, admin_pubkey: pb_val.admin_pubkey, node_pubkey: pb_val.node_pubkey, node_unit_price: pb_val.price_per_unit, @@ -80,7 +80,7 @@ impl From for NewAppReq { NewAppReq { package_url: val.package_url, resource: Some(val.resource.into()), - uuid: val.uuid, + app_id: val.app_id, admin_pubkey: val.admin_pubkey, node_pubkey: val.node_pubkey, price_per_unit: val.node_unit_price,