summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/src/client.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/src/client.rs b/lib/src/client.rs
index d985769..918fa90 100644
--- a/lib/src/client.rs
+++ b/lib/src/client.rs
@@ -42,10 +42,14 @@ impl Client {
}
pub async fn post_text_blob(&self, text: String) -> Result<Cid> {
- self.ipfs
- .put_dag(text.into())
+ use futures::stream::StreamExt;
+
+ crate::add::add(self.ipfs.clone(), std::io::Cursor::new(text))
+ .collect::<Vec<Result<cid::Cid>>>()
.await
- .map_err(anyhow::Error::from)
+ .into_iter()
+ .collect::<Result<Vec<_>>>()
+ .map(|mut v| v.pop().unwrap())
}
/// Post a text node