diff --git a/build.rs b/build.rs index 6f0fb28b..2e1c40b5 100644 --- a/build.rs +++ b/build.rs @@ -153,21 +153,6 @@ fn main() { let entry_path = entry.unwrap().path(); let package_name = entry_path.file_name().unwrap().to_str().unwrap(); - if ![ - "app_store", - "chess", - "homepage", - "http_proxy", - "key_value", - "qns_indexer", - "sqlite", - "terminal", - ] - .contains(&package_name) - { - continue; - } - // If Cargo.toml is present, build the app let parent_pkg_path = format!("{}/pkg", entry_path.display()); if entry_path.join("Cargo.toml").exists() { diff --git a/modules/app_store/app_store/src/lib.rs b/modules/app_store/app_store/src/lib.rs index c75ea539..563b635b 100644 --- a/modules/app_store/app_store/src/lib.rs +++ b/modules/app_store/app_store/src/lib.rs @@ -4,8 +4,8 @@ use std::collections::{HashMap, HashSet}; use uqbar_process_lib::kernel_types as kt; use uqbar_process_lib::uqbar::process::standard as wit; use uqbar_process_lib::{ - get_capability, get_payload, get_typed_state, grant_messaging, receive, set_state, Address, - Message, NodeId, PackageId, ProcessId, Request, Response, + get_capability, get_payload, get_typed_state, grant_messaging, println, receive, set_state, + Address, Message, NodeId, PackageId, ProcessId, Request, Response, }; wit_bindgen::generate!({ @@ -158,15 +158,9 @@ pub enum InstallResponse { Failure, } -// -// app store init() -// - impl Guest for Component { fn init(our: String) { let our = Address::from_str(&our).unwrap(); - assert_eq!(our.process, "main:app_store:uqbar"); - // begin by granting messaging capabilities to http_server and terminal, // so that they can send us requests. grant_messaging( @@ -176,16 +170,14 @@ impl Guest for Component { ProcessId::from_str("terminal:terminal:uqbar").unwrap(), ]), ); - println!("app_store main proc: start"); + println!("{}: start", our.process); // load in our saved state or initalize a new one if none exists - let mut state = get_typed_state(|bytes| { - Ok(bincode::deserialize(bytes).unwrap_or(State { + let mut state = + get_typed_state(|bytes| Ok(bincode::deserialize(bytes)?)).unwrap_or(State { packages: HashMap::new(), requested_packages: HashSet::new(), - })) - }) - .unwrap(); + }); // active the main messaging loop: handle requests and responses loop { diff --git a/modules/http_proxy/src/lib.rs b/modules/http_proxy/src/lib.rs index bba2e600..2af32a7f 100644 --- a/modules/http_proxy/src/lib.rs +++ b/modules/http_proxy/src/lib.rs @@ -68,6 +68,7 @@ fn main(our: Address) -> anyhow::Result<()> { // bind to all of our favorite paths for path in ["/", "/static/*", "/list", "/register", "/serve/:username/*"] { Request::new() + .target(Address::new(&our.node, "http_server:sys:uqbar")?)? .ipc( &json!({ "BindPath": { @@ -273,6 +274,7 @@ fn main(our: Address) -> anyhow::Result<()> { } Request::new() + .target(Address::new(&username, "http_server:sys:uqbar")?)? .inherit(true) .ipc( &json!({ diff --git a/modules/qns_indexer/src/lib.rs b/modules/qns_indexer/src/lib.rs index 3e2ef1ca..bf78d058 100644 --- a/modules/qns_indexer/src/lib.rs +++ b/modules/qns_indexer/src/lib.rs @@ -104,7 +104,7 @@ fn subscribe_to_qns(from_block: u64) -> Vec { } fn serialize_message(message: &NetActions) -> anyhow::Result> { - Ok(serde_json::to_vec(message)?) + Ok(rmp_serde::to_vec(message)?) } fn serialize_json_message(message: &serde_json::Value) -> anyhow::Result> { diff --git a/modules/terminal/src/lib.rs b/modules/terminal/src/lib.rs index 255d4d8c..f3202da7 100644 --- a/modules/terminal/src/lib.rs +++ b/modules/terminal/src/lib.rs @@ -11,7 +11,7 @@ wit_bindgen::generate!({ }); fn serialize_message(message: &&str) -> anyhow::Result> { - Ok(serde_json::to_vec(message)?) + Ok(message.as_bytes().to_vec()) } fn parse_command(our_name: &str, line: &str) -> anyhow::Result<()> {