Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions rust/hermes-ipfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ where N: NetworkBehaviour<ToSwarm = Infallible> + Send + Sync
Self(IpfsBuilder::new())
}

/// Create a new `IpfsBuilder` with an existing keypair.
///
/// ## Parameters
/// - `keypair`: An existing keypair (can be `libp2p::identity::Keypair` or compatible
/// type)
///
/// ## Errors
/// Returns an error if the keypair is invalid.
pub fn with_keypair(keypair: impl connexa::builder::IntoKeypair) -> std::io::Result<Self> {
Ok(Self(IpfsBuilder::with_keypair(keypair)?))
}

#[must_use]
/// Set the default configuration for the IPFS node.
pub fn with_default(self) -> Self {
Expand Down