56 Commits

Author SHA1 Message Date
67ca1d7769 todo: handled ls command in multiselect.py (#622) 2025-05-27 20:18:37 -06:00
b2a6294cfa feat(host): add get_live_peers() to track connection state 2025-03-23 15:01:18 -06:00
d7eab27564 refactored and moved all interfaces to abc.py (#504)
* refactored : host_interface

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* refactored : network_interface

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* refactored : notifee_interface

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* refactored : net_connection_interface

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* refactored: raw_connection_interface, secure_conn_interface and stream_muxer abc.py

* refactored: addrbook_interface

* refactored :peerdata_interface

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* refactored :peermetadata_interface

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* refactored :multiselect_client_interface

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* refactored :multiselect_communicator_interface

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* refactored :multiselect_muxer_interface

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* refactored :interfaces

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* refactored :security_transport_interface

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* refactored :listener_interface

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* moved all interfaces and typing files

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>

* fixed documentation and moved pubsub abc.py

Co-authored-by: Khwahish Patel <khwahish.p1@ahduni.edu.in>

* added exclude-members in custom_types docs

* added : newsfragment for moving all interfaces to libp2p.abc

---------

Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com>
Co-authored-by: Mystical <125946525+mystical-prog@users.noreply.github.com>
2025-02-21 16:01:45 -07:00
e7a9ee78a8 rename typing.py to custom_types.py for clarity 2025-02-02 07:18:52 -07:00
8787613e91 run lint with pyupgrade at py39-plus 2025-01-25 15:48:39 -07:00
17575f4a38 added test for connected peers 2024-11-21 11:51:19 -07:00
847dfa6577 added getter for connected peers 2024-11-21 11:51:19 -07:00
d9b92635c1 drop async-service dep and copy relevant code into a local async_service
tool, updated for modern handling of ExceptionGroup
2024-05-27 12:14:36 -06:00
827d16b106 import asynccontextmanager from context lib and remove async_generator dep 2024-04-27 10:12:39 -06:00
8dda7b933e turn mypy checks back on, fix some errors 2024-04-27 10:12:39 -06:00
94483714a3 run lint and fix errors, except mypy 2024-02-19 16:05:58 -07:00
f1dbd52d67 Merge branch 'master' into feature/trio 2020-02-06 10:39:54 +08:00
6e01a7da31 PR feedback: async with host.run() 2020-01-26 16:44:42 +08:00
b1248ff315 enforced f-strings everywhere, %s on logging
extended _multiaddr_from_socket to support UDP and IPv6 automatically
changed TCPListener to use _ip4_or_6_from_multiaddr to get host, and not ip4 only

enforced `from error` everywhere with raises
added call braces to exceptions
2019-12-19 17:31:18 +01:00
566e4c080d Fix lint 2019-11-25 17:32:53 +08:00
e49de15227 Add get_private_key to Host 2019-11-25 16:57:00 +08:00
a63f00d8f8 Store our pubkey/privkey info during
`initialize_default_swarm`
2019-11-25 16:55:55 +08:00
4b01c33d54 add some additional logging 2019-11-07 20:57:43 -08:00
9500bdbf55 Add class attribute for additional property 2019-11-06 12:11:09 -08:00
0ca3e83540 lintroll 2019-11-06 11:41:28 -08:00
693a8cf99a Default protocols are constructed using a reference to the host 2019-11-06 11:41:28 -08:00
32c55bcaf2 hosts track their public key 2019-11-06 11:41:27 -08:00
ded3792924 Merge pull request #331 from dmuhs/fix/docs-format
Add automatic docstring formatting
2019-10-28 09:39:52 -06:00
bafdd8512d Enforce pre-summary newline in docstrings 2019-10-24 20:10:45 +02:00
15cabb1c33 Copy default data to avoid undesirable mutations 2019-10-24 17:29:33 +09:00
c92bade815 Add "default protocols" that all hosts have by default 2019-10-24 17:29:16 +09:00
eef505f2d9 Add automatic docstring formatter and apply 2019-10-24 08:41:10 +02:00
d1d91e4091 Refactored for 'lint' testenv 2019-10-15 19:02:03 +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
986a852e7e Remove forced debug level 2019-10-01 11:17:05 +02: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
02c55e5d14 Add tests for MplexConn 2019-09-19 16:31:42 +08:00
a9ad37bc6f Add mplex tests and fix error in SwarmConn.close 2019-09-19 16:31:41 +08:00
b8b5ac5e06 Add test for notifee disconnected 2019-09-19 16:31:41 +08:00
e7304538da Add test for Swarm.close_peer 2019-09-19 16:31:12 +08:00
6cb033fd1f Refactor multiselect out of Swarm to BasicHost 2019-09-19 13:59:50 +08:00
786a03544c Add some loggings to swarm and cosmetic updates 2019-09-14 21:47:49 +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
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
7477b29508 run black w/ extended line length 2019-08-04 12:37:41 +08:00
c8005c8113 Run isort in repo 2019-08-03 17:50:14 +08:00
0ae9840928 Run black over repo 2019-07-31 15:00:12 -07:00
e53727d301 Apply PR feedback: fix type hints 2019-07-30 16:28:25 +08:00
2d4e23cfe2 Fix cyclic import and lint 2019-07-30 16:28:05 +08:00