|
@@ -1,11 +1,26 @@
|
|
|
+// This seems like probably not the best way to do this, but it works.
|
|
|
+#[path = "../client_net.rs"]
|
|
|
+mod client_net;
|
|
|
+use crate::client_net::send;
|
|
|
+
|
|
|
use ed25519_dalek::PublicKey;
|
|
|
use lox::IssuerPubKey;
|
|
|
+use std::env::args;
|
|
|
use std::fs::File;
|
|
|
|
|
|
-fn main() {
|
|
|
+#[tokio::main]
|
|
|
+async fn main() {
|
|
|
let bridgedb_pubkey_filename = "bridgedb_pubkey.json";
|
|
|
let lox_auth_pubkeys_filename = "lox_auth_pubkeys.json";
|
|
|
|
|
|
+ // TODO: make argument passing nicer (maybe flags, config files, etc.)
|
|
|
+
|
|
|
+ // network address to connect to, e.g., localhost:8080
|
|
|
+ let addr = args().nth(1).unwrap();
|
|
|
+
|
|
|
+ // message to send
|
|
|
+ let msg = args().nth(2).unwrap();
|
|
|
+
|
|
|
// import bridgedb pubkey
|
|
|
let bridgedb_pubkey_infile = File::open(bridgedb_pubkey_filename).unwrap();
|
|
|
let bridgedb_pubkey: PublicKey = serde_json::from_reader(bridgedb_pubkey_infile).unwrap();
|
|
@@ -19,4 +34,8 @@ fn main() {
|
|
|
let migrationkey_pub = &lox_auth_pubkeys[2];
|
|
|
let reachability_pub = &lox_auth_pubkeys[3];
|
|
|
let invitation_pub = &lox_auth_pubkeys[4];
|
|
|
+
|
|
|
+ let s = send(addr, msg).await;
|
|
|
+
|
|
|
+ println!("{}", s);
|
|
|
}
|