* Consolidate keypairs in core.
Introduce the concept of a node's identity keypair in libp2p-core,
instead of only the public key:
* New module: libp2p_core::identity with submodules for the currently
supported key types. An identity::Keypair and identity::PublicKey
support the creation and verification of signatures. The public key
supports encoding/decoding according to the libp2p specs.
* The secio protocol is simplified as a result of moving code to libp2p-core.
* The noise protocol is slightly simplified by consolidating ed25519
keypairs in libp2p-core and using x25519-dalek for DH. Furthermore,
Ed25519 to X25519 keypair conversion is now complete and tested.
Generalise over the DH keys in the noise protocol.
Generalise over the DH keys and thus DH parameter in handshake patterns
of the Noise protocol, such that it is easy to support other DH schemes
in the future, e.g. X448.
* Address new review comments.
* Add Ord implementation for KeepAlive
* Fix import path
* Implement PartialOrd for KeepAlive
* remove Ord implementation
* Reimplement Ord for KeepAlive
* Add equality cases to KeepAlive Ord implementation
* Fix the dialing priority system
* Bump libp2p-core to 0.3.1
* Cancel dialing attempt if we don't have priority
* Add test for simultaneous dialing
* Improve test
* Fix test stuck forever
Initially I had hoped that the deprecated `#![allow(clippy)]` would no
longer be put into the generated rust files, but -- as of 2019-01-30 --
it still is (see [1] for details). Since we explicitly update the
protobuf files I decided to *manually edit the generated code* and
replace this with `#![allow(clippy:all)]`. Hopefully, by the time we do
the next upgrade, no such manual tweaking would be necessary anymore. I
think the benefit of a less polluted clippy output is worth it this
time.
[1]: https://github.com/stepancheg/rust-protobuf/pull/332
* Embed the topology in the NetworkBehaviour
* Put topologies inside of Floodsub and Kad
* Fix core tests
* Fix chat example
* More work
* Some cleanup
* Restore external addresses system
* add max_listeners to swarm
* add swarm builder
* swarm_builder's build takes ownership of self
* replace max listeners with incoming limit
* don't disconnect from node after incoming limit has been reached
* update code according to recent changes
* don't poll listeners at all if incoming connection limit is reached
* Add an Error associated type to transports
* Improve raw swarm a bit
* Rename map_other to map
* Use source() instead of cause()
* RawSwarmIncErr -> IncomingError