Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roadmap #1

Open
5 of 7 tasks
coolaj86 opened this issue Aug 15, 2024 · 0 comments
Open
5 of 7 tasks

Roadmap #1

coolaj86 opened this issue Aug 15, 2024 · 0 comments

Comments

@coolaj86
Copy link
Member

coolaj86 commented Aug 15, 2024

Through my work with https://github.com/dashhive/DashJoin.js and https://github.com/dashhive/DashGov.js I believe I've discovered the minimal layer of abstraction that maximizes practical use of the P2P network without a strong dependency on a particular type of network proxy or protocol.

  • create a state machine for byte stream
    • states: 'header', 'payload', 'result', 'error'
  • utility wrapper for websocket
  • utility wrapper for node tcp
  • option to automatically handle version / verack
  • ption to automatically handle ping / pong
  • option to automatically pool recent inv messages
  • promise-emit all messages that are not handled automatically

Since the general node and EventEmitter approach doesn't work well with async/await, I believe I'll be using a pattern of let message = await session.accept(); to more closely model the familiar pattern found in Go and other languages.

This will probably become a hard dependency of DashJoin.js, and future P2P development I DashGov.js (if any). It's almost as lightweight as https://github.com/dashhive/DashTx.js/pull/79/files#diff-dcba0694ad59e9893af33895826b399745c8e3ace322c260c2e9ab5244bb0427, but just not quite lightweight enough to justify inclusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant