fix detee-shared update
change owner_pubkey to operator_pubkey in HostConfig owner_wallet to admin_pubkey in App
This commit is contained in:
parent
ede3edccfe
commit
de6b5cb633
44
Cargo.lock
generated
44
Cargo.lock
generated
@ -410,12 +410,13 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "detee-shared"
|
name = "detee-shared"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+ssh://git@gitea.detee.cloud/noormohammedb/detee-shared?branch=stable_01#f2bc29149e32df09508519f3f88cdf880728e6dd"
|
source = "git+ssh://git@gitea.detee.cloud/noormohammedb/detee-shared?branch=stable_01#54abe74d42946b238c2ce44bb33f55778490b13d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"prost",
|
"prost",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_yml",
|
"serde_yaml",
|
||||||
|
"thiserror",
|
||||||
"tonic",
|
"tonic",
|
||||||
"tonic-build",
|
"tonic-build",
|
||||||
]
|
]
|
||||||
@ -1686,6 +1687,19 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_yaml"
|
||||||
|
version = "0.9.34+deprecated"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
|
||||||
|
dependencies = [
|
||||||
|
"indexmap 2.7.1",
|
||||||
|
"itoa",
|
||||||
|
"ryu",
|
||||||
|
"serde",
|
||||||
|
"unsafe-libyaml",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_yml"
|
name = "serde_yml"
|
||||||
version = "0.0.12"
|
version = "0.0.12"
|
||||||
@ -1857,6 +1871,26 @@ dependencies = [
|
|||||||
"windows-sys 0.59.0",
|
"windows-sys 0.59.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thiserror"
|
||||||
|
version = "2.0.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc"
|
||||||
|
dependencies = [
|
||||||
|
"thiserror-impl",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thiserror-impl"
|
||||||
|
version = "2.0.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tinystr"
|
name = "tinystr"
|
||||||
version = "0.7.6"
|
version = "0.7.6"
|
||||||
@ -2093,6 +2127,12 @@ version = "1.0.15"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243"
|
checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unsafe-libyaml"
|
||||||
|
version = "0.2.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "untrusted"
|
name = "untrusted"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
|
@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
pub struct HostConfig {
|
pub struct HostConfig {
|
||||||
pub brain_url: String,
|
pub brain_url: String,
|
||||||
pub host_ip_address: String,
|
pub host_ip_address: String,
|
||||||
pub owner_wallet: String,
|
pub operator_pubkey: String,
|
||||||
pub max_cores_per_app: u32,
|
pub max_cores_per_app: u32,
|
||||||
pub max_vcpu_reservation: u32,
|
pub max_vcpu_reservation: u32,
|
||||||
pub max_mem_reservation_mb: u32,
|
pub max_mem_reservation_mb: u32,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use detee_shared::types::brain::AppDeployConfig;
|
use detee_shared::sgx::types::brain::AppDeployConfig;
|
||||||
use detee_shared::types::brain::Resource as ResourceConfig;
|
use detee_shared::sgx::types::brain::Resource as ResourceConfig;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
@ -81,7 +81,7 @@ pub struct App {
|
|||||||
pub name: String,
|
pub name: String,
|
||||||
pub package_path: String,
|
pub package_path: String,
|
||||||
pub status: String,
|
pub status: String,
|
||||||
pub owner_wallet: String,
|
pub admin_pubkey: String,
|
||||||
pub app_resource: ResourceConfig,
|
pub app_resource: ResourceConfig,
|
||||||
pub mapped_ports: Vec<(u16, u16)>,
|
pub mapped_ports: Vec<(u16, u16)>,
|
||||||
}
|
}
|
||||||
@ -135,7 +135,7 @@ impl App {
|
|||||||
name: app_name,
|
name: app_name,
|
||||||
package_path: unarchive_dir,
|
package_path: unarchive_dir,
|
||||||
status: "running".to_string(),
|
status: "running".to_string(),
|
||||||
owner_wallet: new_app_req.owner_wallet,
|
admin_pubkey: new_app_req.admin_pubkey,
|
||||||
app_resource: new_app_req.resource,
|
app_resource: new_app_req.resource,
|
||||||
mapped_ports,
|
mapped_ports,
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use detee_shared::pb::brain::brain_app_daemon_client::BrainAppDaemonClient;
|
use detee_shared::sgx::pb::brain::brain_app_daemon_client::BrainAppDaemonClient;
|
||||||
use detee_shared::pb::brain::{
|
use detee_shared::sgx::pb::brain::{
|
||||||
AppContract, BrainMessageApp, DaemonAuth, DaemonMessageApp, RegisterAppNodeReq,
|
AppContract, BrainMessageApp, DaemonAuth, DaemonMessageApp, RegisterAppNodeReq,
|
||||||
};
|
};
|
||||||
use tokio::sync::mpsc::Receiver;
|
use tokio::sync::mpsc::Receiver;
|
||||||
@ -30,7 +30,7 @@ pub async fn register_node(config: &crate::HostConfig) -> Result<Vec<AppContract
|
|||||||
|
|
||||||
let req = RegisterAppNodeReq {
|
let req = RegisterAppNodeReq {
|
||||||
node_pubkey: PUBLIC_KEY.to_string(),
|
node_pubkey: PUBLIC_KEY.to_string(),
|
||||||
owner_pubkey: config.owner_wallet.clone(),
|
operator_pubkey: config.operator_pubkey.clone(),
|
||||||
main_ip: IP_INFO.ip.clone(),
|
main_ip: IP_INFO.ip.clone(),
|
||||||
city: IP_INFO.city.clone(),
|
city: IP_INFO.city.clone(),
|
||||||
region: IP_INFO.region.clone(),
|
region: IP_INFO.region.clone(),
|
||||||
@ -138,7 +138,7 @@ pub async fn send_messages(
|
|||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let rx_stream = ReceiverStream::new(rx);
|
let rx_stream = ReceiverStream::new(rx);
|
||||||
tx.send(DaemonMessageApp {
|
tx.send(DaemonMessageApp {
|
||||||
msg: Some(detee_shared::pb::brain::daemon_message_app::Msg::Auth(
|
msg: Some(detee_shared::sgx::pb::brain::daemon_message_app::Msg::Auth(
|
||||||
sign_stream_auth(contracts)?,
|
sign_stream_auth(contracts)?,
|
||||||
)),
|
)),
|
||||||
})
|
})
|
||||||
|
14
src/main.rs
14
src/main.rs
@ -7,13 +7,13 @@ pub mod utils;
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use data::App;
|
use data::App;
|
||||||
use detee_shared::pb::brain::brain_message_app;
|
use detee_shared::sgx::pb::brain::brain_message_app;
|
||||||
use detee_shared::pb::brain::AppContract;
|
use detee_shared::sgx::pb::brain::AppContract;
|
||||||
use detee_shared::pb::brain::BrainMessageApp;
|
use detee_shared::sgx::pb::brain::BrainMessageApp;
|
||||||
use detee_shared::pb::brain::DaemonMessageApp;
|
use detee_shared::sgx::pb::brain::DaemonMessageApp;
|
||||||
use detee_shared::pb::brain::MappedPort;
|
use detee_shared::sgx::pb::brain::MappedPort;
|
||||||
use detee_shared::pb::brain::NewAppRes;
|
use detee_shared::sgx::pb::brain::NewAppRes;
|
||||||
use detee_shared::types::brain::AppDeployConfig;
|
use detee_shared::sgx::types::brain::AppDeployConfig;
|
||||||
use log::info;
|
use log::info;
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
Loading…
Reference in New Issue
Block a user