Commit Graph

84 Commits

Author SHA1 Message Date
66bd027161 Feat/587-circuit-relay (#611)
* feat: implemented setup of circuit relay and test cases

* chore: remove test files to be rewritten

* added 1 test suite for protocol

* added 1 test suite for discovery

* fixed protocol timeouts and message types to handle reservations and stream operations.

* Resolved merge conflict in libp2p/tools/utils.py by combining timeout approach with retry mechanism

* fix: linting issues

* docs: updated documentation with circuit-relay

* chore: added enums, improved typing, security and examples

* fix: created proper __init__ file to ensure importability

* fix: replace transport_opt with listen_addrs in examples, fixed typing and improved code

* fix type checking issues across relay module and test suite

* regenerated circuit_pb2 file protobuf version 3

* fixed circuit relay example and moved imports to top in test_security_multistream

* chore: moved imports to the top

* chore: fixed linting of test_circuit_v2_transport.py

---------

Co-authored-by: Manu Sheel Gupta <manusheel.edu@gmail.com>
2025-06-18 15:39:39 -06:00
d61bca78ab Kademlia DHT implementation in py-libp2p (#579)
* initialise the module

* added content routing

* added routing module

* added peer routing

* added value store

* added utilities functions

* added main kademlia file

* fixed create_key_from_binary function

* example to test kademlia dht

* added protocol ID and enhanced logging for peer store size in provider and consumer nodes

* refactor: specify stream type in handle_stream method and add peer in routing table

* removed content routing

* added default value of count for finding closest peers

* added functions to find close peers

* refactor: remove content routing and enhance peer discovery

* added put value function

* added get value function

* fix: improve logging and handle key encoding in get_value method

* refactor: remove ContentRouting import from __init__.py

* refactor: improved basic kademlia example

* added protobuf files

* replaced json with protobuf

* refactor: enhance peer discovery and routing logic in KadDHT

* refactor: enhance Kademlia routing table to use PeerInfo objects and improve peer management

* refactor: enhance peer addition logic to utilize PeerInfo objects in routing table

* feat: implement content provider functionality in Kademlia DHT

* refactor: update value store to use datetime for validity management

* refactor: update RoutingTable initialization to include host reference

* refactor: enhance KBucket and RoutingTable for improved peer management and functionality

* refactor: streamline peer discovery and value storage methods in KadDHT

* refactor: update KadDHT and related classes for async peer management and enhanced value storage

* refactor: enhance ProviderStore initialization and improve peer routing integration

* test: add tests for Kademlia DHT functionality

* fix linting issues

* pydocstyle issues fixed

* CICD pipeline issues solved

* fix: update docstring format for find_peer method

* refactor: improve logging and remove unused code in DHT implementation

* refactor: clean up logging and remove unused imports in DHT and test files

* Refactor logging setup and improve DHT stream handling with varint length prefixes

* Update bootstrap peer handling in basic_dht example and refactor peer routing to accept string addresses

* Enhance peer querying in Kademlia DHT by implementing parallel queries using Trio.

* Enhance peer querying by adding deduplication checks

* Refactor DHT implementation to use varint for length prefixes and enhance logging for better traceability

* Add base58 encoding for value storage and enhance logging in basic_dht example

* Refactor Kademlia DHT to support server/client modes

* Added unit tests

* Refactor documentation to fixsome warning

* Add unit tests and remove outdated tests

* Fixed precommit errora

* Refactor error handling test to raise StringParseError for invalid bootstrap addresses

* Add libp2p.kad_dht to the list of subpackages in documentation

* Fix expiration and republish checks to use inclusive comparison

* Add __init__.py file to libp2p.kad_dht.pb package

* Refactor get value and put value to run in parallel with query timeout

* Refactor provider message handling to use parallel processing with timeout

* Add methods for provider store in KadDHT class

* Refactor KadDHT and ProviderStore methods to improve type hints and enhance parallel processing

* Add documentation for libp2p.kad_dht.pb module.

* Update documentation for libp2p.kad_dht package to include subpackages and correct formatting

* Fix formatting in documentation for libp2p.kad_dht package by correcting the subpackage reference

* Fix header formatting in libp2p.kad_dht.pb documentation

* Change log level from info to debug for various logging statements.

* fix CICD issues (post revamp)

* fixed value store unit test

* Refactored kademlia example

* Refactor Kademlia example: enhance logging, improve bootstrap node connection, and streamline server address handling

* removed bootstrap module

* Refactor Kademlia DHT example and core modules: enhance logging, remove unused code, and improve peer handling

* Added docs of kad dht example

* Update server address log file path to use the script's directory

* Refactor: Introduce DHTMode enum for clearer mode management

* moved xor_distance function to utils.py

* Enhance logging in ValueStore and KadDHT: include decoded value in debug logs and update parameter description for validity

* Add handling for closest peers in GET_VALUE response when value is not found

* Handled failure scenario for PUT_VALUE

* Remove kademlia demo from project scripts and contributing documentation

* spelling and logging

---------

Co-authored-by: pacrob <5199899+pacrob@users.noreply.github.com>
2025-06-16 14:46:40 -06:00
f27f4ddd85 remove references to removed setup.py (#674) 2025-06-10 11:24:34 -06:00
630aac703d add make pr (#672) 2025-06-10 08:34:22 -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
9798db3932 fix towncrier config and correct links in release_notes 2025-05-12 13:22:12 -06:00
6064c96563 feat(autonat): add make targets for autonat protobuf generation and formatting 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
df72979606 moved factories to tests 2025-03-24 07:59:35 -06:00
68f6a362fd Compile release notes for v0.2.2 2025-02-20 09:15:25 -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
82b34ed70e drop latexpdf from docs build 2024-10-28 14:54:25 -06:00
40ce3a8174 fix code blocks and version parsing 2024-10-24 16:12:44 -06:00
e731a9464d Update Makefile
remove unneeded upstream git check
2024-06-17 11:11:17 -06:00
d8d0f05a88 update default docs and release process, drop bumpversion for
bump-my-version
2024-05-21 14:01:08 -06:00
ae8113250e add removing of *.egg-info to Makefile clean-build command 2024-04-30 09:48:50 -06:00
eea065fb57 reorg test structure to match tox and CI jobs, drop bumpversion for bump-my-version and move config to pyproject.toml, fix docs building 2024-04-20 09:18:26 -06:00
6a869e7d24 Update Makefile
add `python -m` to the Makefile `test` command
2024-04-15 12:44:13 -06:00
74f0a2fac9 sphinx-autobuild for live docs updates (#129)
* `sphinx-autobuild` for live docs updates.

* Use Python 3.9 and `sphinx-autobuild` `2024.2.4`
2024-04-15 11:23:46 -06:00
e29e67f4f0 update isort config and multi-platform grepping in Makefile 2024-03-22 13:29:33 -06:00
c72ec7f6d9 add validate-newsfragments to make notes 2024-03-01 10:34:14 -07:00
94483714a3 run lint and fix errors, except mypy 2024-02-19 16:05:58 -07:00
42605c0288 merge template updates and refill vars 2024-02-19 14:49:30 -07:00
bdd1a342d9 add docs build path for ci to check pdf and epub 2024-01-31 16:20:42 -07:00
4d17820fca Further generalize the grep command for remote check 2023-11-27 14:30:52 -07:00
7f75b270a5 Use upcoming version in make notes commit 2023-11-07 12:13:48 -07:00
3c65483121 update the grep command for upstream branch check
- Sometimes 'www.' is used in the url for https
2023-11-07 12:08:39 -07:00
86440ee879 add autoflake to lint and move config to pyproject.toml 2023-10-12 12:11:12 -06:00
146a3a9b02 drop egg references 2023-10-11 10:49:47 -06:00
0065691db7 Update Makefile
missing doublequote
2023-10-04 13:55:19 -06:00
7099bbaaa4 Add pre commit (#103)
* add pre-commit

* run pre-commit

* skip lint on README.md as it breaks template filling
2023-10-04 13:32:07 -06:00
37841d57ed Update release command to check remote for upstream 2023-06-14 14:38:28 -06:00
024f9dbd54 Add tests to distribution by default (#97) 2023-06-14 07:59:07 -06:00
42be4de76c fix typos in ci config and Makefile 2023-06-02 15:06:42 -06:00
1f5fc7208b Remove testall (#88)
* remove testall because it doesnt work
2023-05-01 15:19:16 -06:00
cc24e7e468 update tox calls to use run, update all pip calls to use python -m (#86) 2023-05-01 15:19:16 -06:00
da9b95f37c introduce contributing doc + main branch convention (#84) 2023-05-01 15:19:16 -06:00
be0106907f Merge pull request #70 from fselmo/minor-cleanup
Do not invoke `setup.py` directly; minor refactor + cleanup
2022-11-30 11:57:29 -07:00
7c85f95a4d Do not invoke `setup.py` directly
- It is not recommended to invoke ``setup.py`` directly, instead opting for ``python -m build`` for the commands in this commit (see: https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html)
- Add newsfragment for #70
2022-11-21 17:40:56 -07:00
4bd024028b Fix a copy-paste mistake from #65
toxinidir won't mean anything in a Makefile
2022-09-22 13:47:14 -07:00
8a4cb1d938 Upgrade isort to v5 for black support 2022-09-22 13:38:20 -07:00
99af2f4d53 Misc Updates (#65)
* Tweaks to release process

* Drop python 3.6
2022-09-19 14:35:39 -06:00
160c0feb05 Add a validate docs command (#64) 2022-06-22 13:55:56 -06:00
cb112ef9c1 Upgrade towncrier to fix the duplicate title bug 2022-06-02 15:36:24 -07:00
4d0358f67b Be sure to remove py3 cache files 2020-09-24 08:59:09 -07:00
be1c324204 Add some Makefile doc strings 2020-09-24 08:58:58 -07:00
c447735449 Better error if bump missing in make notes/release 2020-05-11 13:55:17 -07:00
d7fabab3e1 Noise: add compiled pb2.py 2020-02-09 13:23:12 +08:00