mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-21 22:01:34 +00:00
Ipfs private swarms interop example (#1420)
* Add gossipsub and ping * Implement swarm key parsing from environment * WIP remove stuff * WIP remove more stuff * Use gossipsub instead of floodsub * Make ipfs example work with or without swarm key * Add support for /ipfs/Qm1234 multiaddrs * Add documentation for ipfs example * Rename example to ipfs-private * Fix comments * Move EitherTransport into either.rs And prettify imports of ipfs-private example * Sanitize multiaddr before parsing ...and remove the "ipfs" protocol from multiaddr * Remove TSubstream type parameter ...so that it works with current master * PR feedback use source instead of cause
This commit is contained in:
@ -161,6 +161,21 @@ pub enum KeyParseError {
|
||||
InvalidKeyChar(ParseIntError),
|
||||
}
|
||||
|
||||
impl fmt::Display for KeyParseError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{:?}", self)
|
||||
}
|
||||
}
|
||||
|
||||
impl error::Error for KeyParseError {
|
||||
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
|
||||
match *self {
|
||||
KeyParseError::InvalidKeyChar(ref err) => Some(err),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Private network configuration
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct PnetConfig {
|
||||
|
Reference in New Issue
Block a user