Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kitounliu committed May 1, 2024
1 parent d31d6f0 commit 7f5ded6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
12 changes: 0 additions & 12 deletions bin/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ fn main() -> Result<()> {
let mpk_bytes: Point = mpk.into();
let mpk_serialised = serde_json::to_string(&mpk_bytes)?;
info!("member public key is {}", mpk_serialised);
// TODO: network transmission for public key
}
Commands::Dkg(dkg) => {
match dkg.command {
Expand All @@ -422,15 +421,6 @@ fn main() -> Result<()> {
let mpks: Vec<GkG1> = mpks_bytes.into_iter().map(|pk| pk.into()).collect();

let dkg = DkgMemberParams::new(dkg_config, mpks, &mut rng)?;
{
// save dkg secrets for member i
let path = &format!("{DKG_SECRETS_DIR}/secret_{index}.json");
let dkg_bytes: DkgMemberParamsSerde = (&dkg).into();
let serialized = serde_json::to_string(&dkg_bytes)?;
write(path, serialized.as_bytes())?;
info!("dkg secrets for member {index} generated and saved in {path}");
}

let circuit = dkg.circuit(&mut rng);
let instance = dkg.instance();

Expand Down Expand Up @@ -460,7 +450,6 @@ fn main() -> Result<()> {
end_timer!(start);
info!("size of proof {:?}", proof.len());

// todo: network transmission for (proof, instance[0])
save_proof(&proof, &instance[0], index)?;
}
DkgCommands::Verify { index } => {
Expand Down Expand Up @@ -678,7 +667,6 @@ fn main() -> Result<()> {
"final pseudorandom on input \"{}\" generated and saved at {}",
input, path
);
// todo: network transmission for pseudo random
}
RandCommands::VerifyFinal { input } => {
let path = &format!("{RANDOM_DIR}/pseudo.json");
Expand Down
1 change: 1 addition & 0 deletions scripts/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ async function main() {

// derive global public parameters
const cmd = `RUST_LOG=info ./target/release/client dkg derive`
console.log("running command <", cmd, ">...")
let result = await execPromise(cmd)
console.log(result[`stderr`])

Expand Down
4 changes: 2 additions & 2 deletions scripts/random.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ async function main() {
const receipt = await netprovider.getTransactionReceipt(res.hash);
// Check if the transaction was successful
if (receipt.status === 1) {
console.log(`Transaction submitPartialEval(..) from member ${memberAddress} successful!`);
console.log(`Transaction submitPartialEval(..) from member ${memberAddress} successful!\n`);
} else {
console.log(`Transaction submitPartialEval(..) from member ${memberAddress} failed!`);
console.log(`Transaction submitPartialEval(..) from member ${memberAddress} failed!\n`);
}
}

Expand Down
1 change: 1 addition & 0 deletions scripts/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async function main() {
const file = `member_${index}`
const command = `RUST_LOG=info ./target/release/client keygen -f ${file}`

console.log("running command <", command, ">...")
const result = await execPromise(command);
console.log(result[`stderr`]);

Expand Down

0 comments on commit 7f5ded6

Please sign in to comment.