Commit Graph

97 Commits

Author SHA1 Message Date
76f17cf133 Compile release notes for v0.2.7 2025-05-22 15:26:20 -06:00
4b1860766d Feat: Adding Yamux as default multiplexer, keeping Mplex as fallback (#538)
* feat: Replace mplex with yamux as default multiplexer in py-libp2p

* Retain Mplex alongside Yamux in new_swarm with messaging that Yamux is preferred

* moved !BBHII to a constant YAMUX_HEADER_FORMAT at the top of yamux.py with a comment explaining its structure

* renamed the news fragment to 534.feature.rst and updated the description

* renamed the news fragment to 534.feature.rst and updated the description

* added a docstring to clarify that Yamux does not support deadlines natively

* Remove the __main__ block entirely from test_yamux.py

* Replaced the print statements in test_yamux.py with logging.debug

* Added a comment linking to the spec for clarity

* Raise NotImplementedError in YamuxStream.set_deadline per review

* Add muxed_conn to YamuxStream and test deadline NotImplementedError

* Fix Yamux implementation to meet libp2p spec

* Fix None handling in YamuxStream.read and Yamux.read_stream

* Fix test_connected_peers.py to correctly handle peer connections

* fix: Ensure StreamReset is raised on read after local reset in yamux

* fix: Map MuxedStreamError to StreamClosed in NetStream.write for Yamux

* fix: Raise MuxedStreamReset in Yamux.read_stream for closed streams

* fix: Correct Yamux stream read behavior for NetStream tests

Fixed 	est_net_stream_read_after_remote_closed by updating NetStream.read to raise StreamEOF when the stream is remotely closed and no data is available, aligning with test expectations and Fixed 	est_net_stream_read_until_eof by modifying YamuxStream.read to block until the stream is closed (
ecv_closed=True) for
=-1 reads, ensuring data is only returned after remote closure.

* fix: Correct Yamux stream read behavior for NetStream tests

Fixed 	est_net_stream_read_after_remote_closed by updating NetStream.read to raise StreamEOF when the stream is remotely closed and no data is available, aligning with test expectations and Fixed 	est_net_stream_read_until_eof by modifying YamuxStream.read to block until the stream is closed (
ecv_closed=True) for
=-1 reads, ensuring data is only returned after remote closure.

* fix: raise StreamEOF when reading from closed stream with empty buffer

* fix: prioritize returning buffered data even after stream reset

* fix: prioritize returning buffered data even after stream reset

* fix: Ensure test_net_stream_read_after_remote_closed_and_reset passes in full suite

* fix: Add __init__.py to yamux module to fix documentation build

* fix: Add __init__.py to yamux module to fix documentation build

* fix: Add libp2p.stream_muxer.yamux to libp2p.stream_muxer.rst toctree

* fix: Correct title underline length in libp2p.stream_muxer.yamux.rst

* fix: Add a = so that is matches the libp2p.stream\_muxer.yamux length

* fix(tests): Resolve race condition in network notification test

* fix: fixing failing tests and examples with yamux and noise

* refactor: remove debug logging and improve x25519 tests

* fix: Add functionality for users to choose between Yamux and Mplex

* fix: increased trio sleep to 0.1 sec for slow environment

* feat: Add test for switching between Yamux and mplex

* refactor: move host fixtures to interop tests

* chore: Update __init__.py removing unused import

removed unused
```python
import os
import logging
```

* lint: fix import order

* fix: Resolve conftest.py conflict by removing trio test support

* fix: Resolve test skipping by keeping trio test support

* Fix: add a newline at end of the file

---------

Co-authored-by: acul71 <luca.pisani@birdo.net>
Co-authored-by: acul71 <34693171+acul71@users.noreply.github.com>
2025-05-22 14:01:51 -06:00
18c6f529c6 Feat/issue 605 debug logging via env variable (#608)
* feat: Debug Logging via Environment Variable

* refactor: deleted libp2p/utils.py

* fix: double messages logging fix

* doc: add logging info to getting_started.rst
2025-05-20 14:07:22 -06:00
5b40e2551d doc: fix discord server link (#609)
* fix-discord-server-link
2025-05-16 10:38:49 -06:00
ede850d943 Compile release notes for v0.2.6 2025-05-12 13:45:35 -06:00
9798db3932 fix towncrier config and correct links in release_notes 2025-05-12 13:22:12 -06:00
0430ad397f doc: fix broken newsfragment link in contributing 2025-05-11 16:57:14 -06:00
04da30b7fe refractor: remove suppress warning in conf.py 2025-05-09 17:31:15 -06:00
8d98e93c27 refractor: remove suppress warning in conf.py 2025-05-09 17:31:15 -06:00
627c2cfe8e removed unused imports from conf.py 2025-05-09 17:31:15 -06:00
244cc0c42a refactor: update documentation structure for libp2p.host and autonat packages 2025-05-09 17:31:15 -06:00
86dce72ae0 fix: regenerate protobuf files to match runtime version 2025-05-09 17:31:15 -06:00
fd893afba6 delete old interop, turn on with placeholders, add py312 and py313 to CI testing 2025-05-08 13:30:00 -06:00
c40a1476ac Update docs/examples.identify_push.rst
Co-authored-by: Paul Robinson <5199899+pacrob@users.noreply.github.com>
2025-05-01 09:14:46 -06:00
35905909b5 Update docs/examples.identify_push.rst
Co-authored-by: Paul Robinson <5199899+pacrob@users.noreply.github.com>
2025-05-01 09:14:46 -06:00
6850907a32 Update docs/examples.identify_push.rst
Co-authored-by: Paul Robinson <5199899+pacrob@users.noreply.github.com>
2025-05-01 09:14:46 -06:00
c9dd7b381a Update docs/examples.identify_push.rst
Co-authored-by: Paul Robinson <5199899+pacrob@users.noreply.github.com>
2025-05-01 09:14:46 -06:00
66707364a7 doc: adding identify push protocol examples and doc 2025-05-01 09:14:46 -06:00
cef73519d3 feat: identify-push protocol. initial release 2025-05-01 09:14:46 -06:00
ded8b2d765 Doc: expanding the introduction section (#566) 2025-04-23 19:33:54 -06:00
f664d03852 Compile release notes for v0.2.5 2025-04-14 11:11:38 -06:00
bb9c8235a8 Add Windows setup and reorganize dependencies by OS in contributing.rst
Moved dependencies into Linux, macOS, and Windows sections per Paul's suggestion. Fixed reST formatting (blank lines, title underlines) to resolve Sphinx warnings from ReadTheDocs CI. Tested on Windows 10 (Python 3.11.0).
2025-04-11 18:28:38 -06:00
a1f57920a7 Add Windows development setup instructions to contributing.rst 2025-04-11 18:28:38 -06:00
03e2661982 modified multiplexer getting_started doc section 2025-04-11 18:01:57 -06:00
d0e997061e doc: add install and getting started documentation 2025-04-11 18:01:57 -06:00
346a0a14db Pubsub example for py-libp2p (#515)
* Initial setup for pubsup

* Created node and trying to setup gossipsub

* Fix: Use pubsub object for publishing messages instead of gossipsub

* Correct help message for port argument.

* Fix: Used pubsub object instead of gossipsub object on Client side

* Fix: handle_new_peer method of pubsub is used to connect to new peers.

* used for host.connect to connect to peers

* Corrected script for connecting to other peers.

* message receiving function created

* message publishing function created

* Refactored the code for improved clarity and maintainability.

* fix: make publish loop input non-blocking to prevent event loop blocking

* refactored the code for better user experience while publishing message

* corrected the name of protocol

* Fix: Correct the implementation of the port argument

* Added pubsub initialization

* added logging

* pubsub instance is running

* Enhance publish loop with user prompts and error handling

* Connection monitoring added

* Add key pair generation and security options to pubsub host initialization

* Refactor pubsub logging and corrected gossipsub protocol id

* Started gossipsub service

* Add dynamic port assignment

* Refactor pubsub example for CI

* feat: monitor_peer_topics function added

* Noise protocol added

* refactor: default port set to none and some logging changes.

* refactor: Add graceful shutdown with termination events

- Replace infinite loops with termination events
- Add proper shutdown handling for all loops
- Implement clean resource cleanup on exit
- Add shutdown message for better user feedback
- Update signal handling for graceful termination

* Changed import path for factories file.
- to align import statement with changes from PR 543

* Added News Fragment

* Added pub-sub demo to the console_scripts section in setup.py

* Added pubsub example to Documentation

* Fix formatting and path in PubSub documentation example

* Added pubsub example in toctree

* Added tests for pubsub example

* updated the description of pubsub example

* corrected the name of pubsub docs file

* Remove unused imports and security options from pubsub example

* Update script usage instructions in pubsub example

* Enhanced compatibility for python 3.9

* Corrected console output
2025-04-06 14:38:14 -06:00
31d0f8a79c docs: add section about adding examples to contributing guide 2025-04-02 03:13:20 -06:00
aec7995eba Compile release notes for v0.2.4 2025-03-27 15:53:34 -06:00
f9b8ac9da1 Compile release notes for v0.2.3 2025-03-27 14:46:44 -06:00
1613cf02d4 fix: add missing examples/identify/__init__.py and doc docs/examples.identify.rst 2025-03-27 14:37:43 -06:00
9379deab5a add macos details, update details
Signed-off-by: Dave Grantham <dwg@linuxprogrammer.org>
2025-03-27 14:31:11 -06:00
4514e86ee4 move pubsub testing tools into tests/utils 2025-03-27 14:21:45 -06:00
604a447287 feat: add identify protocol example 2025-03-24 17:55:16 -06:00
df72979606 moved factories to tests 2025-03-24 07:59:35 -06:00
ddf68ee4e0 rebuild protobufs with protoc v30.1 2025-03-23 16:49:19 -06:00
c86f3d0467 added dedicated test file and moved timed_cache to tools 2025-03-17 09:27:13 -06:00
ddd8930854 fixed doc errors 2025-03-17 09:27:13 -06:00
e5f3e88134 added : timed_cache sub-module 2025-03-17 09:27:13 -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
68f6a362fd Compile release notes for v0.2.2 2025-02-20 09:15:25 -07:00
e7a9ee78a8 rename typing.py to custom_types.py for clarity 2025-02-02 07:18:52 -07:00
e0814c9860 move interop tests tools into tests folder 2025-01-25 15:28:32 -07:00
460db3dce8 merge template, fill vars, lint 2025-01-25 14:43:45 -07:00
ae5b634d7b Update code_of_conduct.rst
making -> make
2025-01-04 15:44:50 -07:00
a72dbaa58d set demos as console scripts, update chat instructions 2025-01-01 17:36:41 -07:00
ba0d07ed66 Compile release notes for v0.2.1 2024-12-20 11:56:33 -07:00
83887422fb correct use of __file__ 2024-12-02 12:13:04 -07:00
c2dee2a538 replase display_version with two other options 2024-10-28 14:54:25 -06:00
40ce3a8174 fix code blocks and version parsing 2024-10-24 16:12:44 -06:00
bcc7d256a6 added ping docs 2024-10-24 11:34:32 -06:00