rename ngcli gen-user to gen-key

pull/19/head
Niko PLP 1 year ago
parent e350a7a35e
commit 9798517771
  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_bare",
"serde_bytes", "serde_bytes",
"serde_json", "serde_json",
"stores-lmdb",
"tempfile", "tempfile",
"zeroize", "zeroize",
] ]
@ -3279,7 +3278,6 @@ dependencies = [
"serde", "serde",
"serde_bare", "serde_bare",
"serde_bytes", "serde_bytes",
"stores-rocksdb",
"unique_id", "unique_id",
"url", "url",
"wasm-bindgen", "wasm-bindgen",

@ -41,7 +41,7 @@ async fn test(app: tauri::AppHandle) -> Result<(), ()> {
.resolve("storage", BaseDirectory::AppLocalData) .resolve("storage", BaseDirectory::AppLocalData)
.map_err(|_| ())?; .map_err(|_| ())?;
BROKER.read().await.test_storage(path); //BROKER.read().await.test_storage(path);
Ok(()) Ok(())
} }

@ -11,7 +11,6 @@ repository = "https://git.nextgraph.org/NextGraph/nextgraph-rs"
p2p-repo = { path = "../p2p-repo", features = ["server_log_output"] } p2p-repo = { path = "../p2p-repo", features = ["server_log_output"] }
p2p-net = { path = "../p2p-net" } p2p-net = { path = "../p2p-net" }
p2p-client-ws = { path = "../p2p-client-ws" } p2p-client-ws = { path = "../p2p-client-ws" }
stores-lmdb = { path = "../stores-lmdb" }
async-std = { version = "1.12.0", features = ["attributes"] } async-std = { version = "1.12.0", features = ["attributes"] }
futures = "0.3.24" futures = "0.3.24"
tempfile = "3" tempfile = "3"

@ -164,8 +164,8 @@ async fn main() -> Result<(), ProtocolError> {
.arg(arg!(-u --unique "only lists unique-use invitations").required(false))) .arg(arg!(-u --unique "only lists unique-use invitations").required(false)))
) )
.subcommand( .subcommand(
Command::new("gen-user") Command::new("gen-key")
.about("Generates a new user public key and private key to be used for authentication.") .about("Generates a new key pair () public key and private key ) to be used by example for user authentication.")
) )
.get_matches(); .get_matches();
@ -180,7 +180,7 @@ async fn main() -> Result<(), ProtocolError> {
} }
env_logger::init(); 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(); let (privkey, pubkey) = generate_keypair();
println!("Your UserId is: {pubkey}"); println!("Your UserId is: {pubkey}");
println!("Your Private key is: {privkey}"); println!("Your Private key is: {privkey}");

@ -39,4 +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" } # stores-rocksdb = { path = "../stores-rocksdb" }

@ -421,21 +421,21 @@ impl<'a> Broker<'a> {
self.test self.test
} }
#[cfg(not(target_arch = "wasm32"))] // #[cfg(not(target_arch = "wasm32"))]
pub fn test_storage(&self, path: PathBuf) { // pub fn test_storage(&self, path: PathBuf) {
use stores_rocksdb::kcv_store::RocksdbKCVStore; // use stores_rocksdb::kcv_store::RocksdbKCVStore;
let key: [u8; 32] = [0; 32]; // let key: [u8; 32] = [0; 32];
let test_storage = RocksdbKCVStore::open(&path, key); // let test_storage = RocksdbKCVStore::open(&path, key);
match test_storage { // match test_storage {
Err(e) => { // Err(e) => {
log_debug!("storage error {}", e); // log_debug!("storage error {}", e);
} // }
Ok(_) => { // Ok(_) => {
log_debug!("storage 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>();

Loading…
Cancel
Save