Skip to content

fix: node info accepts --rpc-url as fallback for --ip#26

Open
devrel-ditto wants to merge 1 commit intoava-labs:mainfrom
devrel-ditto:fix/node-info-rpc-url
Open

fix: node info accepts --rpc-url as fallback for --ip#26
devrel-ditto wants to merge 1 commit intoava-labs:mainfrom
devrel-ditto:fix/node-info-rpc-url

Conversation

@devrel-ditto
Copy link
Copy Markdown

Summary

Fixes #24node info now accepts the global --rpc-url flag as a fallback when --ip is not provided.

Problem

Every command uses --rpc-url for custom endpoints, but node info only accepted --ip:

platform node info --rpc-url http://127.0.0.1:9650  # ❌ --ip is required
platform node info --ip 127.0.0.1                    # ✅ works

Fix

  • Check --ip first (backward compatible)
  • Fall back to global --rpc-url if --ip not provided
  • Error message updated: --ip or --rpc-url is required

The underlying GetNodeInfoWithInsecureHTTP already accepts full URIs, so no changes needed in the node package.

Testing

$ platform node info --rpc-url http://127.0.0.1:9650  # ✅ works now
Node ID:        NodeID-CMGz4CPsWCpvXx7GeftpDFGo8tir2R7mi

$ platform node info --ip 127.0.0.1                    # ✅ still works
Node ID:        NodeID-CMGz4CPsWCpvXx7GeftpDFGo8tir2R7mi

$ platform node info                                   # ✅ clear error
--ip or --rpc-url is required

The node info command required --ip while every other command uses the
global --rpc-url flag. Now node info checks --ip first, then falls
back to --rpc-url, making it consistent with the rest of the CLI.

--ip is preserved for backward compatibility.

Fixes ava-labs#24
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.

node info uses --ip instead of --rpc-url, inconsistent with other commands

1 participant