-
Notifications
You must be signed in to change notification settings - Fork 39
Add new xmtpd-cli based on spf13/cobra #880
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
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Add new xmtpd-cli command-line tool based on spf13/cobra for managing XMTP network node registry and rate registry operationsCreates a new command-line interface tool
📍Where to StartStart with the main entry point in cmd/xmtpd-cli/main.go and then examine the root command setup in cmd/xmtpd-cli/commands/root.go to understand the overall CLI structure. Macroscope summarized b3211d7. |
| Short: "Register a node", | ||
| Run: registerNodeHandler, | ||
| Example: ` | ||
| Usage: xmtpd nodes register --owner-address <address> --signing-key-pub <key> --http-address <address> [--force] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the cli command tends to be xmtpd-cli or maybe we need a different name. But historically it has not been xmtpd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, fixing it.
mkysel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you planning on having the CLIs live concurrently while developing and then purging the old one?
I think It would be nice to live concurrently until we make sure they have the same features and there are no major problems, then we can make the switch. |
### Modify `AddNode` method to return node ID and update `WriteToRegistry` to accept context parameter for migrator cleanup - The `AddNode` method in `INodeRegistryAdmin` interface now returns a `uint32` node ID in addition to an error, with the implementation capturing the node ID from the `NodeAdded` event in [pkg/blockchain/registryAdmin.go](https://github.com/xmtp/xmtpd/pull/881/files#diff-d2eeb0eee280c4bdf2aa11a0222e19583a009cbd7aa6ee4fa791be3a892b43d9) - The `WriteToRegistry` function in [pkg/blockchain/migrator/migrator.go](https://github.com/xmtp/xmtpd/pull/881/files#diff-bc12b88012e6220f18d02533f0643cca1daf3bf6e6e7021ee4489208e28479d7) now accepts a context parameter instead of a logger and adds nodes to the canonical network when the `InCanonicalNetwork` flag is true - All callers of `AddNode` and `WriteToRegistry` have been updated to handle the new function signatures in [cmd/cli/main.go](https://github.com/xmtp/xmtpd/pull/881/files#diff-ed4d81d29a7267f93fd77e17993fd3491b9ef6ded18490b4514d10ed1d803bc2), test files, and related components #### 📍Where to Start Start with the `AddNode` method implementation in the `nodeRegistryAdmin` struct in [pkg/blockchain/registryAdmin.go](https://github.com/xmtp/xmtpd/pull/881/files#diff-d2eeb0eee280c4bdf2aa11a0222e19583a009cbd7aa6ee4fa791be3a892b43d9) to understand the core interface change. ---- _[Macroscope](https://app.macroscope.com) summarized 525f5cc._
Uh oh!
There was an error while loading. Please reload this page.