aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-01-22 01:12:07 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-01-22 01:12:09 -0800
commite547fa64ce684211f8eb76738f133adfad296eaa (patch)
tree93a116b8e91ebb7b9f4555869614c66df2e7b6ff /src/bin
parent375836cf6322bc31828c5e2be47e5f0aa5f99099 (diff)
downloadgeniza-e547fa64ce684211f8eb76738f133adfad296eaa.tar.gz
geniza-e547fa64ce684211f8eb76738f133adfad296eaa.zip
WIP refactoring DatPeer
- use Key in some more spots (instead of [u8]) - threaded Peer implementation, with chan for communication
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/geniza-net.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/geniza-net.rs b/src/bin/geniza-net.rs
index 4b3fa30..b3a55ba 100644
--- a/src/bin/geniza-net.rs
+++ b/src/bin/geniza-net.rs
@@ -6,11 +6,13 @@ extern crate env_logger;
#[macro_use]
extern crate error_chain;
extern crate geniza;
+extern crate sodiumoxide;
// TODO: more careful import
use geniza::*;
use std::path::Path;
use clap::{App, SubCommand, Arg};
+use sodiumoxide::crypto::stream::Key;
fn run() -> Result<()> {
env_logger::init().unwrap();
@@ -59,7 +61,8 @@ fn run() -> Result<()> {
let host_port = subm.value_of("host_port").unwrap();
let dat_key = subm.value_of("dat_key").unwrap();
let key_bytes = parse_dat_address(&dat_key)?;
- DatConnection::connect(host_port, &key_bytes, false)?;
+ let key = Key::from_slice(&key_bytes).unwrap();
+ DatConnection::connect(host_port, &key, false)?;
println!("Done!");
}
("discovery-key", Some(subm)) => {