testing store rocksdb on android

pull/19/head
Niko PLP 1 year ago
parent dce163bfda
commit 82195af69a
  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]]
name = "librocksdb-sys"
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 = [
"bindgen",
"bzip2-sys",
@ -3279,6 +3279,7 @@ dependencies = [
"serde",
"serde_bare",
"serde_bytes",
"stores-rocksdb",
"unique_id",
"url",
"wasm-bindgen",
@ -4008,7 +4009,7 @@ dependencies = [
[[package]]
name = "rocksdb"
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 = [
"libc",
"librocksdb-sys",

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

@ -39,3 +39,4 @@ features = ["js"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
getrandom = "0.2.7"
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::Read;
use std::path::PathBuf;
#[derive(Debug)]
pub enum PeerConnection {
@ -420,6 +421,18 @@ impl<'a> Broker<'a> {
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 {
let (shutdown_sender, shutdown_receiver) = mpsc::unbounded::<ProtocolError>();
let mut random_buf = [0u8; 4];

Loading…
Cancel
Save