57 Commits

Author SHA1 Message Date
Pierre Krieger
ea0f61366c
Add a Ping behaviour instead of PeriodicPing and PingListen (#815)
* Add a Ping behaviour instead of PeriodicPing and PingListen

* Fix tests
2019-01-03 20:16:44 +01:00
Pierre Krieger
ad7a3b94ba
Fix compilation with syn 0.15.23 (#813) 2019-01-02 15:16:27 +01:00
Pierre Krieger
bdc071a270
Remove readme = entries in Cargo.toml (#812) 2019-01-02 14:52:29 +01:00
Pierre Krieger
f903e2b744
Add version numbers of multi* deps (#810) 2019-01-02 13:45:23 +01:00
Pierre Krieger
02e704195b
Also add the node's reported address in mDNS (#804)
* Also add the node's reported address in mDNS

* Update misc/mdns/src/behaviour.rs
2019-01-02 13:23:58 +01:00
Pierre Krieger
d10cafa804
Make deriving the NetworkBehaviour more ergonomic (#782) 2018-12-20 15:21:13 +01:00
James Ray
f541df391a Chore/semi colons (#799)
* Add helpers for easier Transports creation (#777)

* Add helpers for easier Transports creation

* Fix doctests

* Fix ' ;' occurrences
2018-12-19 23:22:39 +01:00
Pierre Krieger
40a503fd63
Store information about the local node in the topology (#772)
* Store information about the local node in the topology

* Fix build

* Store the external addresses in the topology
2018-12-13 19:06:13 +01:00
Pierre Krieger
0803e36d5a
Remove PeriodicIdentifyListen and IdentifyListen (#769)
* Remove PeriodicIdentifyListen and IdentifyListen

* Fix tests

* Fix core-derive
2018-12-13 13:53:19 +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
Toralf Wittner
2253c82b86
multistream-select: Update to 2018 edition. (#766) 2018-12-11 10:45:28 +01:00
Pierre Krieger
d06eb67353
Add a mDNS network behaviour (#736)
* Move the MdnsService to a service module

* Add a Mdns behaviour

* Add a Mdns network behaviour

* Add minor documentation

* Add minor todo

* Use nat_traversal on the observed address

* Don't add self to topology

* Automatically connect to nodes we discover

* Add Debug implementations

* Fix example
2018-12-10 16:00:16 +01:00
Pierre Krieger
d94a768bd9
Rename multiaddr and mulithash to parity-* (#737)
* Rename multiaddr and mulithash to parity-*

* Fix doctests
2018-12-07 15:40:02 +01:00
Pierre Krieger
2ef4d779ca
Add metadata to all the Cargo.toml (#743) 2018-12-06 19:22:06 +01:00
Daogang Tang
371905c876 rename PeriodicIdentifyBehaviour to PeriodicIdentify. (#738)
* rename PeriodicIdentifyBehaviour to PeriodicIdentify.

Signed-off-by: Daogang Tang <daogangtang@gmail.com>

* fix renaming PeriodicIdentifyBehaviour to PeriodicIdentify in misc/core-derive/tests/test.rs.

Signed-off-by: Daogang Tang <daogangtang@gmail.com>
2018-12-06 13:30:55 +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
Toralf Wittner
4140047f34 Avoid some warnings. (#733)
- mdns: unused `Result` which must be used
- kad: unused import
- mplex: use of deprecated item
2018-12-05 15:01:17 +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
Toralf Wittner
69eafd9869 multiaddr: change UDP constant from 17 to 273. (#714)
Fixes #692
2018-11-30 21:10:49 +01:00
Pierre Krieger
179e65ff5c
Fix core-derive (#707) 2018-11-29 18:01:16 +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
e12795d1e6
Fix the custom derive (#689)
* Fix the custom derive

* Concern
2018-11-27 16:10:34 +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
f833c5d9ff
rw-stream-sink: Add regression test. (#683)
Closes #679.
2018-11-26 13:36:47 +01:00
Pierre Krieger
1b05132d6a
Add libp2p-mdns (#590)
* Add libp2p-mdns

* Fix win32

* Make compatible with Rust 1.29

* Remove mDNS on esmcripten

* Fix concerns

* More concern

* Use append_u16

* Make decode_character_string return a Cow

* Add TODO

* Don't send queries from 5353

* Fix flags

* More flags fix

* More concerns

* Fix flags

* Fix removed env_logger
2018-11-24 13:55:18 +01:00
Toralf Wittner
aa86f6824d
rw-stream-sink: Skip over empty stream items. (#677)
Otherwise it may report the reading of 0 bytes which is interpreted as
EOF by consumers of `std::io::Read::read`.
2018-11-23 13:54:17 +01:00
Pierre Krieger
1da97242da
Remove the NamesIter: Clone requirement (#663)
* Remove the NamesIter: Clone requirement

* Fix concerns
2018-11-22 18:15:35 +01:00
Pierre Krieger
b213fd7bd7
Add PeerId::random() (#661) 2018-11-20 13:44:36 +01:00
Pierre Krieger
37994b34e7
Behavior -> Behaviour (#650) 2018-11-16 12:59:57 +01:00
Pierre Krieger
1c9091655b
Move protocols_handler to the root (#643) 2018-11-15 18:39:20 +01:00
Toralf Wittner
2e549884ef Split ConnectionUpgrade. (#642)
Introduce `InboundUpgrade` and `OutboundUpgrade`.
2018-11-15 17:41:11 +01:00
Pierre Krieger
623728b35d
Add a custom derive for NetworkBehaviour (#619)
* Add ProtocolsHandlerSelect

* Add a custom derive for NetworkBehaviour

* Remove 2018 edition

* More work

* Update the tests and work

* Allow ignored fields

* More fixes

* Give access to everything in the poll method
2018-11-12 17:12:47 +01:00
Pierre Krieger
6a7c722ffc Add From<IpAddr> for Multiaddr (#623) 2018-11-12 10:44:18 +01:00
Pierre Krieger
fc63947e7b
Add a peer id generator (#583)
* Add a peer id generator

* Improve usage message

* Better help

* Rustfmt
2018-11-02 16:49:28 +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
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
Toralf Wittner
2c98d06942
Change some nat_traversals to consider a prefix. (#550)
Change some `nat_traversal`s to consider a prefix.

Transports should consider only the relevant address prefix.
2018-10-15 16:29:32 +02:00
Toralf Wittner
9bdaabc884
Optimise Multiaddr::append. (#549)
Append to the existing vector instead of allocating a temporary one and
copying bytes over.
2018-10-10 11:07:30 +02:00
Toralf Wittner
fd4ae72f8c
multistream-select: use FramedWrite from tokio-codec. (#539) 2018-10-10 09:16:21 +02:00
Toralf Wittner
276bc9c07a
multiaddr: explain the use of &str for Unix. (#543)
multiaddr: explain the use of `&str` for `Unix`.

Closes #408.
2018-10-08 14:51:24 +02:00
Toralf Wittner
e05422c05f multiaddr: add support for onion protocol. (#542)
* multiaddr: add support for onion protocol.

* Comment `read_onion`.

* Split onion into address and port parts.
2018-10-08 11:13:00 +02:00
Eyal Kalderon
ad0807b3f3 Use unsigned-varints, add BLAKE2 support in multihash (#525)
* Add support for unsigned varints

* Depend on unsigned-varint 0.2 without default features

* Change hash code type from u8 to u64

* Fix hash codes and enum variants for BLAKE2 to fit the standard (see #524)

* Run cargo fmt on crate

* Expand hash_types test to include all variants

* Add support for BLAKE2b-512 and BLAKE2s-256

* Depend on blake2 crate 0.7 with no default features

* Update encode! macro for support for blake2 crate

* Update all tests to include BLAKE2b-512 and BLAKE2s-256

* Reduce hash code size from u64 to u16

* Fix typo in doc comment

* Bump tiny-keccak to version 1.4

* Remove unnecessary default-features = false in Cargo.toml
2018-10-01 09:58:11 +02:00
Qian LinFeng
4fa680e282 Upgrade smallvec version to fix license issue (#526) 2018-09-30 16:18:19 +02:00
Toralf Wittner
b61d9faece
multiaddr: future-proof error type (#506) 2018-09-21 10:39:36 +02:00
Toralf Wittner
3f3d81cc95
Map AsyncWrite::shutdown to Sink::close. (#505) 2018-09-21 10:10:45 +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
0c43c76965
Implement close() from Sink (#492) 2018-09-17 15:01:37 +02:00
Toralf Wittner
b2756c8fa9
Make Multiaddr::iter borrow data (#478)
* Use `unsigned-varint` crate.

* Implement `Display` for `Protocol`.

Gives `ToString` for free.

* Use `Cow` in `AddrComponent`.

* Add `AddrComponent::acquire`.

* Document `AddrComponent::acquire`.
2018-09-14 10:21:14 +02:00