change uuid to vm_id and app_id

This commit is contained in:
ghe0 2025-07-12 17:51:14 +03:00
parent 4753a17fa2
commit 6765cafd68
Signed by: ghe0
GPG Key ID: 451028EE56A0FBB4
4 changed files with 27 additions and 18 deletions

@ -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;
}

@ -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);
}

@ -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;
}

@ -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<NewAppReq> 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<AppDeployConfig> 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,