From 63ef549825edb99a7fd7ab15e1acae14286ed8a0 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 23 May 2021 08:46:09 +0200 Subject: Implement listening code Signed-off-by: Matthias Beyer --- Cargo.toml | 1 + src/main.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 27e3357..80cc7d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ chrono = "0.4" cid = "0.6" clap-v3 = "3.0.0-beta.1" daglib = { git = "https://git.sr.ht/~matthiasbeyer/daglib", branch = "master" } +futures = "0.3" ipfs-embed = { version = "0.20", features = ["tokio"] } libipld = "0.11" libipld-cbor = "0.11" diff --git a/src/main.rs b/src/main.rs index fd14adc..3db85d5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,7 @@ use rand_core::CryptoRng; use rand_core::RngCore; use ed25519_dalek::Keypair; use ed25519_dalek::Signature; +use futures::stream::StreamExt; extern crate clap_v3 as clap; @@ -58,9 +59,11 @@ async fn main() -> Result<()> { crate::backend::IpfsEmbedBackend::new_with_config(ipfs_configuration).await? }; - //backend.ipfs() - // .listen_on("/ip4/127.0.0.1/tcp/0".parse()?)? - // .await?; + backend.ipfs() + .listen_on("/ip4/127.0.0.1/tcp/0".parse()?)? + .next() + .await + .unwrap(); match app.get_matches().subcommand() { ("create-profile", Some(mtch)) => { -- cgit v1.2.3