Commit Graph

2601 Commits

Author SHA1 Message Date
d346a6f495 Refactor transport into multiple modules. (#170)
Addresses #158.

Besides the refactoring, the type `EitherIncomingStream` has been
removed as it is not used.
2018-05-02 11:50:48 +02:00
3f2b6a5238 Add libp2p-ratelimit. (#161)
* Add libp2p-ratelimit.

* Run `cargo fmt`.

* Trigger another CI run.

* Add `target` to log statements.
2018-04-18 14:11:48 +02:00
590bc91d59 resolve PeerInfo deserialize error (#168) 2018-04-18 10:39:42 +02:00
96747441fc replace Vec with FuturesUnordered (#163)
* replace Vec with FuturesUnordered

* add err log
2018-04-16 11:55:16 +02:00
2445d9e9ee Various fixes and improvements (#166) 2018-04-11 17:32:32 +02:00
342a9f69d3 Bump multiaddr to 0.3 and remove patch in Cargo.toml (#164) 2018-04-10 18:08:01 +02:00
3954f3a2ca Update .editorconfig to align with rustfmt. (#162)
The current settings differ from rustfmt which is used during CI runs to
check the source code format. In particular, rustfmt will replace tabs
with spaces, therefore this commit attempts to use the same settings
already for editing.
2018-04-09 10:52:25 +02:00
4c1ab7f528 remove swarm controller from floodsub controller (#160) 2018-04-03 10:59:58 +02:00
Jef
29ca851f70 We don't need to immediately block if the cache is still filling (#155) 2018-03-21 17:08:43 +01:00
Jef
c487b489ce Add buffering to Substream using circular-buffer (#154)
* Add buffering to `Substream` using `circular-buffer`

* Fix freeze and add tests

* Fix tests

* fmt
2018-03-21 15:41:24 +01:00
Jef
5c4aefe457 Remove libp2p- prefix (#152)
* Remove `libp2p-` prefix

* More sed-fu
2018-03-20 14:44:46 +01:00
Jef
1e86c6ed35 Switch to bs (#150)
* Switch to `bs`

* fmt
2018-03-17 15:32:12 +01:00
d6f1b9bf5b Add logging to libp2p-swarm (#149)
* Add logging to libp2p-swarm

* Fix style
2018-03-16 16:39:02 +01:00
a3b1d785e4 floodsub example typo (#148) 2018-03-16 12:07:55 +01:00
18e1727842 Fix panics while logging (#140)
* Fix panic and logging

* Fix style
2018-03-15 18:03:39 +01:00
064706be39 Add logging to the examples (#138) 2018-03-15 16:56:55 +01:00
f81cc08027 Add logging to tcp-transport (#141) 2018-03-15 16:08:49 +01:00
fd9349d15a Add logging to libp2p-websocket (#142) 2018-03-15 15:45:11 +01:00
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
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
2ffcf9eea3 Make rustfmt output human-readable (#139) 2018-03-07 20:03:22 +01:00
32380a07fe Use upstream rust-multiaddr (#135) 2018-03-07 18:03:51 +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
e8d29af359 Identify log (#129)
* 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

* Add logging for identify

* Fix concern
2018-03-07 14:24:00 +01:00
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
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
3b859b6833 Implement libp2p-dns (#132)
* Implement libp2p-dns

* Some docs

* Add test

* Rustfmt on dns

* More work

* Rustfmt on libp2p-dns

* Fix concerns
2018-02-27 17:34:52 +01:00
9faf3fae29 Add logging for libp2p-ping (#128)
* Add logging for libp2p-ping

* Fix concern

* Fix concern again
2018-02-14 18:24:59 +01:00
242702a7a9 Improve and fix nat_traversal for browser websockets (#130)
* Improve and fix nat_traversal for browser websockets

* Also check that remainder of addr is empty

* Fix concerns
2018-02-14 14:46:11 +01:00
025bb04dea Add support for the unimplemented protocols in rust-multiaddr (#123)
* Add support for the unimplemented protocols in rust-multiaddr

* Fix concern
2018-02-14 14:10:55 +01:00
6f450eeef3 Add logging to secio (#127) 2018-02-14 13:02:56 +01:00
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
76a08c655d Remove public key system from peerstore (#118)
* Remove public key system from peerstore

* Add comment about PartialOrd on PeerInfo
2018-02-08 12:22:57 +01:00
c89e68bfb6 Add a proper PeerId to Peerstore (#115) 2018-02-08 12:00:25 +01:00
6179778ba9 Switch to futures-mutex of paritytech (#113) 2018-02-07 15:59:35 +01:00
3c9991cdc9 Test the emscripten code on circle-ci (#119)
* Test the emscripten code on circle-ci

* Fix missing from workflow
2018-01-31 15:10:39 +01:00
641f09d9ae Try run the echo-dialer on circle-ci (#112)
* Try run the echo-dialer on circle-ci

* Fix attempt

* Fix attempt

* Fix attempt

* Fix attempt

* Fix attempt

* Fix attempt

* Fix attempt

* Fix echo dialer example to actually finish

* Fix the echo examples

* Use a proper image for the echo server

* Fix tag of js-echo-server
2018-01-29 14:59:41 +01:00
c378bcb594 Fix warning in circular-buffer (#114) 2018-01-26 12:53:37 +01:00
1071bfd324 Some integration tests for multiplex-rs (#108)
* Some integration tests for multiplex-rs

* Correctly check that the background thread is ok
2018-01-26 11:40:43 +01:00
Jef
cace5bf577 Fix varint::encode allocating for small inputs (#103)
* Fix `encode` allocating for small inputs

* Fix protocol listener expecting `Vec`
2018-01-24 11:14:17 +01:00
71dae91d15 Properly handle EOF in varint-rs (#106) 2018-01-23 19:23:37 +01:00
bd17f2ea96 Setup CircleCI build (#107)
* Add circleci config file

* Try enable IPv6

* Make sure `test` uses machine executor

* Add an integration_test step in parallel

* Explicit docker runs for machine tests

* Try make the integration test work

* Hide Dockerfile in a subfolder

* Fix the ping example hanging

* Explicitely pass the port to the ping client
2018-01-23 19:21:41 +01:00
1413bb8935 Add an example that pings an IPFS node (#89) 2018-01-23 18:17:23 +01:00
39ce006c93 Merge pull request #105 from tomaka/minor-comment-fix
Minor fixes in the comments of peerstore
2018-01-22 15:15:52 +01:00
ab1151f236 Minor fixes in the comments of peerstore 2018-01-18 11:30:41 +01:00
b7a44e40de Merge pull request #94 from tomaka/fix-race-condition-futmut
Fix the deadlock in futures-mutex
2018-01-17 13:22:23 +01:00
0534076d77 Merge pull request #93 from tomaka/varint-codec
Add a VarintCodec type
2018-01-15 15:07:58 +01:00
d6028cd5de Fix bad panic message 2018-01-15 13:26:59 +01:00
ab209edfb3 Add a VarintCodec type 2018-01-15 13:26:58 +01:00
047e33023d Merge pull request #95 from tomaka/identify-correct-report
Correctly report the address of the dialer in the identify protocol
2018-01-15 13:08:32 +01:00