46 Commits

Author SHA1 Message Date
Pierre Krieger
68299c40a5
Implement Kademlia peer discovery (#120)
* Impl Clone for SwarmController and remove 'static

* Implement Kademlia

* Implement ConnectionReuse correctly

* Implement ConnectionReuse correctly

* Add some tests and fixes

* Remove useless boolean in active_connections

* Correctly run tests

* Optimize the processing

* Rustfmt on libp2p-kad

* Improve Kademlia example

* Next incoming is now in two steps

* Some work

* Remove log

* Fix dialing a node even if we already have a connection

* Add a proper PeerId to Peerstore

* Turn identify into a transport layer

* Expose the dialed multiaddress

* Add identified nodes to the peerstore

* Allow configuring the TTL of the addresses

* Split identify in two modules

* Some comments and tweaks

* Run rustfmt

* More work

* Add test and bugfix

* Fix everything

* Start transition to new identify system

* More work

* Minor style

* Start implementation of Kademlia server upgrade

* Continue implementing the Kademlia server

* Start reimplementing high-level kademlia code

* Continue reimplementing high-level code

* More work

* More work

* More work

* Fix wrong address reported when dialing

* Make it work

* Remove cluster_level field everywhere

* Fix bug in varint-rs when encoding

* More work

* More work

* More work

* More work

* More work

* Bugfix

* More work

* Implement ping

* Style in kademlia_handler

* More work

* Better error handling in query.rs

* More work

* More work

* More work

* Debug impls

* Some cleanup in swarm

* More work

* Clean up changes in swarm

* Unpublish the kbucket module

* Fix examples and some warnings

* Fix websocket browser code

* Rustfmt on libp2p-kad

* Kad initialization process

* Add logging to the example

* Fix concerns

* Fix style
2018-03-15 15:18:21 +01:00
Pierre Krieger
89f95f7136 Implement first draft of floodsub (#144)
* Implement ConnectionReuse correctly

* Add some tests and fixes

* Remove useless boolean in active_connections

* Correctly run tests

* Optimize the processing

* Next incoming is now in two steps

* Remove log

* Fix dialing a node even if we already have a connection

* Add a proper PeerId to Peerstore

* Turn identify into a transport layer

* Expose the dialed multiaddress

* Add identified nodes to the peerstore

* Allow configuring the TTL of the addresses

* Split identify in two modules

* Some comments and tweaks

* Run rustfmt

* Add test and bugfix

* Fix wrong address reported when dialing

* Switch to futures-mutex of paritytech (#113)

* Remove public key system from peerstore (#118)

* Remove public key system from peerstore

* Add comment about PartialOrd on PeerInfo

* Add a nat_traversal() method to Transport (#110)

* Add a nat_traversal() method to Transport

* Fix compilation

* Implement floodsub

* Work on a floodsub example

* Finish example

* More work

* More work

* More work

* More work

* More work

* Rustfmt

* Some style improvements

* Store the whole Topic instead of just the hash

* Add a bunch of TODOs

* Fix introduced warning

* Fix style

* Fix concerns

* Only store the hash of the values in the received messages

* Fix style

* Improve comments
2018-03-15 11:58:11 +01:00
Jef
5217e29fab
Add rustfmt to travis (#137)
* RFC styling-based `rustfmt.toml`

* Add rustfmt to travis

* Remove rustfmt.toml and actually fix too-long lines instead of ignoring them
2018-03-07 16:20:55 +01:00
Pierre Krieger
22a7159c41
Merge of #116 and #111 (#117)
* Implement ConnectionReuse correctly

* Add some tests and fixes

* Remove useless boolean in active_connections

* Correctly run tests

* Optimize the processing

* Next incoming is now in two steps

* Remove log

* Fix dialing a node even if we already have a connection

* Add a proper PeerId to Peerstore

* Turn identify into a transport layer

* Expose the dialed multiaddress

* Add identified nodes to the peerstore

* Allow configuring the TTL of the addresses

* Split identify in two modules

* Some comments and tweaks

* Run rustfmt

* Add test and bugfix

* Fix wrong address reported when dialing

* Fix websocket browser code

* Ignore errors in the swarm

* Fix multiplex test

* Fix some style concerns

* Fix concerns
2018-03-07 11:51:52 +01:00
Pierre Krieger
39dde305b4
Rework libp2p-identify (#116)
* Add a proper PeerId to Peerstore

* Turn identify into a transport layer

* Expose the dialed multiaddress

* Add identified nodes to the peerstore

* Allow configuring the TTL of the addresses

* Split identify in two modules

* Some comments and tweaks

* Run rustfmt

* Add test and bugfix

* Fix wrong address reported when dialing

* Fix websocket browser code

* Support the p2p protocol in libp2p-identify

* Fix concerns

* Fix libp2p-dns

* More concerns
2018-03-07 10:49:11 +01:00
Pierre Krieger
8628a59ecf Add a nat_traversal() method to Transport (#110)
* Add a nat_traversal() method to Transport

* Fix compilation
2018-02-08 13:50:16 +01:00
Pierre Krieger
68c8627597
Correctly report the address of the dialer in identify 2018-01-10 17:35:22 +01:00
Pierre Krieger
acbe1d0386
No longer use deprecated function Multiaddr::new 2018-01-09 19:16:45 +01:00
Pierre Krieger
4603061e92
Merge pull request #88 from tomaka/update-echo-example
Update the echo dialer example
2018-01-09 15:57:41 +01:00
Pierre Krieger
01b474d350
Fix using wrong multistream endpoint 2018-01-09 11:54:35 +01:00
Pierre Krieger
6b7fc9508e
Update the echo dialer example 2018-01-04 17:18:49 +01:00
Pierre Krieger
13ba95e282
Separate between listener, dial_to_handler and dial_custom_handler 2018-01-03 15:50:55 +01:00
Pierre Krieger
641f8a09d7
Implement swarm 2018-01-03 15:06:24 +01:00
Pierre Krieger
2339bfd4d3
Fix the documentation libp2p-swarm 2018-01-03 14:24:25 +01:00
Pierre Krieger
47a3a24fcd
Change the MuxedTransport trait 2018-01-03 10:30:39 +01:00
Pierre Krieger
3438640907
Change API to allow multiple simultaneous clients 2018-01-03 10:30:26 +01:00
Pierre Krieger
c9f55ceb97 Allow customizing the address in the examples, plus minor improvements 2017-12-18 15:57:51 +01:00
Pierre Krieger
e0aca7e3e3 Remove or_upgrade and let users build OrUpgrade manually 2017-12-18 15:27:06 +01:00
Pierre Krieger
952e3926c8 Fix concerns 2017-12-18 12:40:16 +01:00
Pierre Krieger
1da2c5015c Properly handle protocol negotiation errors 2017-12-18 12:10:37 +01:00
Vurich
19f0c8f3ef Fix multiplex waking and make it so that inbound streams can be handled concurrently with negotiating the outbound stream 2017-12-14 17:37:32 +01:00
Pierre Krieger
5ddda08170 [WIP] Integrate multiplex in the examples 2017-12-12 12:51:49 +01:00
Pierre Krieger
e7cfc5ab44 Add MuxedTransport trait 2017-12-12 12:51:49 +01:00
Pierre Krieger
3937649300 Distinguish between initiator and receiver 2017-12-11 16:17:05 +01:00
tomaka
857e9fb449
Merge pull request #53 from tomaka/with-simple-protocol-upgrade
Add a with_simple_protocol_upgrade alternative to with_upgrade
2017-12-07 17:04:17 +01:00
Pierre Krieger
809ff7eecf Fix error handling in Swarm dial() and listen_on() 2017-12-07 16:22:13 +01:00
Pierre Krieger
5b61e64c09 Fix protocol name 2017-12-07 16:20:13 +01:00
Pierre Krieger
4f981e922d Fix concerns 2017-12-07 15:36:03 +01:00
tomaka
9886ba579a
Merge pull request #65 from tomaka/impl-stream-muxer
Make it possible to use or_upgrade with stream muxers
2017-12-07 15:01:03 +01:00
Fredrik Harrysson
c9e6a4d10b
Merge pull request #62 from tomaka/swarm-docs-pass2
More documentation for libp2p-swarm
2017-12-07 12:46:59 +01:00
Pierre Krieger
4881c4a6a1 Add a with_simple_protocol_upgrade alternative to with_upgrade 2017-12-07 12:45:02 +01:00
tomaka
cd4075559e
Merge pull request #58 from tomaka/tokio-core-dep
Remove the tokio-core dependency where not necessary
2017-12-07 11:54:18 +01:00
Pierre Krieger
7aacb081d2 More documentation for libp2p-swarm 2017-12-06 16:11:19 +01:00
Pierre Krieger
af84efcfb7 Make it possible to use or_upgrade with stream muxers 2017-12-06 15:54:18 +01:00
Pierre Krieger
c6e917073b Fix doctest in libp2p-swarm 2017-12-06 15:26:46 +01:00
Robert Habermeier
81cfc3273b
Merge pull request #59 from tomaka/plain-text-rename
Rename PlainText to PlainTextConfig
2017-12-06 12:15:23 +01:00
Pierre Krieger
900bf67623 Remove the tokio-core dependency where not necessary 2017-12-06 12:03:01 +01:00
Pierre Krieger
3edbff0172 Fix doctests of libp2p-swarm 2017-12-05 10:17:24 +01:00
Pierre Krieger
c4c930ad6d Add documentation and README to libp2p-swarm 2017-12-04 18:49:47 +01:00
Pierre Krieger
39352b9d10 Rename PlainText to PlainTextConfig 2017-12-04 16:36:58 +01:00
Pierre Krieger
cd54434fc8 Fix concerns 2017-12-04 12:40:01 +01:00
Pierre Krieger
3396b51214 Run rustfmt on the code and use tabs 2017-12-04 11:44:55 +01:00
Pierre Krieger
91d86eb470 Merge remote-tracking branch 'upstream/master' into muxer-trait 2017-12-04 11:38:38 +01:00
Pierre Krieger
b311d66b58 Add muxing trait and architecture 2017-11-30 16:00:49 +01:00
Pierre Krieger
fd7b86ddcb listen_on now returns a new Multiaddr on success 2017-11-24 16:10:34 +01:00
tomaka
100f368c9d Implement swarm 2017-11-20 17:03:50 +01:00