feat: Implement py-peer of Universal Connectivity dApp#294
feat: Implement py-peer of Universal Connectivity dApp#294sumanjeet0012 wants to merge 82 commits intolibp2p:py-peer-developmentfrom
Conversation
Bumps the npm_and_yarn group in /js-peer with 1 update: [next](https://github.com/vercel/next.js). Updates `next` from 14.2.13 to 14.2.25 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](vercel/next.js@v14.2.13...v14.2.25) --- updated-dependencies: - dependency-name: next dependency-type: direct:production dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Adds a basic Node.js peer with a terminal user interface. Lifts some code from the existing js-peer. Doesn't support DMs or dialing peers directly (yet). Fixes libp2p#214 --------- Co-authored-by: Daniel N <2color@users.noreply.github.com>
* chore: add or force update .github/workflows/stale.yml * chore: add or force update .github/workflows/generated-pr.yml
* add tui ui * add polling of events * clean up peer code * all hooked up * clean up system messages * smarter system messages * add tcp * fix channel handling * drop peers when they hang up * fix listen address is not necessarily an external address * add better logging and peer list * add headless, kademlia, relay, dcutr, webrtc, peer discovery * fix clippy * add tui ui * add polling of events * clean up peer code * all hooked up * clean up system messages * smarter system messages * add tcp * fix channel handling * drop peers when they hang up * fix listen address is not necessarily an external address * add better logging and peer list * add headless, kademlia, relay, dcutr, webrtc, peer discovery * fix clippy Signed-off-by: Dave Grantham <dwg@linuxprogrammer.org>
- Refactored UI code to utilize trio memory channels for asynchronous communication, replacing the previous queue-based approach. - Implemented handling of incoming and outgoing messages using async methods, improving responsiveness and error handling. - Simplified message sending and processing logic, ensuring UI updates are handled safely within the async context.
… Textual; integrated Janus queue for communication between service and TUI.
… installation instructions
|
@seetadev Ready for review |
…mpatibility with py peer
… enhance headless service initialization with strict signing option
| BOOTSTRAP_PEERS = [ | ||
| "/ip4/139.178.65.157/tcp/4001/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa", | ||
| "/ip4/139.178.91.71/tcp/4001/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN", | ||
| "/ip4/145.40.118.135/tcp/4001/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt" |
| # nursery.start_soon(maintain_connections, self.host) | ||
|
|
||
| except (MultiselectClientError, StreamFailure) as e: | ||
| logger.log(f"The protocol negotitaion failed: {e}") |
There was a problem hiding this comment.
My pylance is showing this missing an arg. Looks like logger.log takes both a level and a msg.
There was a problem hiding this comment.
Yes, that is correct. I have replaced logger.log with logger.error.
| port=args.port, | ||
| connect_addrs=args.connect, | ||
| strict_signing=strict_signing, | ||
| seed=args.seed, |
There was a problem hiding this comment.
We take and pass seed here, but over in HeadlessService the value is never used.
There was a problem hiding this comment.
The seed is now handled as follows:
secret = hashlib.sha256(self.seed.encode()).digest()
key_pair = create_new_key_pair(seed=secret)
|
You've removed |
…ssaging, identity handling, and service control.
…configuration in pyproject.toml
|
@sumanjeet0012 : Hi Sumanjeet. Please ping me and @pacrob once this dapp is fully ready for final merge. Will collaborate with the maintainers of the repo to see this PR landed. |
…ronment and starting the application
Added proper documentation for running py-peer of universal connectivity. |
Python Implementation of Universal Connectivity Chat Application
Overview
This PR implements a complete Python peer-to-peer chat application using libp2p and GossipSub protocol, addressing the request for a Python peer in the Universal Connectivity project.
Related Issue
Fixes: libp2p/py-libp2p#624
Implementation Details
Core Features
Technical Stack
Key Components
main.py- Application entry point with argument parsingchatroom.py- Chat room logic and message handlingheadless.py- Background service managing libp2p operationsui.py- Textual-based terminal user interfaceUsage Examples
Testing
Dependencies
Documentation
Additional Notes