36 Commits

Author SHA1 Message Date
Pierre Krieger
b1f2ddd4b5
Floodsub now produces FloodsubEvent (#823) 2019-01-07 13:42:47 +01:00
Pierre Krieger
7da1a860be
Automatically close useless connections (#816)
* Automatically close useless connections

* Add a timeout before dropping the connection

* Rework the timeout

* Use OR to combine the outcome
2019-01-04 12:02:39 +01:00
Pierre Krieger
2c2fc8bfd3
Don't allow handlers::poll() to return None (#811) 2019-01-02 14:22:23 +01:00
Pierre Krieger
7798e23e78
Add an error associated type to ProtocolsHandler (#795) 2018-12-28 15:11:35 +01:00
Pierre Krieger
d10cafa804
Make deriving the NetworkBehaviour more ergonomic (#782) 2018-12-20 15:21:13 +01:00
Pierre Krieger
83320e0347
More precise error passed to inject_dial_upgrade_error (#771)
* More precise error passed to inject_dial_upgrade_error

* Fix concerns

* Fix panic proof
2018-12-18 11:23:13 +01:00
Toralf Wittner
a152e18821
Simplify handling of upgrade information. (#761) 2018-12-11 15:13:10 +01:00
Pierre Krieger
2dce4294a0
Add version numbers in the deps in Cargo.toml (#768) 2018-12-11 14:54:44 +01:00
James Ray
2fc2a8c918 Add a crate doc comment for floodsub (#748) 2018-12-07 10:39:21 +01:00
Pierre Krieger
2ef4d779ca
Add metadata to all the Cargo.toml (#743) 2018-12-06 19:22:06 +01:00
Pierre Krieger
9102266d70
Rename all the network behaviours to more basic names (#726)
* Rename FloodsubBehaviour to Floodsub

* Rename Ping behaviours

* Rename identify
2018-12-05 17:04:25 +01:00
James Ray
1c247a5914 substream -> substreams (#720) 2018-12-04 10:32:51 +01:00
Pierre Krieger
c5d08ab48c
Enhance the swarm a bit (#711)
* Replace the &mut TTopology with a &mut PollParameters

* Add supported_protocols

* Add external_addresses

* Report out addresses in Kademlia

* Fix the custom derive

* Some comments

* Fix compilation on stable
2018-12-01 13:34:57 +01:00
James Ray
fceaf2293b Chore/grammar (#701)
* Add a space.

* qed -> QED and ' ; qed' -> '; QED'

* ' ; QED' -> '; QED'
2018-11-29 16:38:52 +01:00
Pierre Krieger
3aa1fcbdc6
Add a KademliaHandler (#580)
* Rework Kademlia for the new design

* Minor work on protocol.rs

* More work

* Remove QueryTarget::FindValue

* Finish work on query

* Query timeout test

* Work on topology

* More work

* Update protocols/kad/src/topology.rs

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

* Fix trailing whitespaces

* Use if let
2018-11-29 12:11:35 +01:00
Pierre Krieger
45114aef46
Move the Swarm in its own module (#681) 2018-11-27 11:22:55 +01:00
Pierre Krieger
95ebee5841
Update some dependencies (#686)
* Update many dependencies

* Upgrade some secio deps
2018-11-27 10:35:47 +01:00
Toralf Wittner
938b91742f
Add EitherUpgrade and generalise OrUpgrade. (#662) 2018-11-20 15:09:59 +01:00
Pierre Krieger
37994b34e7
Behavior -> Behaviour (#650) 2018-11-16 12:59:57 +01:00
Pierre Krieger
373b05347a
Remove the Send + 'static requirements for floodsub (#637) 2018-11-15 19:00:57 +01:00
Pierre Krieger
1c9091655b
Move protocols_handler to the root (#643) 2018-11-15 18:39:20 +01:00
Pierre Krieger
ded89b4be3
Use a random sequence number in floodsub (#634)
* Use a random sequence number in floodsub

* Comment
2018-11-15 18:03:09 +01:00
Toralf Wittner
2e549884ef Split ConnectionUpgrade. (#642)
Introduce `InboundUpgrade` and `OutboundUpgrade`.
2018-11-15 17:41:11 +01:00
David
37e2ec38a7 Update connected peers' topics on NodeEvent (#638)
* Update connected peers' topics on NodeEvent

After a peer connects they send us the list of the topics they're subscribed to. This causes a NodeEvent to be emitted. This PR makes sure we update the subscription info we have on the newly connected peer.

* Formatting

* Update protocols/floodsub/src/layer.rs

Co-Authored-By: dvdplm <dvdplm@gmail.com>

* whiespace
2018-11-14 22:03:00 +01:00
Pierre Krieger
24ccefbbc6
Fix the concerns of #603 (#635) 2018-11-14 14:07:54 +01:00
Pierre Krieger
f8ccb0af36
Rewrite floodsub to use the ProtocolsHandler (#603)
* Move lib.rs to protocol.rs

* Rewrite floodsub for ProtocolsHandler

* Add a FloodsubBehaviour

* Fix closing floodsub after a message

* Address concern

* Make it conform to the protocol

* Make it really conformant

* Address concerns
2018-11-13 14:46:57 +01:00
James Ray
45cd7db6e9 Remove spaces before semicolons (#591) 2018-10-29 10:38:32 +01: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
Qian LinFeng
4fa680e282 Upgrade smallvec version to fix license issue (#526) 2018-09-30 16:18:19 +02:00
James Ray
bf066773e3 ybsubscribing -> unsubscribing (#513) 2018-09-24 09:32:20 +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
ea1f172397
Implement Send everywhere (#458) 2018-09-06 09:54:35 +02:00
Guanqun Lu
ee9be6f0c9 add must_use for Future (#450) 2018-09-04 12:30:57 +02:00
Toralf Wittner
cd1d81b5d0
Update unsigned-varint crate to v0.2.0 (#447) 2018-09-03 17:19:03 +02:00
Eugene Chupriyanov
4798952e2f Fix rust-libp2p issue #429 (floodsub fails to decode PeerId) (#430) 2018-08-29 11:37:07 +02:00
Benjamin Kampmann
2ea49718f3
Clean up directory structure (#426)
* Remove unused circular-buffer crate
* Move transports into subdirectory
* Move misc into subdirectory
* Move stores into subdirectory
* Move multiplexers
* Move protocols
* Move libp2p top layer
* Fix Test: skip doctest if secio isn't enabled
2018-08-29 11:24:44 +02:00