32 Commits

Author SHA1 Message Date
Toralf Wittner
66db7f89b7 Externalise unsigned-varint crate. (#329) 2018-08-10 16:35:41 +02:00
Pierre Krieger
078fa1cb33
Rework the multihash crate (#403)
* Use Multihash and MultihashRef instead

* Don't use star imports

* Split EncodeError and DecodeError

* Add DecodeOwnedError

* Some cleanup

* Remove Hash::name()

* Some crate root documentation

* Add some more methods

* Fix tests

* Add PartialEq between Multihash and MultihashRef

* Fix the rest of the repo

* Rename hash_data() to digest()

* Add comment about varint

* Remove Error::description impls
2018-08-09 14:51:09 +02:00
Pierre Krieger
ffe63ff987 Unify the versions of parking_lot (#380) 2018-07-30 16:06:03 +02:00
Pierre Krieger
9480295bf2
Add licenses to all Cargo.toml files (#349) 2018-07-21 12:15:42 +02:00
Toralf Wittner
9d28fa0b78 Skip over buckets older than ping_timeout. (#340)
Addresses issue #321.
2018-07-21 11:15:29 +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
7c71ffddb2
Remove exposed unimplemented!() in the Kad server (#298) 2018-07-14 13:58:16 +02:00
Pierre Krieger
4592d1b21e
SwarmController::dial now returns a Future (#290)
* SwarmController::dial now returns a Future

* Minor comment
2018-07-14 13:46:11 +02:00
Qian LinFeng
fd01b18e53 Upgrade and unify protobuf version(1.x => 2.0.2) (#283)
* Update and unify protobuf version(1.x => 2.0.2)

* Update protobuf codegen shell script
2018-07-10 14:07:28 +02:00
Pierre Krieger
143a1845b1
The PeerId is the hash of the protobuf encoding (#276) 2018-06-25 17:56:36 +02:00
Toralf Wittner
16967abda7
Use tokio-codec. (#271) 2018-06-22 16:12:23 +02:00
Pierre Krieger
02bf7604d0
Fix protobuf again (#269) 2018-06-21 16:53:23 +02:00
Pierre Krieger
30ffa2f256
Revert to old protobuf generation system (#268)
* Revert "Remove old protoc scripts and artifacts (#262)"

This reverts commit 32ef50b8222fa30e3706c90c24e84e821f3fd84f.

* Revert "Use pure-rust protoc (#255)"

This reverts commit 217fae405f6565d10e010e9e8b5dfd19045120d0.
2018-06-21 15:47:13 +02:00
Pierre Krieger
2d4fe77275
Fix kademlia server end (#254) 2018-06-21 14:13:25 +02:00
Jef
217fae405f Use pure-rust protoc (#255) 2018-06-20 13:40:01 +02:00
Pierre Krieger
7b375798a5
The Multiaddr of the remote is now a Future (#249)
* The Multiaddr of the remote is now a Future

* The multiaddress future in swarm is now a Box
2018-06-19 14:38:55 +02:00
Pierre Krieger
f74cf9f126
Don't unwrap in Kademlia protocol (#252)
* Don't unwrap in Kademlia protocol

* Debug assert that the alloc is correct

* Ignore non-peer CIDs

* Fix concerns
2018-06-14 16:34:07 +02:00
Pierre Krieger
6897eca91f
Lots of improvements to kademlia code (#243)
* No longer panic when updating self peer ID in kbuckets

* Minor code improvement in flush()

* Small improvement to handle_find_node_req

* expected_pongs no longer mut

* Clean up KadServerInterface trait

* find_node() returns an impl Future

* Rework kad_server's API to remove the interface

* Remove the error mapping in kad_bistream.split()

* Use a name type in protocol.rs

* respond() now takes an iter of Peers + add tests

* Use concrete Future type in kad_server upgrade

* Let the high level code decide the TTL of the addrs

* Replace QueryInterface::send with find_node_rpc

* Replace KademliaProcessingFuture with KademliaPeerReqStream

* requested_peers() now returns an iter

* gen_random_id() only requires &PeerId

* Remove QueryInterface and return stream of events

* Remove add_peer_addrs from query

* Remove the peer_store and record_store params

* Tweak multiaddresses reportin

* Remove dependency on peerstore

* Fix tests
2018-06-07 17:15:19 +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
57c3103f78
Integrate the multiformats crates (#231)
* Remove the multihash patch

* Integrate the multiformats crates

* Fix not compiling on emscripten
2018-06-01 10:10:00 +02:00
Pierre Krieger
6b95414161
Update kademlia for the removing of From (#220)
* Update kademlia for the removing From

* Fix the kad example

* Some documentation
2018-05-29 17:32:40 +02:00
Pierre Krieger
e5f23c74c0
Remove dial_custom_handler (#203)
* Remove dial_custom_handler

* Rename dial_to_handler to dial
2018-05-22 18:58:27 +02:00
Toralf Wittner
5f6e215ec1
Update to protobuf >= 2 (#199) 2018-05-21 17:32:59 +02:00
Toralf Wittner
d394ea0e19
Add /libp2p/circuit/relay/0.1.0 protocol support. (#175)
Add `/libp2p/circuit/relay/0.1.0` protocol support.
2018-05-18 13:13:05 +02:00
Toralf Wittner
86a21fc43e
Remove all targets from log statements. (#195)
The default uses crate + module path anyway, so `target` has been
redundant, causes more work when renaming crates and makes log
lines longer.
2018-05-17 15:14:13 +02:00
Pierre Krieger
5c1890e66a
Rename libp2p_swarm to libp2p_core (#189) 2018-05-16 12:59:36 +02:00
Pierre Krieger
f787f3d8b8
Swarm rework (#182)
* Rename Transport::RawConn to Output

* Remove AsyncRead + AsyncWrite bound on Transport::Output

* UpgradedNode now always implements Transport

* Add and tweak modifiers for Transport and ConnectionUpgrade

* Secio upgrade now returns the pubkey in its output

* Add upgrade::apply

* Add Transport::and_then

* Rework the swarm

* Rustfmt

* Fix concerns
2018-05-14 15:55:16 +02:00
Pierre Krieger
11f655dd6a
Pin protobuf to 1.4 (#184) 2018-05-14 11:04:05 +02:00
Pierre Krieger
2445d9e9ee
Various fixes and improvements (#166) 2018-04-11 17:32:32 +02:00
Qifan Lu
342a9f69d3 Bump multiaddr to 0.3 and remove patch in Cargo.toml (#164) 2018-04-10 18:08:01 +02:00
Jef
5c4aefe457 Remove libp2p- prefix (#152)
* Remove `libp2p-` prefix

* More sed-fu
2018-03-20 14:44:46 +01:00