Compare commits
	
		
			No commits in common. "099f0a0488bce8e59c9c9e9a5e9b1f24998f1633" and "2507356cae3453236fd5aaeae36e86fa4d5ea4a0" have entirely different histories.
		
	
	
		
			099f0a0488
			...
			2507356cae
		
	
		
| @ -18,9 +18,6 @@ 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 { | ||||||
| @ -29,11 +26,8 @@ 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 = 6; |   uint64 price_per_unit = 15; | ||||||
|   uint64 locked_nano = 7; |   uint64 locked_nano = 16; | ||||||
|   string hratls_pubkey = 8; |  | ||||||
|   optional bytes public_package_mr_enclave = 9; |  | ||||||
|   string app_name = 10; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| message AppResource { | message AppResource { | ||||||
| @ -67,57 +61,30 @@ 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 DeployApp (NewAppReq) returns (NewAppRes); |   rpc CreateApp (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_wallet = 2; |   string operator_pubkey = 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_no_of_port = 2; |   uint32 avail_ports = 2; | ||||||
|   uint32 avail_vcpus = 3; |   uint32 avail_ipv4 = 3; | ||||||
|   uint32 avail_memory_mb = 4; |   uint32 avail_ipv6 = 4; | ||||||
|   uint32 avail_storage_mb = 5; |   uint32 avail_vcpus = 5; | ||||||
|   uint32 max_ports_per_app = 6; |   uint32 avail_memory_mb = 6; | ||||||
|  |   uint32 avail_storage_gb = 7; | ||||||
|  |   uint32 max_ports_per_vm = 8; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| message BrainMessageApp { | message BrainMessageApp { | ||||||
|  | |||||||
| @ -40,19 +40,10 @@ pub struct AppDeployConfig { | |||||||
|     #[serde(default)] |     #[serde(default)] | ||||||
|     pub admin_pubkey: String, |     pub admin_pubkey: String, | ||||||
|     pub node_pubkey: String, |     pub node_pubkey: String, | ||||||
|     pub node_unit_price: u64, |     #[serde(default)] | ||||||
|  |     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 { | ||||||
| @ -63,11 +54,8 @@ 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, | ||||||
|             node_unit_price: pb_val.price_per_unit, |             price_per_unit: 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() |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -80,11 +68,8 @@ 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.node_unit_price, |             price_per_unit: val.price_per_unit, | ||||||
|             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