Commit Graph

82 Commits

Author SHA1 Message Date
bafdd8512d Enforce pre-summary newline in docstrings 2019-10-24 20:10:45 +02:00
eef505f2d9 Add automatic docstring formatter and apply 2019-10-24 08:41:10 +02:00
3f24b015ab Implemented Host that includes a routing system. Explicitly separating different Host types as in Go implementation 2019-10-14 00:29:28 +02:00
82dc5d9e31 Ignore typing for asyncio.wait 2019-10-02 15:45:54 +08:00
986a852e7e Remove forced debug level 2019-10-01 11:17:05 +02:00
92deae41dc Change SwarmConn.conn to muxed_conn 2019-09-23 15:46:50 +08:00
8d2415a404 Move calls to Notifee inside Swarm 2019-09-23 15:01:58 +08:00
6f8394e4bd Merge branch 'master' into fix/change-notifee-and-add-tests-for-swarm-conn-and-mplex 2019-09-21 18:34:12 +08:00
e44c2145cc Merge branch 'master' into fix/detection-of-close 2019-09-21 18:05:54 +08:00
a27a817d50 Fix tests 2019-09-20 16:17:13 +08:00
89c127eff4 Merge branch 'master' into fix/refactor-mplex-swarm-host 2019-09-20 15:45:28 +08:00
7fc958e7be Add exception raised to docstring 2019-09-19 22:19:36 +08:00
b9d1875027 Catch OpenConnectionError in swarm.dial_peer 2019-09-19 21:24:01 +08:00
62b0bc4580 Remove useless protocol_ids in logging 2019-09-19 16:31:42 +08:00
b8b5ac5e06 Add test for notifee disconnected 2019-09-19 16:31:41 +08:00
5307c0506b Change IMuxedConn to INetConn in Notifee 2019-09-19 16:31:41 +08:00
0356380996 Add tests for swarm, and debug
Fix `swarm_pair_factory`
2019-09-19 16:31:40 +08:00
6923f257f6 Remove print 2019-09-19 16:07:53 +08:00
2d8e02b7eb Add detection for disconnections in mplex 2019-09-19 15:55:26 +08:00
7cf0495f37 Remove print 2019-09-19 15:38:38 +08:00
6cb033fd1f Refactor multiselect out of Swarm to BasicHost 2019-09-19 13:59:50 +08:00
0bd213bbb7 Refactor mplex and start to add close detection 2019-09-19 13:56:05 +08:00
f253152858 Handle protocol negotiation failure in swarm new_stream 2019-09-17 16:17:41 +08:00
f368f5e93b Apply PR feedback 2019-09-15 15:09:58 +08:00
786a03544c Add some loggings to swarm and cosmetic updates 2019-09-14 21:47:49 +08:00
451f993058 Fix isort 2019-09-11 18:05:41 +08:00
c1ffc0ab07 Fix transport.dial in swarm 2019-09-11 17:13:21 +08:00
4bd32cc4bc Add logs during connection handshake 2019-09-10 19:02:29 -04:00
10415cb956 Use ReadWriteCloser for conns and streams 2019-09-05 23:24:17 +08:00
7385a7a677 Add is_gossipsub fixture in interop test
To use the same code to test against both routers: floodsub and
gossipsub.
2019-09-03 16:49:00 +08:00
fd1f466002 Fix: failed to open stream using existing conn
Fix #233
2019-09-03 14:12:16 +08:00
194b494057 Tested against subscriptions and publish 2019-09-02 23:21:57 +08:00
aa0866698f PR feedback: Add check in Swarm.close_peer 2019-08-31 22:37:59 +08:00
1e59438f25 Update libp2p/network/swarm.py
Co-Authored-By: NIC Lin <twedusuck@gmail.com>
2019-08-31 22:32:32 +08:00
b2c5371323 Add TODO for Swarm.connections 2019-08-29 22:00:07 +08:00
c61a06706a Refactor interop tests and factories
- Add `close` and `disconnect` in `Host`
- Add `close` and `close_peer` in `Network`
- Change `IListener.close` to async, to await for server's closing
- Add factories for security transports, and modify `HostFactory`
2019-08-29 21:38:06 +08:00
d59870ebbf Fix MplexStream error
When receiving a `NewStream`, the message of that packet is the
name of the stream, which should be handled, rather than letting it go
into the message queue.
2019-08-26 20:39:08 +08:00
5b32bfdd3f Add call to wait_closed method of asyncio.StreamWriter 2019-08-24 22:06:24 +02:00
e29c1507bf remove unused fields 2019-08-24 21:50:06 +02:00
16a4fd33c1 PR feedbacks
- Move exceptions to exceptions.py
- Raise `UpgradeFailure` in upgrader
- Refine the try/catch for upgraders in swarm
2019-08-22 22:53:49 +08:00
5768daa9bf PR feedbacks
- Nits
- Add `SecurityUpgradeFailure` and handle `UpgradeFailure` in Swarm.
2019-08-22 22:53:47 +08:00
bb7d37fd4f Fix msg encoding
- Change varint-prefix encode to fixedint-prefix(4 bytes) encode.
2019-08-22 22:53:46 +08:00
22b1a5395d A working plaintext 2.0 without validation 2019-08-22 22:53:46 +08:00
7bc363f2fa Remove initiator in Mplex
Besides, fix the wrong passed `multi_addr` to `mplex_stream`.
2019-08-22 22:53:45 +08:00
4358a4bc89 Negotiate multiselect version for Muxer
`MuxerMultistream` is introduced to negotiate `Multiselect` version
before negotiating Multiplexer's version. This is required by
multistream 1.x
2019-08-21 11:43:24 +08:00
86d4ce1da8 Add delim_encode and delim_read
- Add `StreamCommunicator` and `RawConnectionCommunicator`, read/write
messages with delim codec, with `IMuxedStream` and `IRawConnection`
respectively.
- Use it in `Multiselect` and `MultiselectClient`.
2019-08-18 19:51:04 +08:00
3debd2c808 Run black and isort w/ the new config 2019-08-13 14:36:42 -07:00
28f6de37ee Fix the rest of the typing hints (#232)
* ignore kad

* fix swarm, and minor

* fix init and swarm

* ignore pb

* enable mypy

* fix basic host

* fix tcp

* fix mplex

* add typing for pb

* skip format pyi

* [mypy] no need to ignore pb now

* add typing to chat
2019-08-11 16:47:54 +08:00
c536aa3e07 flake8 2019-08-08 16:09:02 +08:00
5903012e0e add typing to protocol_muxer 2019-08-08 16:09:02 +08:00