Create bridgedb crate to instantiate bridgedb

This commit is contained in:
Vecna 2022-10-26 21:38:39 -04:00
parent 11d7959016
commit e40a383dc9
3 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,5 @@
[package]
name = "lox_test"
name = "bridgedb"
version = "0.1.0"
edition = "2021"

15
bridgedb/src/main.rs Normal file
View File

@ -0,0 +1,15 @@
use lox::BridgeDb;
use std::fs::File;
use std::io::Write;
fn main() {
// create new bridgedb (implicitly generates keys)
let bridgedb = BridgeDb::new();
// output public key to new file
let pubkey_bytes = bridgedb.pubkey.to_bytes();
let mut outfile =
File::create("../pubkeys/bridgedb_pubkey").expect("Failed to create pubkey file");
outfile.write_all(&pubkey_bytes)
.expect("Failed to write pubkey");
}

View File

@ -1,3 +0,0 @@
fn main() {
println!("Hello, world!");
}