Commit Graph

64 Commits

Author SHA1 Message Date
2dfee68f20 Refactor bootstrap discovery to use async methods and update bootstrap peers list 2025-07-10 19:24:09 +05:30
16be6fab85 Merge branch 'main' into feature/bootstrap 2025-07-03 00:21:19 +05:30
a7eb9b5fbd negotiate timeout configurable in application code 2025-07-01 18:35:17 +05:30
12ad2dcdf4 Added bootstrap module 2025-06-30 11:37:40 +05:30
5262566f6a fix: check for mDNS attribute before accessing it in BasicHost 2025-06-26 00:36:59 +05:30
f274d20715 feat: attached mdns instance with host 2025-06-25 23:44:32 +05:30
22d93b39ae Add ttl for peer data expiration (#655)
* Add ttl and last_identified to peerdata

* Add test for ttl

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>

* Fix lint and add newsfragments

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>

* Fix failing ci

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>

* fix ttl time from 600 to 120

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>

* fix test ttl timeout and lint errors

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>

* Fix docstrings

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>

* rebase main

* remove print statement

---------

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>
Co-authored-by: pacrob <5199899+pacrob@users.noreply.github.com>
2025-06-09 12:42:59 -06:00
bdadec7519 ft. modernise py-libp2p (#618)
* fix pyproject.toml , add ruff

* rm lock

* make progress

* add poetry lock ignore

* fix type issues

* fix tcp type errors

* fix text example - type error - wrong args

* add setuptools to dev

* test ci

* fix docs build

* fix type issues for new_swarm & new_host

* fix types in gossipsub

* fix type issues in noise

* wip: factories

* revert factories

* fix more type issues

* more type fixes

* fix: add null checks for noise protocol initialization and key handling

* corrected argument-errors in peerId and Multiaddr in peer tests

* fix: Noice - remove redundant type casts in BaseNoiseMsgReadWriter

* fix: update test_notify.py to use SwarmFactory.create_batch_and_listen, fix type hints, and comment out ClosedStream assertions

* Fix type checks for pubsub module

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>

* Fix type checks for pubsub module-tests

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>

* noise: add checks for uninitialized protocol and key states in PatternXX

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>

* pubsub: add None checks for optional fields in FloodSub and Pubsub

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>

* Fix type hints and improve testing

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>

* remove redundant checks

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>

* fix build issues

* add optional to trio service

* fix types

* fix type errors

* Fix type errors

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>

* fixed more-type checks in crypto and peer_data files

* wip: factories

* replaced union with optional

* fix: type-error in interp-utils and peerinfo

* replace pyright with pyrefly

* add pyrefly.toml

* wip: fix multiselect issues

* try typecheck

* base check

* mcache test fixes , typecheck ci update

* fix ci

* will this work

* minor fix

* use poetry

* fix wokflow

* use cache,fix err

* fix pyrefly.toml

* fix pyrefly.toml

* fix cache in ci

* deploy commit

* add main baseline

* update to v5

* improve typecheck ci (#14)

* fix typo

* remove holepunching code (#16)

* fix gossipsub typeerrors (#17)

* fix: ensure initiator user includes remote peer id in handshake (#15)

* fix ci (#19)

* typefix: custom_types | core/peerinfo/test_peer_info | io/abc | pubsub/floodsub | protocol_muxer/multiselect (#18)

* fix: Typefixes in PeerInfo  (#21)

* fix minor type issue (#22)

* fix type errors in pubsub (#24)

* fix: Minor typefixes in tests (#23)

* Fix failing tests for type-fixed test/pubsub (#8)

* move pyrefly & ruff to pyproject.toml & rm .project-template (#28)

* move the async_context file to tests/core

* move crypto test to crypto folder

* fix: some typefixes (#25)

* fix type errors

* fix type issues

* fix: update gRPC API usage in autonat_pb2_grpc.py (#31)

* md: typecheck ci

* rm comments

* clean up : from review suggestions

* use | None over Optional as per new python standards

* drop supporto for py3.9

* newsfragments

---------

Signed-off-by: sukhman <sukhmansinghsaluja@gmail.com>
Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>
Co-authored-by: acul71 <luca.pisani@birdo.net>
Co-authored-by: kaneki003 <sakshamchauhan707@gmail.com>
Co-authored-by: sukhman <sukhmansinghsaluja@gmail.com>
Co-authored-by: varun-r-mallya <varunrmallya@gmail.com>
Co-authored-by: varunrmallya <100590632+varun-r-mallya@users.noreply.github.com>
Co-authored-by: lla-dane <abhinavagarwalla6@gmail.com>
Co-authored-by: Collins <ArtemisfowlX@protonmail.com>
Co-authored-by: Abhinav Agarwalla <120122716+lla-dane@users.noreply.github.com>
Co-authored-by: guha-rahul <52607971+guha-rahul@users.noreply.github.com>
Co-authored-by: Sukhman Singh <63765293+sukhman-sukh@users.noreply.github.com>
Co-authored-by: acul71 <34693171+acul71@users.noreply.github.com>
Co-authored-by: pacrob <5199899+pacrob@users.noreply.github.com>
2025-06-09 11:39:59 -06:00
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