From 2100f0ae2c06e302e63883a34e19b63d4f9bef3d Mon Sep 17 00:00:00 2001 From: hh Date: Tue, 29 Nov 2022 11:38:35 +0330 Subject: [PATCH 1/5] Add JNI blockstore --- .../java/com/functionland/app/WNFSTest.kt | 15 +- lib/build.gradle | 1 + lib/src/main/java/land/fx/wnfslib/Lib.kt | 21 +- wnfslib/Cargo.lock | 43 +- wnfslib/Cargo.toml | 5 +- wnfslib/src/lib.rs | 138 +- wnfslib/utils/Cargo.lock | 2233 ----------------- wnfslib/utils/Cargo.toml | 21 - wnfslib/utils/src/kvblockstore.rs | 116 - wnfslib/utils/src/lib.rs | 2 - wnfslib/utils/src/private.rs | 236 -- 11 files changed, 145 insertions(+), 2686 deletions(-) delete mode 100644 wnfslib/utils/Cargo.lock delete mode 100644 wnfslib/utils/Cargo.toml delete mode 100644 wnfslib/utils/src/kvblockstore.rs delete mode 100644 wnfslib/utils/src/lib.rs delete mode 100644 wnfslib/utils/src/private.rs diff --git a/appmock/src/androidTest/java/com/functionland/app/WNFSTest.kt b/appmock/src/androidTest/java/com/functionland/app/WNFSTest.kt index cc7ec5a..d874830 100644 --- a/appmock/src/androidTest/java/com/functionland/app/WNFSTest.kt +++ b/appmock/src/androidTest/java/com/functionland/app/WNFSTest.kt @@ -13,6 +13,7 @@ import land.fx.wnfslib.createRootDir import land.fx.wnfslib.writeFile import land.fx.wnfslib.readFile import land.fx.wnfslib.ls +import land.fx.wnfslib.mkdir import junit.framework.Assert.assertNotNull @RunWith(AndroidJUnit4::class) @@ -28,14 +29,18 @@ class WNFSTest { var cid = createPrivateForest(path.toString()) println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") println(cid) - val config = createRootDir(path.toString(), cid) + var config = createRootDir(path.toString(), cid) assertNotNull("cid should not be null", cid) assertNotNull("private_ref should not be null", config.private_ref) - cid = writeFile(path.toString(), config.cid, config.private_ref, "root/test.txt", "Hello, World!".toByteArray()) + config = writeFile(path.toString(), config.cid, config.private_ref, "root/test.txt", "Hello, World!".toByteArray()) assertNotNull("cid should not be null", cid) - val fileNames = ls(path.toString(), cid, config.private_ref, "root") - assertEquals(fileNames, "test.txt") - val content = readFile(path.toString(), cid, config.private_ref, "root/test.txt") + config = mkdir(path.toString(), config.cid, config.private_ref, "root/test1") + val fileNames = ls(path.toString(), config.cid, config.private_ref, "root") + assertEquals(fileNames, "test.txt\ntest1") + val content = readFile(path.toString(), config.cid, config.private_ref, "root/test.txt") assert(content contentEquals "Hello, World!".toByteArray()) + config = rm(path.toString(), config.cid, config.private_ref, "root/test.txt") + content = readFile(path.toString(), config.cid, config.private_ref, "root/test.txt") + assertNull(content) } } \ No newline at end of file diff --git a/lib/build.gradle b/lib/build.gradle index 8b71bac..755ccd8 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -49,6 +49,7 @@ dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation 'androidx.core:core-ktx:1.7.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation 'com.github.functionland:fula-build-aar:v0.6.6' // From jitpack.io } tasks.whenTaskAdded { task -> diff --git a/lib/src/main/java/land/fx/wnfslib/Lib.kt b/lib/src/main/java/land/fx/wnfslib/Lib.kt index 961a63c..5375ae0 100644 --- a/lib/src/main/java/land/fx/wnfslib/Lib.kt +++ b/lib/src/main/java/land/fx/wnfslib/Lib.kt @@ -13,11 +13,15 @@ private external fun createPrivateForestNative(dbPath: String): String private external fun createRootDirNative(dbPath: String, cid: String): Config -private external fun writeFileNative(dbPath: String, cid: String, privateRef: String, path: String, content: ByteArray): String +private external fun writeFileNative(dbPath: String, cid: String, privateRef: String, path: String, content: ByteArray): Config private external fun lsNative(dbPath: String, cid: String, privateRef: String, path: String): String -private external fun readFileNative(dbPath: String, cid: String, privateRef: String, path: String): ByteArray +private external fun mkdirNative(dbPath: String, cid: String, privateRef: String, path: String): Config + +private external fun rmNative(dbPath: String, cid: String, privateRef: String, path: String): Config + +private external fun readFileNative(dbPath: String, cid: String, privateRef: String, path: String): ByteArray? fun createPrivateForest(dbPath: String): String { return createPrivateForestNative(dbPath) @@ -27,7 +31,7 @@ fun createRootDir(dbPath: String, cid: String): Config { return createRootDirNative(dbPath, cid) } -fun writeFile(dbPath: String, cid: String, privateRef: String, path: String, content: ByteArray): String { +fun writeFile(dbPath: String, cid: String, privateRef: String, path: String, content: ByteArray): Config { return writeFileNative(dbPath, cid, privateRef, path, content) } @@ -35,8 +39,17 @@ fun ls(dbPath: String, cid: String, privateRef: String, path: String): String { return lsNative(dbPath, cid, privateRef, path) } -fun readFile(dbPath: String, cid: String, privateRef: String, path: String): ByteArray { +fun mkdir(dbPath: String, cid: String, privateRef: String, path: String): Config { + return mkdirNative(dbPath, cid, privateRef, path) +} + +fun rm(dbPath: String, cid: String, privateRef: String, path: String): Config { + return rmNative(dbPath, cid, privateRef, path) +} + +fun readFile(dbPath: String, cid: String, privateRef: String, path: String): ByteArray? { return readFileNative(dbPath, cid, privateRef, path) } + // Initialize Rust Library Logging external fun initRustLogger() \ No newline at end of file diff --git a/wnfslib/Cargo.lock b/wnfslib/Cargo.lock index 9af0fa7..a5290f6 100644 --- a/wnfslib/Cargo.lock +++ b/wnfslib/Cargo.lock @@ -2506,26 +2506,6 @@ dependencies = [ "serde", ] -[[package]] -name = "utils" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-std", - "async-trait", - "chrono", - "crc32fast", - "kv", - "libipld", - "multihash", - "rand 0.8.5", - "rand_core 0.6.4", - "serde", - "serde_json", - "tokio", - "wnfs", -] - [[package]] name = "value-bag" version = "1.0.0-alpha.9" @@ -2798,6 +2778,27 @@ dependencies = [ "xxhash-rust", ] +[[package]] +name = "wnfs_utils" +version = "0.1.0" +source = "git+https://github.com/hhio618/wnfs-utils#98ee69e919236fdd588f37304688f7444a91844e" +dependencies = [ + "anyhow", + "async-std", + "async-trait", + "chrono", + "crc32fast", + "kv", + "libipld", + "multihash", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "serde_json", + "tokio", + "wnfs", +] + [[package]] name = "wnfslib-android" version = "0.1.0" @@ -2818,8 +2819,8 @@ dependencies = [ "serde_json", "tokio", "url", - "utils", "wnfs", + "wnfs_utils", ] [[package]] diff --git a/wnfslib/Cargo.toml b/wnfslib/Cargo.toml index 1fbcbb6..f1064be 100644 --- a/wnfslib/Cargo.toml +++ b/wnfslib/Cargo.toml @@ -1,6 +1,3 @@ -[workspace] -members = ["utils"] - [package] name = "wnfslib-android" version = "0.1.0" @@ -12,7 +9,7 @@ crate-type = ["cdylib", "staticlib"] [dependencies] wnfs = "0.1.9" -utils = { path = "utils" } +wnfs_utils = { git = "https://github.com/hhio618/wnfs-utils" } serde = "1.0.147" serde_json = "1.0.87" chrono = "0.4.22" diff --git a/wnfslib/src/lib.rs b/wnfslib/src/lib.rs index 6bc8dcb..6e41ce8 100644 --- a/wnfslib/src/lib.rs +++ b/wnfslib/src/lib.rs @@ -21,7 +21,77 @@ pub mod android { use wnfs::public::PublicDirectory; use chrono::Utc; use kv::*; - use utils::private::PrivateDirectoryHelper; + use wnfsutils::private_forest::PrivateDirectoryHelper; + use wnfsutils::blockstore::FFIStore; + + + struct JNIStore{ + env: JNIEnv, + fula_client: JObject + } + impl JNIStore { + fn new(env: JNIEnv, fula_client: JObject) -> Self{ + Self { env, fula_client } + } + } + impl FFIStore for JNIStore { + + /// Retrieves an array of bytes from the block store with given CID. + fn get_block(&self, cid: Vec) -> Result>{ + let get_fn = env + .get_method_id( + self.fula_client, + "get", + "([B;)[B;", + ) + .unwrap(); + + let cidJByteArray = vec_to_jbyteArray(env, cid); + let dataJByteArray = env + .call_method_unchecked( + self.fula_client, + get_fn, + JavaType::Object(String::from("[B")), + &[ + JValue::from(cidJByteArray), + ], + ) + .unwrap() + .l() + .unwrap(); + + let data = jbyteArray_to_vec(env, dataJByteArray); + Ok(data) + } + + /// Stores an array of bytes in the block store. + fn put_block(&self, cid: Vec, bytes: Vec) -> Result>{ + let put_fn = env + .get_method_id( + self.fula_client, + "put", + "([B;[B;);", + ) + .unwrap(); + + let cidJByteArray = vec_to_jbyteArray(env, cid); + let dataJByteArray = vec_to_jbyteArray(env, bytes); + env + .call_method_unchecked( + self.fula_client, + get_fn, + JavaType::Object(String::from("")), + &[ + JValue::from(cidJByteArray), + JValue::from(dataJByteArray), + ], + ) + .unwrap() + .l() + .unwrap(); + Ok(cidJByteArray) + } + } #[no_mangle] pub extern "C" fn Java_land_fx_wnfslib_LibKt_initRustLogger(_: JNIEnv, _: JClass) { @@ -32,14 +102,10 @@ pub mod android { pub extern "C" fn Java_land_fx_wnfslib_LibKt_createPrivateForestNative( env: JNIEnv, _: JClass, - jni_db_path: JString, + jni_fula_client: JObject, ) -> jstring { - let db_path: String = env - .get_string(jni_db_path) - .expect("Failed to parse input db path") - .into(); - - let helper = &mut PrivateDirectoryHelper::new(db_path); + let store = JNIStore::new(env, jni_fula_client); + let helper = &mut PrivateDirectoryHelper::new(store); trace!("**********************cp1**************"); serialize_cid(env, helper.synced_new_private_forest()).into_inner() } @@ -48,16 +114,11 @@ pub mod android { pub extern "C" fn Java_land_fx_wnfslib_LibKt_createRootDirNative( env: JNIEnv, _: JClass, - jni_db_path: JString, + jni_fula_client: JObject, jni_cid: JString, ) -> jobject { - - let db_path: String = env - .get_string(jni_db_path) - .expect("Failed to parse input db path") - .into(); - - let helper = &mut PrivateDirectoryHelper::new(db_path); + let store = JNIStore::new(env, jni_fula_client); + let helper = &mut PrivateDirectoryHelper::new(store); let forest_cid = deserialize_cid(env, jni_cid); trace!("cid: {}", forest_cid); let forest = helper.synced_load_forest(forest_cid); @@ -71,17 +132,14 @@ pub mod android { pub extern "C" fn Java_land_fx_wnfslib_LibKt_writeFileNative( env: JNIEnv, _: JClass, - jni_db_path: JString, + jni_fula_client: JObject, jni_cid: JString, jni_private_ref: JString, jni_path_segments: JString, jni_content: jbyteArray, - ) -> jstring { - let db_path: String = env - .get_string(jni_db_path) - .expect("Failed to parse input db name") - .into(); - let helper = &mut PrivateDirectoryHelper::new(db_path); + ) -> jobject { + let store = JNIStore::new(env, jni_fula_client); + let helper = &mut PrivateDirectoryHelper::new(store); let cid = deserialize_cid(env, jni_cid); let private_ref = deserialize_private_ref(env, jni_private_ref); @@ -90,23 +148,21 @@ pub mod android { let root_dir = helper.synced_get_root_dir(forest.to_owned(), private_ref); let path_segments = prepare_path_segments(env, jni_path_segments); let content = jbyteArray_to_vec(env, jni_content); - serialize_cid(env, helper.synced_write_file(forest.to_owned(), root_dir, &path_segments, content)).into_inner() + let (cid, private_ref) = helper.synced_write_file(forest.to_owned(), root_dir, &path_segments, content); + serialize_config(env, cid, private_ref) } #[no_mangle] pub extern "C" fn Java_land_fx_wnfslib_LibKt_readFileNative( env: JNIEnv, _: JClass, - jni_db_path: JString, + jni_fula_client: JObject, jni_cid: JString, jni_private_ref: JString, jni_path_segments: JString, ) -> jbyteArray { - let db_path: String = env - .get_string(jni_db_path) - .expect("Failed to parse input db name") - .into(); - let helper = &mut PrivateDirectoryHelper::new(db_path); + let store = JNIStore::new(env, jni_fula_client); + let helper = &mut PrivateDirectoryHelper::new(store); let cid = deserialize_cid(env, jni_cid); let private_ref = deserialize_private_ref(env, jni_private_ref); @@ -121,16 +177,13 @@ pub mod android { pub extern "C" fn Java_land_fx_wnfslib_LibKt_mkdirNative( env: JNIEnv, _: JClass, - jni_db_path: JString, + jni_fula_client: JObject, jni_cid: JString, jni_private_ref: JString, jni_path_segments: JString, ) -> jstring { - let db_path: String = env - .get_string(jni_db_path) - .expect("Failed to parse input db name") - .into(); - let helper = &mut PrivateDirectoryHelper::new(db_path); + let store = JNIStore::new(env, jni_fula_client); + let helper = &mut PrivateDirectoryHelper::new(store); let cid = deserialize_cid(env, jni_cid); let private_ref = deserialize_private_ref(env, jni_private_ref); @@ -138,24 +191,21 @@ pub mod android { let forest = helper.synced_load_forest(cid); let root_dir = helper.synced_get_root_dir(forest.to_owned(), private_ref); let path_segments = prepare_path_segments(env, jni_path_segments); - serialize_cid(env, helper.synced_mkdir(forest.to_owned(), root_dir, &path_segments)).into_inner() + let (cid, private_ref) = helper.synced_mkdir(forest.to_owned(), root_dir, &path_segments); + serialize_config(env, cid, private_ref) } #[no_mangle] pub extern "C" fn Java_land_fx_wnfslib_LibKt_lsNative( env: JNIEnv, _: JClass, - jni_db_path: JString, + jni_fula_client: JObject, jni_cid: JString, jni_private_ref: JString, jni_path_segments: JString, ) -> jstring { - let db_path: String = env - .get_string(jni_db_path) - .expect("Failed to parse input db name") - .into(); - - let helper = &mut PrivateDirectoryHelper::new(db_path); + let store = JNIStore::new(env, jni_fula_client); + let helper = &mut PrivateDirectoryHelper::new(store); let cid = deserialize_cid(env, jni_cid); let private_ref = deserialize_private_ref(env, jni_private_ref); diff --git a/wnfslib/utils/Cargo.lock b/wnfslib/utils/Cargo.lock deleted file mode 100644 index b0c92b8..0000000 --- a/wnfslib/utils/Cargo.lock +++ /dev/null @@ -1,2233 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aead" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array", -] - -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", - "opaque-debug", -] - -[[package]] -name = "aes-gcm" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" - -[[package]] -name = "arrayref" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "async-attributes" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "async-channel" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-executor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "once_cell", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" -dependencies = [ - "async-channel", - "async-executor", - "async-io", - "async-lock", - "blocking", - "futures-lite", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8121296a9f05be7f34aa4196b1747243b3b62e048bb7906f644f3fbfc490cf7" -dependencies = [ - "async-lock", - "autocfg 1.1.0", - "concurrent-queue", - "futures-lite", - "libc", - "log", - "parking", - "polling", - "slab", - "socket2", - "waker-fn", - "winapi", -] - -[[package]] -name = "async-lock" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" -dependencies = [ - "event-listener", - "futures-lite", -] - -[[package]] -name = "async-once-cell" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61305cacf1d0c5c9d3ee283d22f8f1f8c743a18ceb44a1b102bd53476c141de" - -[[package]] -name = "async-recursion" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cda8f4bcc10624c4e85bc66b3f452cca98cfa5ca002dc83a16aad2367641bea" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-attributes", - "async-channel", - "async-global-executor", - "async-io", - "async-lock", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" -dependencies = [ - "async-stream-impl", - "futures-core", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "async-task" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" - -[[package]] -name = "async-trait" -version = "0.1.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "atomic-waker" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" - -[[package]] -name = "autocfg" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" -dependencies = [ - "autocfg 1.1.0", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "serde", - "tap", - "wyz", -] - -[[package]] -name = "blake2b_simd" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" -dependencies = [ - "arrayref", - "arrayvec", - "constant_time_eq", -] - -[[package]] -name = "blake2s_simd" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4" -dependencies = [ - "arrayref", - "arrayvec", - "constant_time_eq", -] - -[[package]] -name = "blake3" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if", - "constant_time_eq", -] - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "blocking" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" -dependencies = [ - "async-channel", - "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "once_cell", -] - -[[package]] -name = "bumpalo" -version = "3.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" - -[[package]] -name = "cache-padded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" - -[[package]] -name = "cached" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4dfac631a8e77b2f327f7852bb6172771f5279c4512efe79fad6067b37be3d" -dependencies = [ - "hashbrown 0.11.2", - "once_cell", -] - -[[package]] -name = "cc" -version = "1.0.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" -dependencies = [ - "iana-time-zone", - "js-sys", - "num-integer", - "num-traits", - "time", - "wasm-bindgen", - "winapi", -] - -[[package]] -name = "cid" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" -dependencies = [ - "core2", - "multibase", - "multihash", - "serde", - "serde_bytes", - "unsigned-varint", -] - -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array", -] - -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - -[[package]] -name = "cmake" -version = "0.1.49" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" -dependencies = [ - "cc", -] - -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - -[[package]] -name = "concurrent-queue" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" -dependencies = [ - "cache-padded", -] - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - -[[package]] -name = "core2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" -dependencies = [ - "memchr", -] - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" -dependencies = [ - "autocfg 1.1.0", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "ctor" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "ctr" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" -dependencies = [ - "cipher", -] - -[[package]] -name = "cxx" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "data-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" - -[[package]] -name = "data-encoding-macro" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" -dependencies = [ - "data-encoding", - "data-encoding-macro-internal", -] - -[[package]] -name = "data-encoding-macro-internal" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" -dependencies = [ - "data-encoding", - "syn", -] - -[[package]] -name = "digest" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "either" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" - -[[package]] -name = "futures-executor" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" - -[[package]] -name = "futures-lite" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-macro" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" - -[[package]] -name = "futures-task" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" - -[[package]] -name = "futures-util" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "ghash" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" -dependencies = [ - "opaque-debug", - "polyval", -] - -[[package]] -name = "gloo-timers" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] - -[[package]] -name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "winapi", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" -dependencies = [ - "cxx", - "cxx-build", -] - -[[package]] -name = "indexmap" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" -dependencies = [ - "autocfg 1.1.0", - "hashbrown 0.12.3", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" - -[[package]] -name = "js-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "keccak" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" - -[[package]] -name = "kv" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620727085ac39ee9650b373fe6d8073a0aee6f99e52a9c72b25f7671078039ab" -dependencies = [ - "pin-project-lite", - "serde", - "sled", - "thiserror", - "toml", -] - -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.137" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" - -[[package]] -name = "libipld" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9c3aa309c260aa2f174bac968901eddc546e9d85950c28eae6a7bec402f926" -dependencies = [ - "async-trait", - "cached", - "fnv", - "libipld-cbor", - "libipld-cbor-derive", - "libipld-core", - "libipld-json", - "libipld-macro", - "libipld-pb", - "log", - "multihash", - "parking_lot 0.12.1", - "thiserror", -] - -[[package]] -name = "libipld-cbor" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd1ab68c9d26f20c7d0dfea6eecbae8c00359875210001b33ca27d4a02f3d09" -dependencies = [ - "byteorder", - "libipld-core", - "thiserror", -] - -[[package]] -name = "libipld-cbor-derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69ec2f49393a1347a2d95ebcb248ff75d0d47235919b678036c010a8cd927375" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "libipld-core" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d44790246ec6b7314cba745992c23d479d018073e66d49ae40ae1b64e5dd8eb5" -dependencies = [ - "anyhow", - "cid", - "core2", - "multibase", - "multihash", - "serde", - "thiserror", -] - -[[package]] -name = "libipld-json" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18aa481a87f084d98473dd9ece253a9569c762b75f6bbba8217d54e48c9d63b3" -dependencies = [ - "libipld-core", - "multihash", - "serde", - "serde_json", -] - -[[package]] -name = "libipld-macro" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852c011562ae5059b67c3a917f9f5945af5a68df8e39ede4444fff33274d25e2" -dependencies = [ - "libipld-core", -] - -[[package]] -name = "libipld-pb" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c003be513496578115256a1b4ac7b80d4ece2462c9869dfb736fd30d8bb1d1c0" -dependencies = [ - "libipld-core", - "prost", - "prost-build", - "thiserror", -] - -[[package]] -name = "link-cplusplus" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" -dependencies = [ - "cc", -] - -[[package]] -name = "lock_api" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg 1.1.0", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", - "value-bag", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg 1.1.0", -] - -[[package]] -name = "mio" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" -dependencies = [ - "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", -] - -[[package]] -name = "multibase" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" -dependencies = [ - "base-x", - "data-encoding", - "data-encoding-macro", -] - -[[package]] -name = "multihash" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" -dependencies = [ - "blake2b_simd", - "blake2s_simd", - "blake3", - "core2", - "digest", - "multihash-derive", - "serde", - "serde-big-array", - "sha2", - "sha3", - "unsigned-varint", -] - -[[package]] -name = "multihash-derive" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" -dependencies = [ - "proc-macro-crate", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg 1.1.0", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg 1.1.0", -] - -[[package]] -name = "num_cpus" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "parking" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" - -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.5", -] - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core 0.9.4", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-sys", -] - -[[package]] -name = "petgraph" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "polling" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4609a838d88b73d8238967b60dd115cc08d38e2bbaf51ee1e4b695f89122e2" -dependencies = [ - "autocfg 1.1.0", - "cfg-if", - "libc", - "log", - "wepoll-ffi", - "winapi", -] - -[[package]] -name = "polyval" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug", - "universal-hash", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro-crate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" -dependencies = [ - "once_cell", - "thiserror", - "toml", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prost" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" -dependencies = [ - "bytes", - "cfg-if", - "cmake", - "heck", - "itertools", - "lazy_static", - "log", - "multimap", - "petgraph", - "prost", - "prost-types", - "regex", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "prost-types" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" -dependencies = [ - "bytes", - "prost", -] - -[[package]] -name = "quote" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65e163105a6284f841bd23100a015895f54340e88a5ffc9ca7b8b33827cfce0" -dependencies = [ - "autocfg 0.1.8", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.3.1", - "rand_hc", - "rand_isaac", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.8", - "rand_core 0.3.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.8", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - -[[package]] -name = "ryu" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "scratch" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" - -[[package]] -name = "semver" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-big-array" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd31f59f6fe2b0c055371bb2f16d7f0aa7d8881676c04a55b1596d1a17cd10a4" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_bytes" -version = "0.11.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfc50e8183eeeb6178dcb167ae34a8051d63535023ae38b5d8d12beae193d37b" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha3" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f935e31cf406e8c0e96c2815a5516181b7004ae8c5f296293221e9b1e356bd" -dependencies = [ - "digest", - "keccak", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" -dependencies = [ - "libc", -] - -[[package]] -name = "skip_ratchet" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ee41f8a86f13fe0618c3cc9c5d9f7a6173f3449de900595753973c97a25579" -dependencies = [ - "base64", - "hex", - "rand 0.6.3", - "serde", - "sha3", -] - -[[package]] -name = "slab" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" -dependencies = [ - "autocfg 1.1.0", -] - -[[package]] -name = "sled" -version = "0.34.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f96b4737c2ce5987354855aed3797279def4ebf734436c6aa4552cf8e169935" -dependencies = [ - "crc32fast", - "crossbeam-epoch", - "crossbeam-utils", - "fs2", - "fxhash", - "libc", - "log", - "parking_lot 0.11.2", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "socket2" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "time" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "tokio" -version = "1.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" -dependencies = [ - "autocfg 1.1.0", - "bytes", - "libc", - "memchr", - "mio", - "num_cpus", - "parking_lot 0.12.1", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "winapi", -] - -[[package]] -name = "tokio-macros" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "toml" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" -dependencies = [ - "serde", -] - -[[package]] -name = "typenum" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" - -[[package]] -name = "unicode-ident" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "universal-hash" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "unsigned-varint" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" - -[[package]] -name = "utils" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-std", - "async-trait", - "chrono", - "crc32fast", - "kv", - "libipld", - "multihash", - "rand 0.8.5", - "rand_core 0.6.4", - "serde", - "tokio", - "wnfs", -] - -[[package]] -name = "value-bag" -version = "1.0.0-alpha.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" -dependencies = [ - "ctor", - "version_check", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" - -[[package]] -name = "web-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "wepoll-ffi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" -dependencies = [ - "cc", -] - -[[package]] -name = "which" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" -dependencies = [ - "either", - "libc", - "once_cell", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" - -[[package]] -name = "wnfs" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839617a8403b91a4b4a7fa7f016e9126025af8c15dbba39c95545479be90181b" -dependencies = [ - "aes-gcm", - "anyhow", - "async-once-cell", - "async-recursion", - "async-std", - "async-stream", - "async-trait", - "bitvec", - "chrono", - "futures", - "futures-util", - "hashbrown 0.12.3", - "lazy_static", - "libipld", - "log", - "multihash", - "rand_core 0.6.4", - "semver", - "serde", - "sha3", - "skip_ratchet", - "thiserror", - "xxhash-rust", -] - -[[package]] -name = "wyz" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" -dependencies = [ - "tap", -] - -[[package]] -name = "xxhash-rust" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735a71d46c4d68d71d4b24d03fdc2b98e38cea81730595801db779c04fe80d70" diff --git a/wnfslib/utils/Cargo.toml b/wnfslib/utils/Cargo.toml deleted file mode 100644 index ac501c6..0000000 --- a/wnfslib/utils/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "utils" -version = "0.1.0" -edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -wnfs = "0.1.9" -chrono = "0.4.22" -crc32fast = "1.3.2" -tokio = { version = "1", features = ["full"] } -rand = "0.8.5" -libipld = "0.14.0" -kv = "0.24.0" -async-std = "1.12.0" -multihash = "0.16.3" -rand_core = "0.6.4" -serde = "1.0.147" -anyhow = "1.0.66" -async-trait = "0.1.58" -serde_json = "1.0.87" \ No newline at end of file diff --git a/wnfslib/utils/src/kvblockstore.rs b/wnfslib/utils/src/kvblockstore.rs deleted file mode 100644 index a60166e..0000000 --- a/wnfslib/utils/src/kvblockstore.rs +++ /dev/null @@ -1,116 +0,0 @@ -use kv::*; -use std::{borrow::Cow}; -use libipld::{ - cid::Version, - Cid, IpldCodec, -}; -use anyhow::Result; -use async_trait::async_trait; -use multihash::{Code, MultihashDigest}; - -use wnfs::FsError; -use wnfs::BlockStore; - -pub struct KVBlockStore{ - pub store: Store -} - -//-------------------------------------------------------------------------------------------------- -// Implementations -//-------------------------------------------------------------------------------------------------- - -impl KVBlockStore { - /// Creates a new kv block store. - pub fn new(db_path: String) -> Self { - // Configure the database - // Open the key/value store - Self{ - store: Store::new(Config::new(db_path)).unwrap() - } - } - -} - - -#[async_trait(?Send)] -impl BlockStore for KVBlockStore { - /// Retrieves an array of bytes from the block store with given CID. - async fn get_block<'a>(&'a self, cid: &Cid) -> Result>> { - // A Bucket provides typed access to a section of the key/value store - let bucket = self.store.bucket::(Some("default"))?; - - let bytes = bucket - .get(&Raw::from(cid.to_bytes())) - .map_err(|_| FsError::CIDNotFoundInBlockstore)?.unwrap().to_vec(); - Ok(Cow::Owned(bytes)) - } - - /// Stores an array of bytes in the block store. - async fn put_block(&mut self, bytes: Vec, codec: IpldCodec) -> Result { - - let hash = Code::Sha2_256.digest(&bytes); - let cid = Cid::new(Version::V1, codec.into(), hash)?; - - let key = Raw::from(cid.to_bytes()); - let value = Raw::from(bytes); - // A Bucket provides typed access to a section of the key/value store - let bucket = self.store.bucket::(Some("default"))?; - - bucket.set(&key, &value)?; - Ok(cid) - } -} - - - -//-------------------------------------------------------------------------------------------------- -// Functions -//-------------------------------------------------------------------------------------------------- - -#[cfg(test)] -mod blockstore_tests { - use libipld::{cbor::DagCborCodec, codec::Encode, IpldCodec}; - - use wnfs::*; - - use crate::kvblockstore::KVBlockStore; - - #[async_std::test] - async fn inserted_items_can_be_fetched() { - let store = &mut KVBlockStore::new(String::from("./tmp/test2")); - - let first_bytes = { - let mut tmp = vec![]; - vec![1, 2, 3, 4, 5] - .to_vec() - .encode(DagCborCodec, &mut tmp) - .unwrap(); - tmp - }; - - let second_bytes = { - let mut tmp = vec![]; - b"hello world" - .to_vec() - .encode(DagCborCodec, &mut tmp) - .unwrap(); - tmp - }; - - let first_cid = &store - .put_block(first_bytes, IpldCodec::DagCbor) - .await - .unwrap(); - - let second_cid = &store - .put_block(second_bytes, IpldCodec::DagCbor) - .await - .unwrap(); - - let first_loaded: Vec = store.get_deserializable(first_cid).await.unwrap(); - let second_loaded: Vec = store.get_deserializable(second_cid).await.unwrap(); - - assert_eq!(first_loaded, vec![1, 2, 3, 4, 5]); - assert_eq!(second_loaded, b"hello world".to_vec()); - } -} diff --git a/wnfslib/utils/src/lib.rs b/wnfslib/utils/src/lib.rs deleted file mode 100644 index 7860501..0000000 --- a/wnfslib/utils/src/lib.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod private; -pub mod kvblockstore; diff --git a/wnfslib/utils/src/private.rs b/wnfslib/utils/src/private.rs deleted file mode 100644 index 1dc1409..0000000 --- a/wnfslib/utils/src/private.rs +++ /dev/null @@ -1,236 +0,0 @@ -//! This example shows how to add a directory to a private forest (also HAMT) which encrypts it. -//! It also shows how to retrieve encrypted nodes from the forest using `PrivateRef`s. - -use chrono::Utc; -use libipld::Cid; -use rand::{thread_rng, rngs::ThreadRng}; -use std::{rc::Rc}; -use wnfs::{ - dagcbor, - private::{PrivateForest, PrivateRef}, - BlockStore, Namefilter, PrivateDirectory, PrivateOpResult, Metadata, -}; -use crate::kvblockstore::KVBlockStore; - -pub struct PrivateDirectoryHelper { - pub store: KVBlockStore, - rng: ThreadRng -} - -// Single root (private ref) implementation of the wnfs private directory using KVBlockStore. -// TODO: we assumed all the write, mkdirs use same roots here. this could be done using prepend -// a root path to all path segments. -impl PrivateDirectoryHelper { - pub fn new(db_path: String) -> Self { - Self { - store: KVBlockStore::new(db_path), - rng: thread_rng() - } - } - - pub async fn new_private_forest(&mut self) -> Cid { - // Create the private forest (also HAMT), a map-like structure where files and directories are stored. - let forest = Rc::new(PrivateForest::new()); - - // Serialize the private forest to DAG CBOR. - let cbor_bytes = dagcbor::async_encode(&forest, &mut self.store).await.unwrap(); - - // Persist encoded private forest to the block store. - self.store.put_serializable(&cbor_bytes).await.unwrap() - } - - pub async fn load_forest(&mut self, forest_cid: Cid) -> Rc { - // Fetch CBOR bytes of private forest from the blockstore. - let cbor_bytes = self.store - .get_deserializable::>(&forest_cid) - .await - .unwrap(); - - // Decode private forest CBOR bytes. - Rc::new(dagcbor::decode::(cbor_bytes.as_ref()).unwrap()) - } - - pub async fn update_forest(&mut self, hamt: Rc) -> Cid { - // Serialize the private forest to DAG CBOR. - let cbor_bytes = dagcbor::async_encode(&hamt, &mut self.store).await.unwrap(); - - // Persist encoded private forest to the block store. - self.store.put_serializable(&cbor_bytes).await.unwrap() - } - - pub async fn get_root_dir(&mut self, forest: Rc, private_ref: PrivateRef) -> Rc{ - // Fetch and decrypt root directory from the private forest using provided private ref. - forest - .get(&private_ref, &mut self.store) - .await - .unwrap().unwrap().as_dir().unwrap() - } - - pub async fn make_root_dir(&mut self, forest: Rc) -> (Cid, PrivateRef) { - // Create a new directory. - let dir = Rc::new(PrivateDirectory::new( - Namefilter::default(), - Utc::now(), - &mut self.rng, - )); - - let PrivateOpResult { root_dir, hamt, .. } = dir - .mkdir(&["root".into()], true, Utc::now(), forest, &mut self.store,&mut self.rng) - .await - .unwrap(); - - (self.update_forest(hamt).await, root_dir.header.get_private_ref().unwrap()) - } - - pub async fn write_file(&mut self, forest: Rc, root_dir: Rc, path_segments: &[String], content: Vec) -> Cid{ - let PrivateOpResult { hamt, .. } = root_dir - .write( - path_segments, - true, - Utc::now(), - content, - forest, - &mut self.store, - &mut self.rng, - ) - .await - .unwrap(); - self.update_forest(hamt).await - - } - - pub async fn read_file(&mut self, forest: Rc, root_dir: Rc, path_segments: &[String]) -> Vec { - let PrivateOpResult { result, .. } = root_dir - .read(path_segments, true, forest, &mut self.store) - .await - .unwrap(); - result - } - - - - pub async fn mkdir(&mut self, forest: Rc, root_dir: Rc, path_segments: &[String]) -> Cid { - let PrivateOpResult { hamt, .. } = root_dir - .mkdir(path_segments, true, Utc::now(), forest, &mut self.store,&mut self.rng) - .await - .unwrap(); - - self.update_forest(hamt).await - } - - pub async fn ls_files(&mut self, forest: Rc, root_dir: Rc, path_segments: &[String]) -> Vec<(String, Metadata)> { - let PrivateOpResult { result, .. } = root_dir - .ls(path_segments, true, forest, &mut self.store) - .await - .unwrap(); - result - } - -} - -// Implement synced version of the library for using in android jni. -impl PrivateDirectoryHelper { - pub fn synced_new_private_forest(&mut self) -> Cid - { - let runtime = - tokio::runtime::Runtime::new().expect("Unable to create a runtime"); - return runtime.block_on(self.new_private_forest()); - } - - pub fn synced_load_forest(&mut self, forest_cid: Cid) -> Rc - { - let runtime = - tokio::runtime::Runtime::new().expect("Unable to create a runtime"); - return runtime.block_on(self.load_forest(forest_cid)); - } - - - pub fn synced_get_root_dir(&mut self, forest: Rc, private_ref: PrivateRef) -> Rc - { - let runtime = - tokio::runtime::Runtime::new().expect("Unable to create a runtime"); - return runtime.block_on(self.get_root_dir(forest, private_ref)); - } - - pub fn synced_make_root_dir(&mut self, forest: Rc) -> (Cid, PrivateRef) - { - let runtime = - tokio::runtime::Runtime::new().expect("Unable to create a runtime"); - return runtime.block_on(self.make_root_dir(forest)); - } - - pub fn synced_write_file(&mut self, forest: Rc, root_dir: Rc, path_segments: &[String], content: Vec) -> Cid - { - let runtime = - tokio::runtime::Runtime::new().expect("Unable to create a runtime"); - return runtime.block_on(self.write_file(forest, root_dir, path_segments, content)); - } - - pub fn synced_read_file(&mut self, forest: Rc, root_dir: Rc, path_segments: &[String]) -> Vec - { - let runtime = - tokio::runtime::Runtime::new().expect("Unable to create a runtime"); - return runtime.block_on(self.read_file(forest, root_dir, path_segments)); - } - - pub fn synced_mkdir(&mut self, forest: Rc, root_dir: Rc, path_segments: &[String]) -> Cid - { - let runtime = - tokio::runtime::Runtime::new().expect("Unable to create a runtime"); - return runtime.block_on(self.mkdir(forest, root_dir, path_segments)); - } - - pub fn synced_ls_files(&mut self, forest: Rc, root_dir: Rc, path_segments: &[String]) -> Vec<(String, Metadata)> - { - let runtime = - tokio::runtime::Runtime::new().expect("Unable to create a runtime"); - return runtime.block_on(self.ls_files(forest, root_dir, path_segments)); - } - - pub fn parse_path(path: String) -> Vec { - path.trim().trim_matches('/').split("/"). - map(|s| s.to_string()). - collect() - } - -} - -#[cfg(test)] -mod private_tests { - use crate::private::PrivateDirectoryHelper; - - - #[async_std::test] - async fn test_parse_path() { - let path = "root/test.txt".to_string(); - let out = PrivateDirectoryHelper::parse_path(path); - assert_eq!(out[0], "root".to_string()); - assert_eq!(out[1], "test.txt".to_string()); - } - - #[async_std::test] - async fn iboverall() { - let helper = &mut PrivateDirectoryHelper::new(String::from("./tmp/test")); - let forest_cid = helper.new_private_forest().await; - println!("cid: {:?}", forest_cid); - let forest = helper.load_forest(forest_cid).await; - let (forest_cid, private_ref) = helper.make_root_dir(forest).await; - let forest = helper.load_forest(forest_cid).await; - let root_dir = helper.get_root_dir(forest.to_owned(), private_ref.to_owned()).await; - let new_cid = helper.write_file(forest.to_owned(), root_dir.to_owned(), &["root".into(), "hello".into(), "world.txt".into()], b"hello, world!".to_vec()).await; - let forest = helper.load_forest(new_cid).await; - let ls_result = helper.ls_files(forest.to_owned(), root_dir.to_owned(), &["root".into()]).await; - println!("ls: {:?}", ls_result); - let new_cid = helper.mkdir(forest.to_owned(), root_dir.to_owned(), &["root".into(), "hi".into()]).await; - let forest = helper.load_forest(new_cid).await; - let ls_result = helper.ls_files(forest.to_owned(), root_dir.to_owned(), &["root".into()]).await; - assert_eq!(ls_result.get(0).unwrap().0, "hello"); - assert_eq!(ls_result.get(1).unwrap().0, "hi"); - let content = helper.read_file(forest.to_owned(), root_dir.to_owned(), &["root".into(), "hello".into(), "world.txt".into()]).await; - assert_eq!(content, b"hello, world!".to_vec()); - let private_ref_serialized = serde_json::to_string(&private_ref).unwrap(); - println!("private ref: \n{}", private_ref_serialized); - - } - -} From 6653f3019ffa8da75201d54d254b16cdc98ba03c Mon Sep 17 00:00:00 2001 From: hh Date: Tue, 29 Nov 2022 18:02:55 +0330 Subject: [PATCH 2/5] Add fula blockstore support --- lib/src/main/java/land/fx/wnfslib/Lib.kt | 30 ++-- wnfslib/Cargo.lock | 220 +++++++++++------------ 2 files changed, 122 insertions(+), 128 deletions(-) diff --git a/lib/src/main/java/land/fx/wnfslib/Lib.kt b/lib/src/main/java/land/fx/wnfslib/Lib.kt index 5375ae0..167e122 100644 --- a/lib/src/main/java/land/fx/wnfslib/Lib.kt +++ b/lib/src/main/java/land/fx/wnfslib/Lib.kt @@ -1,5 +1,7 @@ package land.fx.wnfslib; +import fulamobile.Client; + data class Config( val cid: String, val private_ref: String){ @@ -9,45 +11,45 @@ data class Config( } } -private external fun createPrivateForestNative(dbPath: String): String +private external fun createPrivateForestNative(fulaClient: Client): String -private external fun createRootDirNative(dbPath: String, cid: String): Config +private external fun createRootDirNative(fulaClient: Client, cid: String): Config -private external fun writeFileNative(dbPath: String, cid: String, privateRef: String, path: String, content: ByteArray): Config +private external fun writeFileNative(fulaClient: Client, cid: String, privateRef: String, path: String, content: ByteArray): Config -private external fun lsNative(dbPath: String, cid: String, privateRef: String, path: String): String +private external fun lsNative(fulaClient: Client, cid: String, privateRef: String, path: String): String -private external fun mkdirNative(dbPath: String, cid: String, privateRef: String, path: String): Config +private external fun mkdirNative(fulaClient: Client, cid: String, privateRef: String, path: String): Config -private external fun rmNative(dbPath: String, cid: String, privateRef: String, path: String): Config +private external fun rmNative(fulaClient: Client, cid: String, privateRef: String, path: String): Config -private external fun readFileNative(dbPath: String, cid: String, privateRef: String, path: String): ByteArray? +private external fun readFileNative(fulaClient: Client, cid: String, privateRef: String, path: String): ByteArray? -fun createPrivateForest(dbPath: String): String { +fun createPrivateForest(fulaClient: Client): String { return createPrivateForestNative(dbPath) } -fun createRootDir(dbPath: String, cid: String): Config { +fun createRootDir(fulaClient: Client, cid: String): Config { return createRootDirNative(dbPath, cid) } -fun writeFile(dbPath: String, cid: String, privateRef: String, path: String, content: ByteArray): Config { +fun writeFile(fulaClient: Client, cid: String, privateRef: String, path: String, content: ByteArray): Config { return writeFileNative(dbPath, cid, privateRef, path, content) } -fun ls(dbPath: String, cid: String, privateRef: String, path: String): String { +fun ls(fulaClient: Client, cid: String, privateRef: String, path: String): String { return lsNative(dbPath, cid, privateRef, path) } -fun mkdir(dbPath: String, cid: String, privateRef: String, path: String): Config { +fun mkdir(fulaClient: Client, cid: String, privateRef: String, path: String): Config { return mkdirNative(dbPath, cid, privateRef, path) } -fun rm(dbPath: String, cid: String, privateRef: String, path: String): Config { +fun rm(fulaClient: Client, cid: String, privateRef: String, path: String): Config { return rmNative(dbPath, cid, privateRef, path) } -fun readFile(dbPath: String, cid: String, privateRef: String, path: String): ByteArray? { +fun readFile(fulaClient: Client, cid: String, privateRef: String, path: String): ByteArray? { return readFileNative(dbPath, cid, privateRef, path) } diff --git a/wnfslib/Cargo.lock b/wnfslib/Cargo.lock index a5290f6..e87b8ab 100644 --- a/wnfslib/Cargo.lock +++ b/wnfslib/Cargo.lock @@ -56,9 +56,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.19" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] @@ -120,9 +120,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" dependencies = [ "concurrent-queue", "event-listener", @@ -131,15 +131,15 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +checksum = "17adb73da160dfb475c183343c8cccd80721ea5a605d3eb57125f0a7b7a92d0b" dependencies = [ + "async-lock", "async-task", "concurrent-queue", "fastrand", "futures-lite", - "once_cell", "slab", ] @@ -160,9 +160,9 @@ dependencies = [ [[package]] name = "async-io" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8121296a9f05be7f34aa4196b1747243b3b62e048bb7906f644f3fbfc490cf7" +checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" dependencies = [ "async-lock", "autocfg 1.1.0", @@ -175,7 +175,7 @@ dependencies = [ "slab", "socket2", "waker-fn", - "winapi", + "windows-sys", ] [[package]] @@ -261,9 +261,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" +checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364" dependencies = [ "proc-macro2", "quote", @@ -347,7 +347,7 @@ checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" dependencies = [ "arrayref", "arrayvec", - "constant_time_eq", + "constant_time_eq 0.1.5", ] [[package]] @@ -358,20 +358,20 @@ checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4" dependencies = [ "arrayref", "arrayvec", - "constant_time_eq", + "constant_time_eq 0.1.5", ] [[package]] name = "blake3" -version = "1.3.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" +checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", - "constant_time_eq", + "constant_time_eq 0.2.4", ] [[package]] @@ -385,16 +385,16 @@ dependencies = [ [[package]] name = "blocking" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" +checksum = "3c67b173a56acffd6d2326fb7ab938ba0b00a71480e14902b2591c87bc5741e8" dependencies = [ "async-channel", + "async-lock", "async-task", "atomic-waker", "fastrand", "futures-lite", - "once_cell", ] [[package]] @@ -417,15 +417,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" - -[[package]] -name = "cache-padded" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" [[package]] name = "cached" @@ -439,9 +433,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.74" +version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574" +checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" [[package]] name = "cesu8" @@ -457,9 +451,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.22" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ "iana-time-zone", "js-sys", @@ -539,11 +533,11 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "1.2.4" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" +checksum = "bd7bef69dc86e3c610e4e7aed41035e2a7ed12e72dd7530f61327a6579a4390b" dependencies = [ - "cache-padded", + "crossbeam-utils", ] [[package]] @@ -552,6 +546,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "constant_time_eq" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" + [[package]] name = "core-foundation-sys" version = "0.8.3" @@ -608,9 +608,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.11" +version = "0.9.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" dependencies = [ "autocfg 1.1.0", "cfg-if", @@ -621,9 +621,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ "cfg-if", ] @@ -665,9 +665,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.80" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" +checksum = "d4a41a86530d0fe7f5d9ea779916b7cadd2d4f9add748b99c2c029cbbdfaf453" dependencies = [ "cc", "cxxbridge-flags", @@ -677,9 +677,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.80" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" +checksum = "06416d667ff3e3ad2df1cd8cd8afae5da26cf9cec4d0825040f88b5ca659a2f0" dependencies = [ "cc", "codespan-reporting", @@ -692,15 +692,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.80" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" +checksum = "820a9a2af1669deeef27cb271f476ffd196a2c4b6731336011e0ba63e2c7cf71" [[package]] name = "cxxbridge-macro" -version = "1.0.80" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" +checksum = "a08a6e2fcc370a089ad3b4aaf54db3b1b4cee38ddabce5896b33eb693275f470" dependencies = [ "proc-macro2", "quote", @@ -735,9 +735,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ "block-buffer", "crypto-common", @@ -751,9 +751,9 @@ checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "env_logger" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ "atty", "humantime", @@ -778,7 +778,7 @@ dependencies = [ "flume", "half", "lebe", - "miniz_oxide 0.6.2", + "miniz_oxide", "smallvec", "threadpool", ] @@ -800,12 +800,12 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", - "miniz_oxide 0.5.4", + "miniz_oxide", ] [[package]] @@ -1031,9 +1031,9 @@ dependencies = [ [[package]] name = "gloo-timers" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" +checksum = "98c4a8d6391675c6b2ee1a6c8d06e8e2d03605c44cec1270675985a4c2a5500b" dependencies = [ "futures-channel", "futures-core", @@ -1128,9 +1128,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.4" +version = "0.24.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd8e4fb07cf672b1642304e731ef8a6a4c7891d67bb4fd4f5ce58cd6ed86803c" +checksum = "69b7ea949b537b0fd0af141fff8c77690f2ce96f4f41f042ccb6c69c6c965945" dependencies = [ "bytemuck", "byteorder", @@ -1147,9 +1147,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg 1.1.0", "hashbrown 0.12.3", @@ -1201,9 +1201,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jpeg-decoder" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9478aa10f73e7528198d75109c8be5cd7d15fb530238040148d5f9a22d4c5b3b" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" dependencies = [ "rayon", ] @@ -1219,9 +1219,12 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" +checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +dependencies = [ + "cpufeatures", +] [[package]] name = "kv" @@ -1393,22 +1396,13 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg 1.1.0", ] -[[package]] -name = "miniz_oxide" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.6.2" @@ -1462,9 +1456,9 @@ dependencies = [ [[package]] name = "multihash-derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" +checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" dependencies = [ "proc-macro-crate", "proc-macro-error", @@ -1586,9 +1580,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.42" +version = "0.10.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" +checksum = "020433887e44c27ff16365eaa2d380547a94544ad509aff6eb5b6e3e0b27b376" dependencies = [ "bitflags", "cfg-if", @@ -1621,9 +1615,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.77" +version = "0.9.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" +checksum = "07d5c8cb6e57b3a3612064d7b18b117912b4ce70955c2504d4b741c9e244b132" dependencies = [ "autocfg 1.1.0", "cc", @@ -1657,7 +1651,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.4", + "parking_lot_core 0.9.5", ] [[package]] @@ -1676,9 +1670,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" dependencies = [ "cfg-if", "libc", @@ -1750,21 +1744,21 @@ dependencies = [ "bitflags", "crc32fast", "flate2", - "miniz_oxide 0.6.2", + "miniz_oxide", ] [[package]] name = "polling" -version = "2.4.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4609a838d88b73d8238967b60dd115cc08d38e2bbaf51ee1e4b695f89122e2" +checksum = "166ca89eb77fd403230b9c156612965a81e094ec6ec3aa13663d4c8b113fa748" dependencies = [ "autocfg 1.1.0", "cfg-if", "libc", "log", "wepoll-ffi", - "winapi", + "windows-sys", ] [[package]] @@ -1787,11 +1781,10 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro-crate" -version = "1.2.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ - "once_cell", "thiserror", "toml", ] @@ -2025,11 +2018,10 @@ dependencies = [ [[package]] name = "rayon" -version = "1.5.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +checksum = "1e060280438193c554f654141c9ea9417886713b7acd75974c85b18a69a88e0b" dependencies = [ - "autocfg 1.1.0", "crossbeam-deque", "either", "rayon-core", @@ -2037,9 +2029,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.3" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -2135,9 +2127,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.147" +version = "1.0.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" dependencies = [ "serde_derive", ] @@ -2162,9 +2154,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" dependencies = [ "proc-macro2", "quote", @@ -2173,9 +2165,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" dependencies = [ "itoa", "ryu", @@ -2283,9 +2275,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" dependencies = [ "proc-macro2", "quote", @@ -2364,9 +2356,9 @@ dependencies = [ [[package]] name = "tiff" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f71e422515e83e3ab8a03d4781d05ebf864fc61f4546e6ecffa58cbd34181a0" +checksum = "f17def29300a156c19ae30814710d9c63cd50288a49c6fd3a10ccfbe4cf886fd" dependencies = [ "flate2", "jpeg-decoder", @@ -2375,9 +2367,9 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -2401,9 +2393,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.21.2" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" dependencies = [ "autocfg 1.1.0", "bytes", @@ -2781,7 +2773,7 @@ dependencies = [ [[package]] name = "wnfs_utils" version = "0.1.0" -source = "git+https://github.com/hhio618/wnfs-utils#98ee69e919236fdd588f37304688f7444a91844e" +source = "git+https://github.com/hhio618/wnfs-utils#fe34f1d9f6171e926912be2700eb1e82c866b135" dependencies = [ "anyhow", "async-std", @@ -2825,9 +2817,9 @@ dependencies = [ [[package]] name = "wyz" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ "tap", ] From 6d4679032f05ee13bdd6d489ddfa20f88ada0515 Mon Sep 17 00:00:00 2001 From: hh Date: Wed, 30 Nov 2022 00:09:45 +0330 Subject: [PATCH 3/5] Fix build --- .vscode/settings.json | 2 +- build.gradle | 3 +- wnfslib/Cargo.lock | 33 +++++++-------- wnfslib/Cargo.toml | 3 +- wnfslib/src/lib.rs | 93 ++++++++++++++++++++++++------------------- 5 files changed, 73 insertions(+), 61 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 1bd927f..49e739b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "rust-analyzer.cargo.target": "aarch64-linux-android", + // "rust-analyzer.cargo.target": "aarch64-linux-android", } diff --git a/build.gradle b/build.gradle index 80766c0..01876c6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = '1.7.10' - ext.ndkVersion = '25.1.8937393' + ext.ndkVersion = '25.0.8775105' repositories { google() jcenter() @@ -29,6 +29,7 @@ allprojects { jcenter() maven { url "https://plugins.gradle.org/m2/" } gradlePluginPortal() + maven { url "https://jitpack.io" } } } diff --git a/wnfslib/Cargo.lock b/wnfslib/Cargo.lock index e87b8ab..ba73043 100644 --- a/wnfslib/Cargo.lock +++ b/wnfslib/Cargo.lock @@ -2771,48 +2771,49 @@ dependencies = [ ] [[package]] -name = "wnfs_utils" +name = "wnfslib-android" version = "0.1.0" -source = "git+https://github.com/hhio618/wnfs-utils#fe34f1d9f6171e926912be2700eb1e82c866b135" dependencies = [ + "android_logger", "anyhow", - "async-std", - "async-trait", "chrono", "crc32fast", + "env_logger", + "image", + "jni", "kv", "libipld", - "multihash", + "log", + "ndk", + "openssl", "rand 0.8.5", - "rand_core 0.6.4", "serde", "serde_json", "tokio", + "url", "wnfs", + "wnfsutils", ] [[package]] -name = "wnfslib-android" +name = "wnfsutils" version = "0.1.0" +source = "git+https://github.com/hhio618/wnfs-utils#71971fae1eba47e0715718796805b4e1a10587e8" dependencies = [ - "android_logger", + "anyhow", + "async-std", + "async-trait", "chrono", "crc32fast", - "env_logger", - "image", - "jni", "kv", "libipld", - "log", - "ndk", - "openssl", + "multihash", "rand 0.8.5", + "rand_core 0.6.4", "serde", "serde_json", "tokio", - "url", "wnfs", - "wnfs_utils", ] [[package]] diff --git a/wnfslib/Cargo.toml b/wnfslib/Cargo.toml index f1064be..f506f2a 100644 --- a/wnfslib/Cargo.toml +++ b/wnfslib/Cargo.toml @@ -9,7 +9,8 @@ crate-type = ["cdylib", "staticlib"] [dependencies] wnfs = "0.1.9" -wnfs_utils = { git = "https://github.com/hhio618/wnfs-utils" } +wnfsutils = { git = "https://github.com/hhio618/wnfs-utils" } +anyhow = "1.0.66" serde = "1.0.147" serde_json = "1.0.87" chrono = "0.4.22" diff --git a/wnfslib/src/lib.rs b/wnfslib/src/lib.rs index 6e41ce8..1ae3950 100644 --- a/wnfslib/src/lib.rs +++ b/wnfslib/src/lib.rs @@ -1,5 +1,5 @@ -#[cfg(target_os = "android")] -#[allow(non_snake_case)] +// #[cfg(target_os = "android")] +// #[allow(non_snake_case)] pub mod android { extern crate jni; @@ -21,24 +21,27 @@ pub mod android { use wnfs::public::PublicDirectory; use chrono::Utc; use kv::*; + use anyhow::Result; use wnfsutils::private_forest::PrivateDirectoryHelper; - use wnfsutils::blockstore::FFIStore; + use wnfsutils::blockstore::{FFIStore, FFIFriendlyBlockStore}; - struct JNIStore{ - env: JNIEnv, - fula_client: JObject + struct JNIStore<'a>{ + env: JNIEnv<'a>, + fula_client: JObject<'a> } - impl JNIStore { - fn new(env: JNIEnv, fula_client: JObject) -> Self{ + + impl<'a> JNIStore<'a> { + fn new(env: JNIEnv<'a>, fula_client: JObject<'a>) -> Self{ Self { env, fula_client } } } - impl FFIStore for JNIStore { - + + impl<'a> FFIStore<'a> for JNIStore<'a> { + /// Retrieves an array of bytes from the block store with given CID. fn get_block(&self, cid: Vec) -> Result>{ - let get_fn = env + let get_fn = self.env .get_method_id( self.fula_client, "get", @@ -46,8 +49,8 @@ pub mod android { ) .unwrap(); - let cidJByteArray = vec_to_jbyteArray(env, cid); - let dataJByteArray = env + let cidJByteArray = vec_to_jbyteArray(self.env, cid); + let dataJByteArray = self.env .call_method_unchecked( self.fula_client, get_fn, @@ -60,13 +63,13 @@ pub mod android { .l() .unwrap(); - let data = jbyteArray_to_vec(env, dataJByteArray); + let data = jbyteArray_to_vec(self.env, dataJByteArray.into_inner()); Ok(data) } /// Stores an array of bytes in the block store. fn put_block(&self, cid: Vec, bytes: Vec) -> Result>{ - let put_fn = env + let put_fn = self.env .get_method_id( self.fula_client, "put", @@ -74,12 +77,12 @@ pub mod android { ) .unwrap(); - let cidJByteArray = vec_to_jbyteArray(env, cid); - let dataJByteArray = vec_to_jbyteArray(env, bytes); - env + let cidJByteArray = vec_to_jbyteArray(self.env, cid.to_owned()); + let dataJByteArray = vec_to_jbyteArray(self.env, bytes); + self.env .call_method_unchecked( self.fula_client, - get_fn, + put_fn, JavaType::Object(String::from("")), &[ JValue::from(cidJByteArray), @@ -89,7 +92,7 @@ pub mod android { .unwrap() .l() .unwrap(); - Ok(cidJByteArray) + Ok(cid.to_owned()) } } @@ -105,9 +108,10 @@ pub mod android { jni_fula_client: JObject, ) -> jstring { let store = JNIStore::new(env, jni_fula_client); - let helper = &mut PrivateDirectoryHelper::new(store); + let block_store = FFIFriendlyBlockStore::new(Box::new(store)); + let helper = &mut PrivateDirectoryHelper::new(block_store); trace!("**********************cp1**************"); - serialize_cid(env, helper.synced_new_private_forest()).into_inner() + serialize_cid(env, helper.synced_create_private_forest().unwrap()).into_inner() } #[no_mangle] @@ -118,11 +122,12 @@ pub mod android { jni_cid: JString, ) -> jobject { let store = JNIStore::new(env, jni_fula_client); - let helper = &mut PrivateDirectoryHelper::new(store); + let block_store = FFIFriendlyBlockStore::new(Box::new(store)); + let helper = &mut PrivateDirectoryHelper::new(block_store); let forest_cid = deserialize_cid(env, jni_cid); trace!("cid: {}", forest_cid); - let forest = helper.synced_load_forest(forest_cid); - let (cid, private_ref) = helper.synced_make_root_dir(forest); + let forest = helper.synced_load_forest(forest_cid).unwrap(); + let (cid, private_ref) = helper.synced_init(forest); trace!("pref: {:?}", private_ref); serialize_config(env, cid, private_ref) @@ -139,13 +144,14 @@ pub mod android { jni_content: jbyteArray, ) -> jobject { let store = JNIStore::new(env, jni_fula_client); - let helper = &mut PrivateDirectoryHelper::new(store); - + let block_store = FFIFriendlyBlockStore::new(Box::new(store)); + let helper = &mut PrivateDirectoryHelper::new(block_store); + let cid = deserialize_cid(env, jni_cid); let private_ref = deserialize_private_ref(env, jni_private_ref); - let forest = helper.synced_load_forest(cid); - let root_dir = helper.synced_get_root_dir(forest.to_owned(), private_ref); + let forest = helper.synced_load_forest(cid).unwrap(); + let root_dir = helper.synced_get_root_dir(forest.to_owned(), private_ref).unwrap(); let path_segments = prepare_path_segments(env, jni_path_segments); let content = jbyteArray_to_vec(env, jni_content); let (cid, private_ref) = helper.synced_write_file(forest.to_owned(), root_dir, &path_segments, content); @@ -162,15 +168,16 @@ pub mod android { jni_path_segments: JString, ) -> jbyteArray { let store = JNIStore::new(env, jni_fula_client); - let helper = &mut PrivateDirectoryHelper::new(store); - + let block_store = FFIFriendlyBlockStore::new(Box::new(store)); + let helper = &mut PrivateDirectoryHelper::new(block_store); + let cid = deserialize_cid(env, jni_cid); let private_ref = deserialize_private_ref(env, jni_private_ref); - let forest = helper.synced_load_forest(cid); - let root_dir = helper.synced_get_root_dir(forest.to_owned(), private_ref); + let forest = helper.synced_load_forest(cid).unwrap(); + let root_dir = helper.synced_get_root_dir(forest.to_owned(), private_ref).unwrap(); let path_segments = prepare_path_segments(env, jni_path_segments); - vec_to_jbyteArray(env, helper.synced_read_file(forest.to_owned(), root_dir, &path_segments)) + vec_to_jbyteArray(env, helper.synced_read_file(forest.to_owned(), root_dir, &path_segments).unwrap()) } #[no_mangle] @@ -183,13 +190,14 @@ pub mod android { jni_path_segments: JString, ) -> jstring { let store = JNIStore::new(env, jni_fula_client); - let helper = &mut PrivateDirectoryHelper::new(store); - + let block_store = FFIFriendlyBlockStore::new(Box::new(store)); + let helper = &mut PrivateDirectoryHelper::new(block_store); + let cid = deserialize_cid(env, jni_cid); let private_ref = deserialize_private_ref(env, jni_private_ref); - let forest = helper.synced_load_forest(cid); - let root_dir = helper.synced_get_root_dir(forest.to_owned(), private_ref); + let forest = helper.synced_load_forest(cid).unwrap(); + let root_dir = helper.synced_get_root_dir(forest.to_owned(), private_ref).unwrap(); let path_segments = prepare_path_segments(env, jni_path_segments); let (cid, private_ref) = helper.synced_mkdir(forest.to_owned(), root_dir, &path_segments); serialize_config(env, cid, private_ref) @@ -205,13 +213,14 @@ pub mod android { jni_path_segments: JString, ) -> jstring { let store = JNIStore::new(env, jni_fula_client); - let helper = &mut PrivateDirectoryHelper::new(store); - + let block_store = FFIFriendlyBlockStore::new(Box::new(store)); + let helper = &mut PrivateDirectoryHelper::new(block_store); + let cid = deserialize_cid(env, jni_cid); let private_ref = deserialize_private_ref(env, jni_private_ref); - let forest = helper.synced_load_forest(cid); - let root_dir = helper.synced_get_root_dir(forest.to_owned(), private_ref); + let forest = helper.synced_load_forest(cid).unwrap(); + let root_dir = helper.synced_get_root_dir(forest.to_owned(), private_ref).unwrap(); let path_segments = prepare_path_segments(env, jni_path_segments); let output = prepare_ls_output(helper.synced_ls_files(forest.to_owned(), root_dir, &path_segments)); env.new_string(output.join("\n")). From eae0a1356e6639bcc3098a364a4f3c9649191568 Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Tue, 29 Nov 2022 21:04:52 -0500 Subject: [PATCH 4/5] replaced references to dbPath with fulaClient and updated ndk Version --- build.gradle | 2 +- lib/src/main/java/land/fx/wnfslib/Lib.kt | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 01876c6..966e4b7 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = '1.7.10' - ext.ndkVersion = '25.0.8775105' + ext.ndkVersion = '25.1.8937393' repositories { google() jcenter() diff --git a/lib/src/main/java/land/fx/wnfslib/Lib.kt b/lib/src/main/java/land/fx/wnfslib/Lib.kt index 167e122..4987eac 100644 --- a/lib/src/main/java/land/fx/wnfslib/Lib.kt +++ b/lib/src/main/java/land/fx/wnfslib/Lib.kt @@ -26,31 +26,31 @@ private external fun rmNative(fulaClient: Client, cid: String, privateRef: Strin private external fun readFileNative(fulaClient: Client, cid: String, privateRef: String, path: String): ByteArray? fun createPrivateForest(fulaClient: Client): String { - return createPrivateForestNative(dbPath) + return createPrivateForestNative(fulaClient) } fun createRootDir(fulaClient: Client, cid: String): Config { - return createRootDirNative(dbPath, cid) + return createRootDirNative(fulaClient, cid) } fun writeFile(fulaClient: Client, cid: String, privateRef: String, path: String, content: ByteArray): Config { - return writeFileNative(dbPath, cid, privateRef, path, content) + return writeFileNative(fulaClient, cid, privateRef, path, content) } fun ls(fulaClient: Client, cid: String, privateRef: String, path: String): String { - return lsNative(dbPath, cid, privateRef, path) + return lsNative(fulaClient, cid, privateRef, path) } fun mkdir(fulaClient: Client, cid: String, privateRef: String, path: String): Config { - return mkdirNative(dbPath, cid, privateRef, path) + return mkdirNative(fulaClient, cid, privateRef, path) } fun rm(fulaClient: Client, cid: String, privateRef: String, path: String): Config { - return rmNative(dbPath, cid, privateRef, path) + return rmNative(fulaClient, cid, privateRef, path) } fun readFile(fulaClient: Client, cid: String, privateRef: String, path: String): ByteArray? { - return readFileNative(dbPath, cid, privateRef, path) + return readFileNative(fulaClient, cid, privateRef, path) } // Initialize Rust Library Logging From 7563091d5eb9cba23b48bbf26e4a21bd999adc89 Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Tue, 29 Nov 2022 21:05:17 -0500 Subject: [PATCH 5/5] Update Readme.md --- Readme.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 8c44a0f..1501418 100644 --- a/Readme.md +++ b/Readme.md @@ -5,7 +5,12 @@ A wnfslib wrapper for Android. ## Prerequisites - Kotlin toolchain -- Android SDK + NDK r24 (latest) +- Android SDK + NDK (latest) +- python3 and Python command available +- Cargo and CMake +- java +- gradle +- rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android ## Debug @@ -41,4 +46,4 @@ Ensure you have committed your changes. ./gradlew release ``` -Then simply push to the repo. \ No newline at end of file +Then simply push to the repo.