Skip to content

Commit

Permalink
chore: add comments to config files
Browse files Browse the repository at this point in the history
  • Loading branch information
edytapawlak committed Jun 14, 2024
1 parent 3a49fc4 commit 3e10176
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/watcher/src/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ impl WatcherData {
Ok(())
}

/// Forward query to random registered witness and save its response to mailbox.
/// Forward query to registered witnesses and save its response to mailbox.
async fn forward_query(&self, id: &IdentifierPrefix) -> Result<(), ActorError> {
let witnesses = self.get_witnesses_for_prefix(&id)?;
for witness in witnesses {
Expand Down
5 changes: 4 additions & 1 deletion components/watcher/watcher.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
db_path: "db/"
public_url: "http://localhost:3236/"
seed: "Alntkt3u6dDgiQxTATr01dy8M72uuaZEf9eTdM-70Gk8"
seed: "Alntkt3u6dDgiQxTATr01dy8M72uuaZEf9eTdM-70Gk8" # Private key in CESR format
# used by the watcher. If this field
# is not provided, a randomly generated
# key pair will be used.
http_port: 3236
initial_oobis: []
escrow_config:
Expand Down
5 changes: 4 additions & 1 deletion components/witness/witness.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
db_path: "db/"
http_port: 3232
public_url: "http://localhost:3232/"
seed: "ArwXoACJgOleVZ2PY7kXn7rA0II0mHYDhc6WrBH8fDAc"
seed: "ArwXoACJgOleVZ2PY7kXn7rA0II0mHYDhc6WrBH8fDAc" # Private key in CESR format
# used by the witness. If this field
# is not provided, a randomly generated
# key pair will be used.
escrow_config:
default_timeout: 60
16 changes: 16 additions & 0 deletions keriox_core/src/prefix/seed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,19 @@ fn test_derive_keypair() -> Result<(), Error> {

Ok(())
}

#[test]
fn test_derive_from_seed() {
use cesrox::primitives::codes::seed::SeedCode;
use rand::rngs::OsRng;
let ed_keypair = ed25519_dalek::Keypair::generate(&mut OsRng);

let sp = SeedPrefix::new(
SeedCode::RandomSeed256Ed25519,
ed_keypair.secret.as_bytes().to_vec(),
);

let (derived_pub_key, derived_priv_key) = sp.derive_key_pair().unwrap();
assert_eq!(derived_pub_key.key(), ed_keypair.public.to_bytes());
assert_eq!(derived_priv_key.key(), ed_keypair.secret.to_bytes());
}

0 comments on commit 3e10176

Please sign in to comment.