Skip to content

Commit

Permalink
doc(delegations-cli): add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
namn-grg committed Oct 15, 2024
1 parent f052dac commit 03d1c96
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bolt-delegations-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ fn main() -> Result<()> {
}

/// Generate a signed delegation using a local BLS private key
///
/// - Read the private key from the file
/// - Create a delegation message
/// - Compute the signing root and sign the message
/// - Return the signed delegation
fn generate_from_local_key(
key_path: &str,
delegatee_pubkey: BlsPublicKey,
Expand All @@ -49,6 +54,12 @@ fn generate_from_local_key(
}

/// Generate a signed delegation using a keystore file
///
/// - Read the keystore file
/// - Decrypt the keypair using the default password (TODO: make this configurable)
/// - Create a delegation message
/// - Compute the signing root and sign the message
/// - Return the signed delegation
fn generate_from_keystore(
key_path: &str,
delegatee_pubkey: BlsPublicKey,
Expand All @@ -74,7 +85,7 @@ fn generate_from_keystore(
})
}

/// Write the signed delegation to an output file
/// Write the signed delegation to an output json file
fn write_delegation_to_file(out: &str, signed_delegation: &SignedDelegation) -> Result<()> {
let out_path = PathBuf::from(out);
let out_file = fs::File::create(out_path)?;
Expand Down

0 comments on commit 03d1c96

Please sign in to comment.