summaryrefslogtreecommitdiffstats
path: root/lib/src/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/client.rs')
-rw-r--r--lib/src/client.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/src/client.rs b/lib/src/client.rs
index a6a51d4..d985769 100644
--- a/lib/src/client.rs
+++ b/lib/src/client.rs
@@ -29,6 +29,14 @@ impl Client {
Ok(())
}
+ pub async fn own_id(&self) -> Result<ipfs::PeerId> {
+ self.ipfs
+ .identity()
+ .await
+ .map(|id| id.0.into_peer_id())
+ .map_err(anyhow::Error::from)
+ }
+
pub async fn connect(&self, peer: ipfs::MultiaddrWithPeerId) -> Result<()> {
self.ipfs.connect(peer).await
}