25 Commits

Author SHA1 Message Date
Pierre Krieger
c04d0fe797
Add back the Swarm (#613) 2018-11-07 19:29:07 +01:00
Pierre Krieger
4405518045
Add a PeriodicPingHandler and a PingListenHandler (#574)
* Add ProtocolsHandler trait

* Reexport symbols

* Add a note about shutting down

* Add a PeriodicPingHandler and a PingListenHandler

* Fix core doctest

* Add tolerating not supported

* Fix concerns
2018-11-04 09:47:15 +01:00
James Ray
0f3ef5ee0a eg. -> e.g.; ie. -> i.e. via repren (#592)
* eg. -> e.g.; ie. -> i.e. via repren

* se.g. -> seg.
2018-11-02 16:40:00 +01:00
Pierre Krieger
c730b4b3c9
Add ProtocolsHandler trait (#573)
* Add ProtocolsHandler trait

* Reexport symbols

* Add a note about shutting down

* Add map_protocol

* Add a NodeHandlerWrapperBuilder

* Update core/src/nodes/protocols_handler.rs

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>

* Fix compilation
2018-11-01 11:06:32 +01:00
jamartin9
490ae980c7 #399 remove tokio_current_thread tests (#577)
* remove tokio_current_thread tests

* Review changes:
Removed newline
Moved uds tokio test crate to top to avoid self and keep with convention of other test crates
Removed sleep from uds test and block until all futures are completed.
2018-10-25 11:26:37 +02:00
Pierre Krieger
5d1c54cc10
New core (#568)
* New core

* Fix lifetime requirements

* Remove identify transport

* Address &mut & ref ref mut

* Fix whitespaces
2018-10-17 10:17:40 +01:00
Pierre Krieger
724d0f5d82
Remove the old API (#565)
* Remove the old API

* Fix integration test
2018-10-15 16:17:55 +01:00
David
d81f4e264f Add unit tests for core::nodes::NodeStream (#535)
* Add unit tests for core::nodes::NodeStream

* Move DummyMuxer to core/tests

* Address grumbles

* Impl Debug for SubstreamRef<P>

* Add test for poll()

* Don't need to open a substream

* pretty printer test

* More tests for NodeStream poll()

* Remove contentious test of Debug
2018-10-05 11:55:32 +02:00
Toralf Wittner
84b089cacc
Refactor multiaddr crate. (#498)
Refactor multiaddr crate.

- Remove `AddrComponent`. Instead `Protocol` directly contains its
associated data.

- Various smaller changes around conversions to Multiaddr from other
types, e.g. socket addresses.

- Expand tests to include property tests which test encoding/decoding
identity.
2018-09-20 19:51:00 +02:00
Pierre Krieger
1969bde4fe
Rework the Ping protocol (#497)
* Rework the Ping upgrade

* Fix concerns
2018-09-20 16:55:57 +02:00
Pierre Krieger
063ab178a9
Add an alternative to the swarm (#472)
* Rewrite the swarm

* Small improvement to Debug of ListenersStream

* Fix Swarm::Replaced never being produced

* Fix logic problem when reaching a node in swarm

* Small comment in swarm

* Add closed_multiaddr to Replaced event

* Add address to NodeClosed and NodeError

* Fix concerns

* Remove StreamMuxer::boxed
2018-09-14 13:18:10 +02:00
Pierre Krieger
75ceba7809
The SwarmFuture is now a Stream (#442)
* The SwarmFuture is now a Stream

* Return the produced future in the message

* Remove IncomingConnection event

* Pass error when failing to dial

* Fix loop break mistake

* Fix concern

* Rename SwarmFuture to SwarmEvents

* Increase type length limit

* Remove todo
2018-09-04 14:53:27 +02:00
Pierre Krieger
c77b1f5a0a Better documentation (#391)
* Better documentation

* Minor
2018-08-22 10:46:23 +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
Toralf Wittner
81e8735968 Add memory transport. (#343)
* Add memory transport.

* Change test to be compatible with rust stable.

* Address concerns

* Add some documentation and minor fixes

* Move transport test to memory module
2018-07-25 13:44:27 +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
143a1845b1
The PeerId is the hash of the protobuf encoding (#276) 2018-06-25 17:56:36 +02:00
Pierre Krieger
795961b15e
Fix the public key format in the IdentifyInfo (#264)
* Fix the public key format in the IdentifyInfo

* Move PublicKey type to core

* Oops
2018-06-25 14:54:55 +02:00
Pierre Krieger
28fdf23d67
Add some regression tests in libp2p-core (#237) 2018-06-05 19:01:18 +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
c1cd10c034
upgrade::or() requires same Output (#218) 2018-05-24 16:37:12 +02:00
Pierre Krieger
89087f021d
Move PeerId to libp2p-core (#214) 2018-05-24 00:54:08 +02:00
Pierre Krieger
5c1890e66a
Rename libp2p_swarm to libp2p_core (#189) 2018-05-16 12:59:36 +02:00