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

PortalNetwork: REPL Interface for Portal Network #721

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

cjustinobi
Copy link
Contributor

This PR introduces a REPL interface for interacting with the Portal Network, enabling developers to test and manage the network more effectively.

Features:

REPL Commands:

  • .ping <network>: Send a ping request to the specified network (history or state).
  • .findnodes <network> <enr> <distances>: Locate nodes within a network using an ENR and distances.
  • .findcontent <network> <enr> <contentKey>: Search for content in a network using an ENR and content key.
  • .offer <network> <enr> <contentKey> <contentValue>: Offer content to a node in the specified network.
  • .status: Display the current status of the Portal Network and its components.

@cjustinobi
Copy link
Contributor Author

@acolytec3 I just want to make sure I'm in the right track. Please your feedback

Copy link
Collaborator

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far. I pushed a couple of tweaks so it will actually connect to the network now. You can also tune the logs it shows because the stuff you have now is a lot of logs.

@cjustinobi
Copy link
Contributor Author

Alright. Also, the methods I implemented so far are as a result of what I saw from here Are there more stuff I could have done there?

@acolytec3
Copy link
Collaborator

The full rpc spec is here

I don't think we need to implement all of them but maybe like addENR would be helpful.

@cjustinobi cjustinobi changed the title WIP: REPL Interface for Portal Network PortalNetwork: REPL Interface for Portal Network Jan 25, 2025
@cjustinobi cjustinobi marked this pull request as ready for review January 25, 2025 16:41
Copy link
Collaborator

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We need a different (more accurate) mechanism for enforcing "first ping is type 0", maybe through an enr cache that we've played around with in the past.

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

Successfully merging this pull request may close these issues.

2 participants