24 Commits

Author SHA1 Message Date
Pierre Krieger
d94fe1b831 Use a Multihash in AddrComponent::P2P, drop cid (#407)
* Use a Multihash in AddrComponent::P2P
* Remove the cid crate from the repo
2018-08-10 17:47:02 +02:00
Pierre Krieger
078fa1cb33
Rework the multihash crate (#403)
* Use Multihash and MultihashRef instead

* Don't use star imports

* Split EncodeError and DecodeError

* Add DecodeOwnedError

* Some cleanup

* Remove Hash::name()

* Some crate root documentation

* Add some more methods

* Fix tests

* Add PartialEq between Multihash and MultihashRef

* Fix the rest of the repo

* Rename hash_data() to digest()

* Add comment about varint

* Remove Error::description impls
2018-08-09 14:51:09 +02:00
Pierre Krieger
ea881e3dfa Rework swarm and allow interrupting a dial (#366)
* Rework swarm and allow interrupting a dial
* Improve the UniqueConnec situation
* Remove UniqueConnec::get
* Rename `get_or_dial()` to `dial()` and add `dial_if_empty()`
* Clean the UniqueConnec is the future is dropped
* Rename `set_until` to `tie_or_stop` and add `tie_or_passthrough`
* Add some tests, docs
* Fix memory leak with tasks registration
* Interrupt dialing when a UniqueConnec is dropped or cleared
2018-08-08 12:00:38 +02:00
Pierre Krieger
0348ac3534 Make ping unidirectional (#381) 2018-08-06 17:16:27 +02:00
Benjamin Kampmann
b573daa06d
Strongly type AddrComponent::{P2P, IPFS} with Cids (#357)
* Strongly type CID in AddrComponent::{IPFS, P2P}

* Reexport Cid, ToCid for convenience

* Fix Cid-typed P2P AddrComponents in dependencies
2018-08-06 17:04:49 +02:00
Pierre Krieger
e14a5af8dd Update the P2P multiaddr component to 421 (#383) 2018-08-06 10:07:22 +02:00
Pierre Krieger
294310cd07
Rewrite multiplex (#261)
* Rewrite multiplex

* Increase the packet size limit to 32 MB

* Fix waiting for poll_complete to finish

* Typo

* Properly close substreams

* Add a limit to the number of substreams

* Add a limit to the length of the internal buffer

* Fix concerns
2018-07-17 16:31:32 +02:00
Pierre Krieger
053197bd1c
Rework the Kademlia high-level system (#282)
* Kademlia high-level rework

* Some changes in the rework

* Some additional tweaks to kad rework

* Add update_kbuckets

* Rename a bunch of Kademlia stuff

* Add KadSystem::local_peer_id

* Some documentation update

* Concern

* Make the example compile

* Make things nicer

* Fix bug in UniqueConnec

* Add clear() to UniqueConnec

* Add UniqueConnec::poll

* Fix potential deadlock in UniqueConnec

* Add UniqueConnec::state()

* The future of get now contains a Weak

* Fix concerns
2018-07-17 15:51:11 +02:00
Pierre Krieger
16e3453b7f
Use the new version of tokio (#303) 2018-07-16 12:15:27 +02:00
Pierre Krieger
857c6653ec
Always identify the remote (#277) 2018-07-11 14:35:24 +02:00
Toralf Wittner
d5602e7687 Add support for yamux multiplexing. (#284)
* Add support for yamux multiplexing.

* Address review comments.
2018-07-10 14:59:24 +02:00
Pierre Krieger
18075f4eaa
Give access to secio ephemeral key (#280)
* Give access to secio ephemeral key

* Fix tests
2018-07-04 17:07:38 +02:00
Pierre Krieger
143a1845b1
The PeerId is the hash of the protobuf encoding (#276) 2018-06-25 17:56:36 +02:00
Toralf Wittner
16967abda7
Use tokio-codec. (#271) 2018-06-22 16:12:23 +02:00
Pierre Krieger
7b375798a5
The Multiaddr of the remote is now a Future (#249)
* The Multiaddr of the remote is now a Future

* The multiaddress future in swarm is now a Box
2018-06-19 14:38:55 +02:00
Pierre Krieger
6897eca91f
Lots of improvements to kademlia code (#243)
* No longer panic when updating self peer ID in kbuckets

* Minor code improvement in flush()

* Small improvement to handle_find_node_req

* expected_pongs no longer mut

* Clean up KadServerInterface trait

* find_node() returns an impl Future

* Rework kad_server's API to remove the interface

* Remove the error mapping in kad_bistream.split()

* Use a name type in protocol.rs

* respond() now takes an iter of Peers + add tests

* Use concrete Future type in kad_server upgrade

* Let the high level code decide the TTL of the addrs

* Replace QueryInterface::send with find_node_rpc

* Replace KademliaProcessingFuture with KademliaPeerReqStream

* requested_peers() now returns an iter

* gen_random_id() only requires &PeerId

* Remove QueryInterface and return stream of events

* Remove add_peer_addrs from query

* Remove the peer_store and record_store params

* Tweak multiaddresses reportin

* Remove dependency on peerstore

* Fix tests
2018-06-07 17:15:19 +02:00
Pierre Krieger
dbbee5756e
Use stronger typing for the public key of identify (#236)
* Use stronger typing for the public key of identify

* Add PartialEq/Eq implementations

* Fix tests

* Also change is_public_key()
2018-06-05 12:29:59 +02:00
Pierre Krieger
4c2cabca93
Add support for Ed25519 in secio (#226)
* Add support for Ed25519 in secio

* Add SecioPublicKey::to_peer_id()
2018-05-31 14:50:24 +02:00
Pierre Krieger
6b95414161
Update kademlia for the removing of From (#220)
* Update kademlia for the removing From

* Fix the kad example

* Some documentation
2018-05-29 17:32:40 +02:00
Pierre Krieger
7d6ad230ea
Update the PeerId import paths (#217) 2018-05-24 18:00:47 +02:00
Pierre Krieger
c1cd10c034
upgrade::or() requires same Output (#218) 2018-05-24 16:37:12 +02:00
Toralf Wittner
445ae17904 Move SimpleProtocol from core to libp2p. (#212)
cf. issue #200
2018-05-23 16:27:55 +02:00
Pierre Krieger
e5f23c74c0
Remove dial_custom_handler (#203)
* Remove dial_custom_handler

* Rename dial_to_handler to dial
2018-05-22 18:58:27 +02:00
Pierre Krieger
d51321f5dd
Move the examples to the facade crate (#197) 2018-05-21 18:49:02 +02:00