Skip to content

Implement polykey nodes join command #438

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

Draft
wants to merge 3 commits into
base: staging
Choose a base branch
from

Conversation

aryanjassal
Copy link
Contributor

@aryanjassal aryanjassal commented Jul 22, 2025

Description

This PR works alongside MatrixAI/Polykey#924 to allow an agent to join a PKE network. This PR focuses on introducing a nodes join command which allows a node to join the provided network.

Issues Fixed

Tasks

  • 1. Add the polykey nodes join command
  • 2. Add tests for the command by simulating private networks

Final checklist

  • Domain specific tests
  • Full tests
  • Updated inline-comment documentation
  • Lint fixed
  • Squash and rebased
  • Sanity check the final build

@aryanjassal aryanjassal self-assigned this Jul 22, 2025
@aryanjassal
Copy link
Contributor Author

For testing nodes join, I need to modify the behaviour of DNS resolution to point to a local node. For doing this, the dns.promises.resolveSrv is called to resolve the service _polykey_agent._udp.${hostname} to return a pair of [name, port]. The name is of the format ${nodeId}.${hostname}, so we need to trim the nodeId out to get the hostname from the name.

To test this, I can mock dns.promises.resolveSrv to return the name and port of a local node which I can easily construct and mock. I can reference the tests in polykey as well for things that I am currently unsure about, but this will allow me to easily test network switching from a network to another.

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

Successfully merging this pull request may close these issues.

Create the polykey nodes join command
1 participant