[identify] Implement /ipfs/id/push/1.0.0 alongside some refactoring. (#1999)

* Implement /ipfs/id/push/1.0.0 alongside some refactoring.

  * Implement /ipfs/id/push/1.0.0, i.e. the ability to actively
    push information of the local peer to specific remotes.
  * Make the initial delay as well as the recurring delay
    for the periodic identification requests configurable,
    introducing `IdentifyConfig`.

* Fix test.

* Fix example.

* Update protocols/identify/src/identify.rs

Co-authored-by: Max Inden <mail@max-inden.de>

* Update protocols/identify/src/identify.rs

Co-authored-by: Max Inden <mail@max-inden.de>

* Update versions and changelogs.

Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
Roman Borschel
2021-03-18 12:47:01 +01:00
committed by GitHub
parent 24b3e09b39
commit 5a45f93fc2
10 changed files with 513 additions and 200 deletions

View File

@ -38,7 +38,7 @@ use libp2p::{
either::EitherTransport, muxing::StreamMuxerBox, transport, transport::upgrade::Version,
},
gossipsub::{self, Gossipsub, GossipsubConfigBuilder, GossipsubEvent, MessageAuthenticity},
identify::{Identify, IdentifyEvent},
identify::{Identify, IdentifyConfig, IdentifyEvent},
identity,
multiaddr::Protocol,
noise,
@ -245,11 +245,10 @@ fn main() -> Result<(), Box<dyn Error>> {
gossipsub_config,
)
.expect("Valid configuration"),
identify: Identify::new(
identify: Identify::new(IdentifyConfig::new(
"/ipfs/0.1.0".into(),
"rust-ipfs-example".into(),
local_key.public(),
),
)),
ping: Ping::new(PingConfig::new()),
};