Commit Graph

70 Commits

Author SHA1 Message Date
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
ee4e9c4645 rename libp2p test dir and rebuild protobufs 2024-03-02 11:10:05 -07:00
94483714a3 run lint and fix errors, except mypy 2024-02-19 16:05:58 -07:00
6e01a7da31 PR feedback: async with host.run() 2020-01-26 16:44:42 +08:00
3372c32432 Fix examples and modify new_node
- Fix examples `chat.py` and `echo.py`
    - Use trio directly, instead of `trio-asyncio`
    - Remove redundant code
- Change entry API `new_node` to `new_host_trio`
2019-12-24 18:03:18 +08:00
ce5663705f Merge branch 'master' into feature/porting-to-trio 2019-12-24 02:19:43 +08:00
82dcce214a Remove kademlia module (#377)
* Remove kademlia and routing/kademlia

* cleanup

* Fix routed_host test

* lint mypy

* fix doc

* remove set_up_nodes_by_transport_and_disc_opt and fix typing
2019-12-06 14:14:33 +08:00
2a9dc96269 Merge pull request #369 from carver/docs-travis-target
Add docs test to Travis CI
2019-11-27 10:36:15 -08:00
d503950179 Fix all doc build warnings 2019-11-26 17:44:33 -08:00
417b5e7d61 remove unused asyncio 2019-11-26 15:27:06 +08:00
d4d345c3c7 progressing 2019-11-26 15:27:05 +08:00
ed17bfd663 hack chat example 2019-11-26 15:27:04 +08:00
828ae69c66 Apply PR feedback: add_key_pair 2019-11-26 11:52:31 +08:00
a63f00d8f8 Store our pubkey/privkey info during
`initialize_default_swarm`
2019-11-25 16:55:55 +08:00
bcd7890124 Move test utilities to tools (#356)
* move test factories to libp2p/tools

* remove unused inits

* move pubsub test utils to tools

* cleanup test_interop

* fix typing libp2p/tools/utils

* add typing to pubsub utils

* fix factories typing

* fix typing for floodsub_integration_test_settings

* fix rest of the typing

* fix isort
2019-11-21 11:47:54 +08:00
10dd997805 Reorganize factories 2019-11-06 12:11:09 -08:00
32c55bcaf2 hosts track their public key 2019-11-06 11:41:27 -08:00
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
70ea471491 Blacked 2019-10-15 19:11:11 +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
37bee9fb16 PR feedback
- Use `TMuxerOptions` and `TSecurityOptions` in libp2p/__init__.py
- Remove the default value for `muxer_transports_by_protocol` in
`MuxerMultistream` and `secure_transports_by_protocol`
`SecureMultistream`
2019-09-24 12:51:59 +08:00
1bd18c84f2 Apply suggestions from code review
Co-Authored-By: Alex Stokes <r.alex.stokes@gmail.com>
2019-09-24 12:33:14 +08:00
a9ad37bc6f Add mplex tests and fix error in SwarmConn.close 2019-09-19 16:31:41 +08:00
350cc04c97 Allow the key pair to drive ID generation 2019-09-03 13:26:58 -07:00
228032805a Some code cleanup 2019-08-24 22:38:25 +02:00
d176115972 Add secio to security upgrader suite 2019-08-24 22:37:46 +02:00
22b1a5395d A working plaintext 2.0 without validation 2019-08-22 22:53:46 +08:00
8596f7390f PR feedback: set protocol_id to constants 2019-08-21 11:43:24 +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
7535a02da7 Clean up key gen 2019-08-15 19:24:30 -07:00
2e3ffb9d53 Use types for {Private,Public}Key and address other missing type hints 2019-08-15 16:33:34 -07:00
9e18d7561d Supply local priv and pub key when upgrading to a secure transport 2019-08-15 16:33:34 -07:00
02e073d85a Keep the host's private key for use in transports 2019-08-15 16:33:33 -07:00
1e5357a1e1 Update the ISecureConn interface following the reference and simplify accordingly 2019-08-15 16:33:33 -07:00
d50e1b6872 Use direct types over indirect types 2019-08-15 16:33:32 -07:00
ad20d8cb00 Make a KeyPair dataclass for passing around key pairs 2019-08-14 09:00:40 -07:00
c40314a043 Use new RSA key type 2019-08-14 09:00:39 -07:00
992585852f Use explicit imports in top-level declaration 2019-08-13 17:43:21 -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
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
bd8d45fbc1 Refactor ID to not use third-party type for cryptographic keys
Remove `ID.from_privkey` which would require specific knowledge per cryptosystem
2019-08-02 21:51:16 -07:00
2e94fcf56c Remove pylint:disable 2019-08-02 23:26:06 +08:00
f00e80bc25 Fix wrong peer id type used in KadPeerInfo 2019-08-02 14:42:10 +08:00
b928bdb356 Convert from base58/pubkey/privkey to class method 2019-08-02 14:42:10 +08:00
80481252ca Refactor ID to take in type bytes only 2019-08-02 14:42:10 +08:00
0ae9840928 Run black over repo 2019-07-31 15:00:12 -07:00