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

feat: Upgrade RPC local_node_id to local_node_info #233

Merged
merged 2 commits into from
Jan 30, 2019

Conversation

jjyr
Copy link
Contributor

@jjyr jjyr commented Jan 27, 2019

  • Rename RPC local_node_id to local_node_info
  • Change RPC output:
{
    "id": 2,
    "jsonrpc": "2.0",
    "result": {
        "addresses": [
            {
                "address": "/ip4/0.0.0.0/tcp/12344/p2p/QmWRU2NSro4wKgVbFX6y8SPFkcJ1tE2X5xzk9msMhdRmdS",
                "score": 1
            }
        ],
        "node_id": "QmWRU2NSro4wKgVbFX6y8SPFkcJ1tE2X5xzk9msMhdRmdS",
        "version": "0.5.0"
    }
}

@jjyr jjyr requested a review from a team January 27, 2019 13:49
network/src/identify_service.rs Outdated Show resolved Hide resolved
network/src/network.rs Outdated Show resolved Hide resolved
rpc/doc.md Outdated Show resolved Hide resolved
network/src/network.rs Show resolved Hide resolved
"result": {
"addresses": [
{
"address": "/ip4/0.0.0.0/tcp/12344/p2p/QmWRU2NSro4wKgVbFX6y8SPFkcJ1tE2X5xzk9msMhdRmdS",
Copy link
Member

Choose a reason for hiding this comment

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

Can /p2p/xxxx be omitted here? because it's duplicated with node_id.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After considering, I think we can leave it here because it is easy to copy-paste or parse in script, a typical node may have 2 addresses(local address and public address), it could have more addresses if it has multiple network interfaces, even it has multi public addresses the duplicate p2p phase is not big deal.

Copy link
Member

@doitian doitian left a comment

Choose a reason for hiding this comment

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

Please add a BREAKING CHANGE: section in your feat: commit message to explain the RPC change.

FYI https://www.conventionalcommits.org/en/v1.0.0-beta.2/

BREAKING CHANGE: RPC local_node_id no longer exists, use new added RPC
local_node_info to get node addresses.
@doitian doitian dismissed their stale review January 30, 2019 03:10

BREAKING CHANGE added

@jjyr jjyr merged commit bf2b7c3 into nervosnetwork:develop Jan 30, 2019
@jjyr jjyr deleted the RPC-local-node-id branch January 30, 2019 05:47
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.

3 participants