diff --git a/proto/sgx/brain.proto b/proto/sgx/brain.proto index 723d384..96098ed 100644 --- a/proto/sgx/brain.proto +++ b/proto/sgx/brain.proto @@ -8,7 +8,7 @@ message Empty { message AppContract { string uuid = 1; string package_url = 2; - string owner_wallet = 3; + string admin_pubkey = 3; string node_pubkey = 4; string public_ipv4 = 5; AppResource resource = 6; @@ -25,7 +25,9 @@ message NewAppReq { string node_pubkey = 2; AppResource resource = 3; string uuid = 4; - string owner_wallet = 5; + string admin_pubkey = 5; + uint64 price_per_unit = 15; + uint64 locked_nano = 16; } message AppResource { @@ -53,7 +55,7 @@ message DelAppReq { } message ListAppContractsReq { - string owner_wallet = 1; + string admin_pubkey = 1; // string uuid = 2; // string node_pubkey = 3; } @@ -66,7 +68,7 @@ service BrainAppCli { message RegisterAppNodeReq { string node_pubkey = 1; - string owner_pubkey = 2; + string operator_pubkey = 2; string main_ip = 3; string country = 4; string region = 5; diff --git a/src/lib.rs b/src/lib.rs index a4434b6..f2e5e64 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1 +1 @@ -pub mod sgx; \ No newline at end of file +pub mod sgx; diff --git a/src/sgx/types/brain.rs b/src/sgx/types/brain.rs index a810c34..a3d7135 100644 --- a/src/sgx/types/brain.rs +++ b/src/sgx/types/brain.rs @@ -38,8 +38,10 @@ pub struct AppDeployConfig { #[serde(default)] pub uuid: String, #[serde(default)] - pub owner_wallet: String, + pub admin_pubkey: String, pub node_pubkey: String, + pub price_per_unit: u64, + pub locked_nano: u64, } impl From for AppDeployConfig { @@ -48,8 +50,10 @@ impl From for AppDeployConfig { package_url: pb_val.package_url, resource: pb_val.resource.map(Resource::from).unwrap_or_default(), uuid: pb_val.uuid, - owner_wallet: pb_val.owner_wallet, + admin_pubkey: pb_val.admin_pubkey, node_pubkey: pb_val.node_pubkey, + price_per_unit: pb_val.price_per_unit, + locked_nano: pb_val.locked_nano, } } } @@ -60,8 +64,10 @@ impl From for NewAppReq { package_url: val.package_url, resource: Some(val.resource.into()), uuid: val.uuid, - owner_wallet: val.owner_wallet, + admin_pubkey: val.admin_pubkey, node_pubkey: val.node_pubkey, + price_per_unit: val.price_per_unit, + locked_nano: val.locked_nano, } } }