From d386d134d0f40a9dcec94a605fd32182373cc948 Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Thu, 17 Aug 2023 17:48:02 +0300 Subject: [PATCH] rename ngcli gen-user to gen-key --- Cargo.lock | 2 -- ng-app/src-tauri/src/lib.rs | 2 +- ngcli/Cargo.toml | 1 - ngcli/src/main.rs | 6 +++--- p2p-net/Cargo.toml | 2 +- p2p-net/src/broker.rs | 30 +++++++++++++++--------------- 6 files changed, 20 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 094f727..cddead2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2941,7 +2941,6 @@ dependencies = [ "serde_bare", "serde_bytes", "serde_json", - "stores-lmdb", "tempfile", "zeroize", ] @@ -3279,7 +3278,6 @@ dependencies = [ "serde", "serde_bare", "serde_bytes", - "stores-rocksdb", "unique_id", "url", "wasm-bindgen", diff --git a/ng-app/src-tauri/src/lib.rs b/ng-app/src-tauri/src/lib.rs index ef5cac1..81ee701 100644 --- a/ng-app/src-tauri/src/lib.rs +++ b/ng-app/src-tauri/src/lib.rs @@ -41,7 +41,7 @@ async fn test(app: tauri::AppHandle) -> Result<(), ()> { .resolve("storage", BaseDirectory::AppLocalData) .map_err(|_| ())?; - BROKER.read().await.test_storage(path); + //BROKER.read().await.test_storage(path); Ok(()) } diff --git a/ngcli/Cargo.toml b/ngcli/Cargo.toml index 4779321..e108b3b 100644 --- a/ngcli/Cargo.toml +++ b/ngcli/Cargo.toml @@ -11,7 +11,6 @@ repository = "https://git.nextgraph.org/NextGraph/nextgraph-rs" p2p-repo = { path = "../p2p-repo", features = ["server_log_output"] } p2p-net = { path = "../p2p-net" } p2p-client-ws = { path = "../p2p-client-ws" } -stores-lmdb = { path = "../stores-lmdb" } async-std = { version = "1.12.0", features = ["attributes"] } futures = "0.3.24" tempfile = "3" diff --git a/ngcli/src/main.rs b/ngcli/src/main.rs index 2bd3031..5dcd4e3 100644 --- a/ngcli/src/main.rs +++ b/ngcli/src/main.rs @@ -164,8 +164,8 @@ async fn main() -> Result<(), ProtocolError> { .arg(arg!(-u --unique "only lists unique-use invitations").required(false))) ) .subcommand( - Command::new("gen-user") - .about("Generates a new user public key and private key to be used for authentication.") + Command::new("gen-key") + .about("Generates a new key pair () public key and private key ) to be used by example for user authentication.") ) .get_matches(); @@ -180,7 +180,7 @@ async fn main() -> Result<(), ProtocolError> { } env_logger::init(); - if let Some(matches) = matches.subcommand_matches("gen-user") { + if let Some(matches) = matches.subcommand_matches("gen-key") { let (privkey, pubkey) = generate_keypair(); println!("Your UserId is: {pubkey}"); println!("Your Private key is: {privkey}"); diff --git a/p2p-net/Cargo.toml b/p2p-net/Cargo.toml index 863deba..16e6ef9 100644 --- a/p2p-net/Cargo.toml +++ b/p2p-net/Cargo.toml @@ -39,4 +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" } +# stores-rocksdb = { path = "../stores-rocksdb" } diff --git a/p2p-net/src/broker.rs b/p2p-net/src/broker.rs index a543bb1..9fd6a04 100644 --- a/p2p-net/src/broker.rs +++ b/p2p-net/src/broker.rs @@ -421,21 +421,21 @@ impl<'a> Broker<'a> { self.test } - #[cfg(not(target_arch = "wasm32"))] - pub fn test_storage(&self, 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"); - } - } - } + // #[cfg(not(target_arch = "wasm32"))] + // pub fn test_storage(&self, 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::();