testing store rocksdb on android

Niko PLP 1 year ago
parent 64d8ec792d
commit ddb4af7457
  1. 5
      Cargo.lock
  2. 1
      ng-app/src/App.svelte
  3. 1
      p2p-net/Cargo.toml
  4. 13
      p2p-net/src/broker.rs

5
Cargo.lock generated

@ -2514,7 +2514,7 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
[[package]] [[package]]
name = "librocksdb-sys" name = "librocksdb-sys"
version = "0.11.0+8.3.2" version = "0.11.0+8.3.2"
source = "git+https://git.nextgraph.org/NextGraph/rust-rocksdb.git?branch=master#7acbf4389bc0f910dbabf8fef1cca8dad052d203" source = "git+https://git.nextgraph.org/NextGraph/rust-rocksdb.git?branch=master#48c0a29f92364c4cd65a5b375765db0b5d7636ab"
dependencies = [ dependencies = [
"bindgen", "bindgen",
"bzip2-sys", "bzip2-sys",
@ -3279,6 +3279,7 @@ dependencies = [
"serde", "serde",
"serde_bare", "serde_bare",
"serde_bytes", "serde_bytes",
"stores-rocksdb",
"unique_id", "unique_id",
"url", "url",
"wasm-bindgen", "wasm-bindgen",
@ -4008,7 +4009,7 @@ dependencies = [
[[package]] [[package]]
name = "rocksdb" name = "rocksdb"
version = "0.21.0" version = "0.21.0"
source = "git+https://git.nextgraph.org/NextGraph/rust-rocksdb.git?branch=master#7acbf4389bc0f910dbabf8fef1cca8dad052d203" source = "git+https://git.nextgraph.org/NextGraph/rust-rocksdb.git?branch=master#48c0a29f92364c4cd65a5b375765db0b5d7636ab"
dependencies = [ dependencies = [
"libc", "libc",
"librocksdb-sys", "librocksdb-sys",

@ -51,6 +51,7 @@
onMount(async () => { onMount(async () => {
let tauri_platform = import.meta.env.TAURI_PLATFORM; let tauri_platform = import.meta.env.TAURI_PLATFORM;
if (tauri_platform) { if (tauri_platform) {
console.log(await ng.test());
let walls = await ng.get_wallets_from_localstorage(); let walls = await ng.get_wallets_from_localstorage();
wallets.set(walls); wallets.set(walls);

@ -39,3 +39,4 @@ features = ["js"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
getrandom = "0.2.7" getrandom = "0.2.7"
default-net = { git = "https://git.nextgraph.org/NextGraph/default-net.git" } default-net = { git = "https://git.nextgraph.org/NextGraph/default-net.git" }
stores-rocksdb = { path = "../stores-rocksdb" }

@ -36,6 +36,7 @@ use std::ops::Deref;
use std::io::BufReader; use std::io::BufReader;
use std::io::Read; use std::io::Read;
use std::path::PathBuf;
#[derive(Debug)] #[derive(Debug)]
pub enum PeerConnection { pub enum PeerConnection {
@ -420,6 +421,18 @@ impl<'a> Broker<'a> {
self.test self.test
} }
#[cfg(not(target_arch = "wasm32"))]
pub fn test_storage(path: PathBuf) {
use stores_rocksdb::kcv_store::RocksdbKCVStore;
let key: [u8; 32] = [0; 32];
let test_storage = RocksdbKCVStore::open(&path, key);
match test_storage {
Err(e) => log_debug!("storage error {}", e),
Ok(_) => log_debug!("storage ok"),
}
}
pub fn new() -> Self { pub fn new() -> Self {
let (shutdown_sender, shutdown_receiver) = mpsc::unbounded::<ProtocolError>(); let (shutdown_sender, shutdown_receiver) = mpsc::unbounded::<ProtocolError>();
let mut random_buf = [0u8; 4]; let mut random_buf = [0u8; 4];

Loading…
Cancel
Save