diff --git a/Cargo.lock b/Cargo.lock index 7cc197c9c..4dc5bee74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,7 +78,7 @@ name = "alias" version = "0.1.0" dependencies = [ "anyhow", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "wit-bindgen", @@ -423,7 +423,7 @@ dependencies = [ "alloy-sol-types", "anyhow", "bincode", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "rand 0.8.5", "serde", "serde_json", @@ -900,7 +900,7 @@ name = "cat" version = "0.1.0" dependencies = [ "anyhow", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "wit-bindgen", @@ -962,7 +962,7 @@ dependencies = [ "anyhow", "base64 0.13.1", "bincode", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "pleco", "serde", "serde_json", @@ -1606,7 +1606,7 @@ name = "download" version = "0.1.0" dependencies = [ "anyhow", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "wit-bindgen", @@ -1637,7 +1637,7 @@ name = "echo" version = "0.1.0" dependencies = [ "anyhow", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "wit-bindgen", @@ -1837,7 +1837,7 @@ version = "0.2.0" dependencies = [ "anyhow", "bincode", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "rand 0.8.5", "serde", "serde_json", @@ -1982,7 +1982,7 @@ dependencies = [ name = "get_block" version = "0.1.0" dependencies = [ - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "wit-bindgen", @@ -2157,7 +2157,7 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" name = "hi" version = "0.1.0" dependencies = [ - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "wit-bindgen", @@ -2187,7 +2187,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bincode", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "wit-bindgen", @@ -2413,7 +2413,7 @@ name = "install" version = "0.1.0" dependencies = [ "anyhow", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "wit-bindgen", @@ -2572,7 +2572,7 @@ dependencies = [ [[package]] name = "kinode" -version = "0.6.0" +version = "0.6.1" dependencies = [ "aes-gcm", "alloy-primitives", @@ -2645,7 +2645,7 @@ dependencies = [ [[package]] name = "kinode_lib" -version = "0.6.0" +version = "0.6.1" dependencies = [ "lib", ] @@ -2671,27 +2671,10 @@ dependencies = [ "wit-bindgen", ] -[[package]] -name = "kinode_process_lib" -version = "0.6.0" -source = "git+https://github.com/kinode-dao/process_lib.git?rev=9d185e1#9d185e1e264c93af53d004ba32520fd5d046e7e5" -dependencies = [ - "anyhow", - "bincode", - "http 1.0.0", - "mime_guess", - "rand 0.8.5", - "serde", - "serde_json", - "thiserror", - "url", - "wit-bindgen", -] - [[package]] name = "kit" -version = "0.1.0" -source = "git+https://github.com/kinode-dao/kit?rev=0e39c93#0e39c93d994e2955efd5655fb3ae0831c38865d0" +version = "0.2.0" +source = "git+https://github.com/kinode-dao/kit?rev=1bd7bec#1bd7bec195f4d6878d553a8568b0f2fa1240168a" dependencies = [ "anyhow", "base64 0.21.7", @@ -2700,7 +2683,7 @@ dependencies = [ "futures-util", "git2", "hex", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib.git?rev=9d185e1)", + "kinode_process_lib", "nix", "regex", "reqwest", @@ -2728,7 +2711,7 @@ dependencies = [ "anyhow", "bincode", "hex", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "rmp-serde", "serde", "serde_json", @@ -2755,7 +2738,7 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "lib" -version = "0.6.0" +version = "0.6.1" dependencies = [ "alloy-rpc-types", "lazy_static", @@ -2908,7 +2891,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "regex", "serde", "serde_json", @@ -3040,7 +3023,7 @@ dependencies = [ name = "namehash_to_name" version = "0.1.0" dependencies = [ - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "rmp-serde", "serde", "wit-bindgen", @@ -3068,7 +3051,7 @@ dependencies = [ name = "net_diagnostics" version = "0.1.0" dependencies = [ - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "rmp-serde", "serde", "wit-bindgen", @@ -3351,7 +3334,7 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" name = "peer" version = "0.1.0" dependencies = [ - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "rmp-serde", "serde", "wit-bindgen", @@ -3361,7 +3344,7 @@ dependencies = [ name = "peers" version = "0.1.0" dependencies = [ - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "rmp-serde", "serde", "wit-bindgen", @@ -4539,7 +4522,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" name = "state" version = "0.1.0" dependencies = [ - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "wit-bindgen", @@ -4693,7 +4676,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bincode", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "rand 0.8.5", "regex", "serde", @@ -4707,7 +4690,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bincode", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "thiserror", @@ -4721,7 +4704,7 @@ dependencies = [ "anyhow", "bincode", "indexmap", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "thiserror", @@ -4961,7 +4944,7 @@ name = "top" version = "0.1.0" dependencies = [ "anyhow", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "wit-bindgen", @@ -5247,7 +5230,7 @@ name = "uninstall" version = "0.1.0" dependencies = [ "anyhow", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0)", + "kinode_process_lib", "serde", "serde_json", "wit-bindgen", diff --git a/Cargo.toml b/Cargo.toml index aef2f9a85..498e13103 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kinode_lib" authors = ["KinodeDAO"] -version = "0.6.0" +version = "0.6.1" edition = "2021" description = "A general-purpose sovereign cloud computing platform" homepage = "https://kinode.org" diff --git a/kinode/Cargo.toml b/kinode/Cargo.toml index 0d6ff474e..df3fb36b4 100644 --- a/kinode/Cargo.toml +++ b/kinode/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kinode" authors = ["KinodeDAO"] -version = "0.6.0" +version = "0.6.1" edition = "2021" description = "A general-purpose sovereign cloud computing platform" homepage = "https://kinode.org" @@ -14,7 +14,7 @@ path = "src/main.rs" [build-dependencies] anyhow = "1.0.71" -kit = { git = "https://github.com/kinode-dao/kit", rev = "0e39c93" } +kit = { git = "https://github.com/kinode-dao/kit", rev = "1bd7bec" } rayon = "1.8.1" sha2 = "0.10" tokio = "1.28" @@ -88,4 +88,4 @@ uuid = { version = "1.1.2", features = ["serde", "v4"] } warp = "0.3.5" wasmtime = "17.0.1" wasmtime-wasi = "17.0.1" -zip = "0.6" \ No newline at end of file +zip = "0.6" diff --git a/kinode/build.rs b/kinode/build.rs index 1ea3b6ecb..47b0b8e56 100644 --- a/kinode/build.rs +++ b/kinode/build.rs @@ -6,13 +6,30 @@ use std::{ }; use zip::write::FileOptions; +fn get_features() -> String { + let mut features = "".to_string(); + for (key, _) in std::env::vars() { + if key.starts_with("CARGO_FEATURE_") { + let feature = key + .trim_start_matches("CARGO_FEATURE_") + .to_lowercase() + .replace("_", "-"); + features.push_str(&feature); + //println!("cargo:rustc-cfg=feature=\"{}\"", feature); + //println!("- {}", feature); + } + } + features +} + fn build_and_zip_package( entry_path: PathBuf, parent_pkg_path: &str, + features: &str, ) -> anyhow::Result<(String, String, Vec)> { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { - kit::build::execute(&entry_path, false, false, true).await?; + kit::build::execute(&entry_path, false, false, true, features).await?; let mut writer = Cursor::new(Vec::new()); let options = FileOptions::default() @@ -59,11 +76,17 @@ fn main() -> anyhow::Result<()> { .map(|entry| entry.unwrap().path()) .collect(); + let features = get_features(); + let results: Vec)>> = entries .par_iter() .map(|entry_path| { let parent_pkg_path = entry_path.join("pkg"); - build_and_zip_package(entry_path.clone(), parent_pkg_path.to_str().unwrap()) + build_and_zip_package( + entry_path.clone(), + parent_pkg_path.to_str().unwrap(), + &features, + ) }) .collect(); diff --git a/kinode/packages/app_store/app_store/Cargo.toml b/kinode/packages/app_store/app_store/Cargo.toml index 924f09dc7..0b1a96622 100644 --- a/kinode/packages/app_store/app_store/Cargo.toml +++ b/kinode/packages/app_store/app_store/Cargo.toml @@ -3,6 +3,8 @@ name = "app_store" version = "0.3.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] alloy-primitives = "0.6.2" diff --git a/kinode/packages/app_store/app_store/src/lib.rs b/kinode/packages/app_store/app_store/src/lib.rs index 34c47f909..eae005c62 100644 --- a/kinode/packages/app_store/app_store/src/lib.rs +++ b/kinode/packages/app_store/app_store/src/lib.rs @@ -81,8 +81,11 @@ fn fetch_logs(eth_provider: ð::Provider, filter: ð::Filter) -> Vec anyhow::Result<()> { let eth_provider = eth::Provider::new(state.chain_id, 60); // if block in state is < current_block, get logs from that part. + #[cfg(not(feature = "simulation-mode"))] if state.block < eth_provider.get_block_number().unwrap_or(u64::MAX) { loop { match eth_provider.get_logs(&filter) { diff --git a/kinode/packages/kns_indexer/state/Cargo.toml b/kinode/packages/kns_indexer/state/Cargo.toml index 4f02950e1..153271865 100644 --- a/kinode/packages/kns_indexer/state/Cargo.toml +++ b/kinode/packages/kns_indexer/state/Cargo.toml @@ -3,6 +3,8 @@ name = "state" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.0" } diff --git a/kinode/packages/terminal/alias/Cargo.toml b/kinode/packages/terminal/alias/Cargo.toml index e378438a3..c8f0fa9da 100644 --- a/kinode/packages/terminal/alias/Cargo.toml +++ b/kinode/packages/terminal/alias/Cargo.toml @@ -3,6 +3,8 @@ name = "alias" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] anyhow = "1.0" diff --git a/kinode/packages/terminal/cat/Cargo.toml b/kinode/packages/terminal/cat/Cargo.toml index e5e793a30..86ae275e8 100644 --- a/kinode/packages/terminal/cat/Cargo.toml +++ b/kinode/packages/terminal/cat/Cargo.toml @@ -3,6 +3,8 @@ name = "cat" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] anyhow = "1.0" diff --git a/kinode/packages/terminal/echo/Cargo.toml b/kinode/packages/terminal/echo/Cargo.toml index 20e182053..53040d8a4 100644 --- a/kinode/packages/terminal/echo/Cargo.toml +++ b/kinode/packages/terminal/echo/Cargo.toml @@ -3,6 +3,8 @@ name = "echo" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] anyhow = "1.0" diff --git a/kinode/packages/terminal/hi/Cargo.toml b/kinode/packages/terminal/hi/Cargo.toml index 943b49474..b2b4269bd 100644 --- a/kinode/packages/terminal/hi/Cargo.toml +++ b/kinode/packages/terminal/hi/Cargo.toml @@ -3,6 +3,8 @@ name = "hi" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.0" } diff --git a/kinode/packages/terminal/m/Cargo.toml b/kinode/packages/terminal/m/Cargo.toml index ccf7d1578..c865e6c3a 100644 --- a/kinode/packages/terminal/m/Cargo.toml +++ b/kinode/packages/terminal/m/Cargo.toml @@ -3,6 +3,8 @@ name = "m" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] anyhow = "1.0" diff --git a/kinode/packages/terminal/namehash_to_name/Cargo.toml b/kinode/packages/terminal/namehash_to_name/Cargo.toml index a5b107aec..2eca8a236 100644 --- a/kinode/packages/terminal/namehash_to_name/Cargo.toml +++ b/kinode/packages/terminal/namehash_to_name/Cargo.toml @@ -3,6 +3,8 @@ name = "namehash_to_name" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.0" } diff --git a/kinode/packages/terminal/net_diagnostics/Cargo.toml b/kinode/packages/terminal/net_diagnostics/Cargo.toml index fe23b56a6..604152a5f 100644 --- a/kinode/packages/terminal/net_diagnostics/Cargo.toml +++ b/kinode/packages/terminal/net_diagnostics/Cargo.toml @@ -3,6 +3,8 @@ name = "net_diagnostics" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.0" } diff --git a/kinode/packages/terminal/peer/Cargo.toml b/kinode/packages/terminal/peer/Cargo.toml index cdfe3573b..cd6a9f664 100644 --- a/kinode/packages/terminal/peer/Cargo.toml +++ b/kinode/packages/terminal/peer/Cargo.toml @@ -3,6 +3,8 @@ name = "peer" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.0" } diff --git a/kinode/packages/terminal/peers/Cargo.toml b/kinode/packages/terminal/peers/Cargo.toml index 9c741940d..b7d7cad34 100644 --- a/kinode/packages/terminal/peers/Cargo.toml +++ b/kinode/packages/terminal/peers/Cargo.toml @@ -3,6 +3,8 @@ name = "peers" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.0" } diff --git a/kinode/packages/terminal/terminal/Cargo.toml b/kinode/packages/terminal/terminal/Cargo.toml index 505b97b4f..d85e70ae0 100644 --- a/kinode/packages/terminal/terminal/Cargo.toml +++ b/kinode/packages/terminal/terminal/Cargo.toml @@ -3,6 +3,8 @@ name = "terminal" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] anyhow = "1.0" diff --git a/kinode/packages/terminal/top/Cargo.toml b/kinode/packages/terminal/top/Cargo.toml index 128cba2d5..e935df412 100644 --- a/kinode/packages/terminal/top/Cargo.toml +++ b/kinode/packages/terminal/top/Cargo.toml @@ -3,6 +3,8 @@ name = "top" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] anyhow = "1.0" diff --git a/kinode/packages/tester/test_runner/Cargo.toml b/kinode/packages/tester/test_runner/Cargo.toml index 85f8e1b29..e53ea70ae 100644 --- a/kinode/packages/tester/test_runner/Cargo.toml +++ b/kinode/packages/tester/test_runner/Cargo.toml @@ -3,6 +3,8 @@ name = "test_runner" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] anyhow = "1.0" diff --git a/kinode/packages/tester/tester/Cargo.toml b/kinode/packages/tester/tester/Cargo.toml index 0667c8ef9..154c1b854 100644 --- a/kinode/packages/tester/tester/Cargo.toml +++ b/kinode/packages/tester/tester/Cargo.toml @@ -3,6 +3,8 @@ name = "tester" version = "0.1.0" edition = "2021" +[features] +simulation-mode = [] [dependencies] anyhow = "1.0" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index d1a9490f3..2e3a84a0a 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "lib" authors = ["KinodeDAO"] -version = "0.6.0" +version = "0.6.1" edition = "2021" description = "A general-purpose sovereign cloud computing platform" homepage = "https://kinode.org"