Compare commits
10 Commits
2507356cae
...
099f0a0488
| Author | SHA1 | Date | |
|---|---|---|---|
| 099f0a0488 | |||
| d6ffc0d4cb | |||
| a9dcfbe9fe | |||
| 8230e1f831 | |||
| a734b392b7 | |||
| dc1e2dd0cd | |||
| b8f37dec18 | |||
| aefd292807 | |||
| 9ba3bc3186 | |||
| a6baa4059d |
@ -18,6 +18,9 @@ message AppContract {
|
|||||||
uint64 nano_per_minute = 10;
|
uint64 nano_per_minute = 10;
|
||||||
uint64 locked_nano = 11;
|
uint64 locked_nano = 11;
|
||||||
string collected_at = 12;
|
string collected_at = 12;
|
||||||
|
string hratls_pubkey = 13;
|
||||||
|
optional bytes public_package_mr_enclave = 14;
|
||||||
|
string app_name = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
message NewAppReq {
|
message NewAppReq {
|
||||||
@ -26,8 +29,11 @@ message NewAppReq {
|
|||||||
AppResource resource = 3;
|
AppResource resource = 3;
|
||||||
string uuid = 4;
|
string uuid = 4;
|
||||||
string admin_pubkey = 5;
|
string admin_pubkey = 5;
|
||||||
uint64 price_per_unit = 15;
|
uint64 price_per_unit = 6;
|
||||||
uint64 locked_nano = 16;
|
uint64 locked_nano = 7;
|
||||||
|
string hratls_pubkey = 8;
|
||||||
|
optional bytes public_package_mr_enclave = 9;
|
||||||
|
string app_name = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AppResource {
|
message AppResource {
|
||||||
@ -61,30 +67,57 @@ message ListAppContractsReq {
|
|||||||
// string node_pubkey = 3;
|
// string node_pubkey = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message AppNodeFilters {
|
||||||
|
uint32 vcpus = 1;
|
||||||
|
uint32 memory_mb = 2;
|
||||||
|
uint32 storage_mb = 3;
|
||||||
|
string country = 4;
|
||||||
|
string region = 5;
|
||||||
|
string city = 6;
|
||||||
|
string ip = 7;
|
||||||
|
string node_pubkey = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AppNodeListResp {
|
||||||
|
string operator = 1;
|
||||||
|
string node_pubkey = 2;
|
||||||
|
string country = 3;
|
||||||
|
string region = 4;
|
||||||
|
string city = 5;
|
||||||
|
string ip = 6; // required for latency test
|
||||||
|
uint64 price = 7; // nanoLP per unit per minute
|
||||||
|
repeated string reports = 8; // TODO: this will become an enum
|
||||||
|
}
|
||||||
|
|
||||||
service BrainAppCli {
|
service BrainAppCli {
|
||||||
rpc CreateApp (NewAppReq) returns (NewAppRes);
|
rpc DeployApp (NewAppReq) returns (NewAppRes);
|
||||||
rpc DeleteApp (DelAppReq) returns (Empty);
|
rpc DeleteApp (DelAppReq) returns (Empty);
|
||||||
rpc ListAppContracts (ListAppContractsReq) returns (stream AppContract);
|
rpc ListAppContracts (ListAppContractsReq) returns (stream AppContract);
|
||||||
|
rpc ListAppNodes (AppNodeFilters) returns (stream AppNodeListResp);
|
||||||
|
rpc GetOneAppNode (AppNodeFilters) returns (AppNodeListResp);
|
||||||
|
|
||||||
|
// super admin commands
|
||||||
|
rpc ListAllAppContracts (Empty) returns (stream AppContract);
|
||||||
}
|
}
|
||||||
|
|
||||||
message RegisterAppNodeReq {
|
message RegisterAppNodeReq {
|
||||||
string node_pubkey = 1;
|
string node_pubkey = 1;
|
||||||
string operator_pubkey = 2;
|
string operator_wallet = 2;
|
||||||
string main_ip = 3;
|
string main_ip = 3;
|
||||||
string country = 4;
|
string country = 4;
|
||||||
string region = 5;
|
string region = 5;
|
||||||
string city = 6;
|
string city = 6;
|
||||||
|
uint64 price = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AppNodeResources {
|
message AppNodeResources {
|
||||||
string node_pubkey = 1;
|
string node_pubkey = 1;
|
||||||
uint32 avail_ports = 2;
|
uint32 avail_no_of_port = 2;
|
||||||
uint32 avail_ipv4 = 3;
|
uint32 avail_vcpus = 3;
|
||||||
uint32 avail_ipv6 = 4;
|
uint32 avail_memory_mb = 4;
|
||||||
uint32 avail_vcpus = 5;
|
uint32 avail_storage_mb = 5;
|
||||||
uint32 avail_memory_mb = 6;
|
uint32 max_ports_per_app = 6;
|
||||||
uint32 avail_storage_gb = 7;
|
|
||||||
uint32 max_ports_per_vm = 8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message BrainMessageApp {
|
message BrainMessageApp {
|
||||||
|
|||||||
@ -40,10 +40,19 @@ pub struct AppDeployConfig {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub admin_pubkey: String,
|
pub admin_pubkey: String,
|
||||||
pub node_pubkey: String,
|
pub node_pubkey: String,
|
||||||
#[serde(default)]
|
pub node_unit_price: u64,
|
||||||
pub price_per_unit: u64,
|
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub locked_nano: u64,
|
pub locked_nano: u64,
|
||||||
|
#[serde(default)]
|
||||||
|
pub hratls_pubkey: String,
|
||||||
|
#[serde(default)]
|
||||||
|
pub public_package_mr_enclave: Option<Vec<u8>>,
|
||||||
|
|
||||||
|
pub hours: u64,
|
||||||
|
#[serde(default)]
|
||||||
|
pub private_package: bool,
|
||||||
|
#[serde(default)]
|
||||||
|
pub app_name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<NewAppReq> for AppDeployConfig {
|
impl From<NewAppReq> for AppDeployConfig {
|
||||||
@ -54,8 +63,11 @@ impl From<NewAppReq> for AppDeployConfig {
|
|||||||
uuid: pb_val.uuid,
|
uuid: pb_val.uuid,
|
||||||
admin_pubkey: pb_val.admin_pubkey,
|
admin_pubkey: pb_val.admin_pubkey,
|
||||||
node_pubkey: pb_val.node_pubkey,
|
node_pubkey: pb_val.node_pubkey,
|
||||||
price_per_unit: pb_val.price_per_unit,
|
node_unit_price: pb_val.price_per_unit,
|
||||||
locked_nano: pb_val.locked_nano,
|
locked_nano: pb_val.locked_nano,
|
||||||
|
hratls_pubkey: pb_val.hratls_pubkey,
|
||||||
|
public_package_mr_enclave: pb_val.public_package_mr_enclave,
|
||||||
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -68,8 +80,11 @@ impl From<AppDeployConfig> for NewAppReq {
|
|||||||
uuid: val.uuid,
|
uuid: val.uuid,
|
||||||
admin_pubkey: val.admin_pubkey,
|
admin_pubkey: val.admin_pubkey,
|
||||||
node_pubkey: val.node_pubkey,
|
node_pubkey: val.node_pubkey,
|
||||||
price_per_unit: val.price_per_unit,
|
price_per_unit: val.node_unit_price,
|
||||||
locked_nano: val.locked_nano,
|
locked_nano: val.locked_nano,
|
||||||
|
hratls_pubkey: val.hratls_pubkey,
|
||||||
|
public_package_mr_enclave: val.public_package_mr_enclave,
|
||||||
|
app_name: val.app_name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user