rename ngcli gen-user to gen-key

Niko PLP 9 months ago
parent 9987f2b9c6
commit d386d134d0
  1. 2
      Cargo.lock
  2. 2
      ng-app/src-tauri/src/lib.rs
  3. 1
      ngcli/Cargo.toml
  4. 6
      ngcli/src/main.rs
  5. 2
      p2p-net/Cargo.toml
  6. 30
      p2p-net/src/broker.rs

2
Cargo.lock generated

@ -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",

@ -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(())
}

@ -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"

@ -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}");

@ -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" }

@ -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::<ProtocolError>();

Loading…
Cancel
Save