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

Add CLEOS support for get_finalizer_info RPC endpoint #470

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

linh2931
Copy link
Member

@linh2931 linh2931 commented Aug 3, 2024

Resolves #464

cleos get command output now looks like

./cleos get -h
Retrieve various items and information from the blockchain
Usage: bin/cleos get [OPTIONS] SUBCOMMAND

Options:
  -h,--help              Print this help message and exit
  --help-all             Show all help

Subcommands:
  info                   Get current blockchain information
  finalizer_info         Get current finalizer information
  transaction-status     Get transaction status information
  consensus_parameters   Get current blockchain consensus parameters
  block                  Retrieve a full block from the blockchain
 ...

Sample command output in Legacy:

./cleos get finalizer_info
{
  "active_finalizer_policy": null,
  "pending_finalizer_policy": null,
  "last_tracked_votes": []
}

Sample command output in Savanna:

./cleos get finalizer_info
{
  "active_finalizer_policy": {
    "generation": 1,
    "threshold": 3,
    "finalizers": [{
        "description": "finalizer #1",
        "weight": 1,
        "public_key": "PUB_BLS_B59vbf8hreKiI0-6pWvHs55VMPEGCwvcsnsfhLt-tmXnnakc7xDuEVDCwG6YAI0OHn2nydknjwA-et1tZHfckVGDNrffliKlcxoDHlmOuVWENwj300BLfdLmifuc2eIVms-V1w"
      },{
        "description": "finalizer #2",
        "weight": 1,
        "public_key": "PUB_BLS_aC9j4RbZ0mMixSwq2YeB-H7HzNGBCYYKRMTYD8JtPXgJnByhiEBV1Iudkxz6lJ8QzaPcko2mInz-ezMJpBc6PDN9BmHmME_ktESNId9AwuZkWmxB_dMBqdJbBC8m6nwRsHo4Qw"
      },{
        "description": "finalizer #3",
        "weight": 1,
        "public_key": "PUB_BLS_qacN8yy04oNE2keEue7oGEOqyBt2uDE61dorlRTA40I4Ftl4Gsh-fm2jpR_bbisKPnAHhK80sgfb8DSyUh7kNFlUIMxzYIQ9M9Ug3m2wnrBgs-1Aj8nP-vuhWvzihG4J5FFKGA"
      },{
        "description": "finalizer #4",
        "weight": 1,
        "public_key": "PUB_BLS_qVbh4IjYZpRGo8U_0spBUM-u-r_G0fMo4MzLZRsKWmm5uyeQTp74YFaMN9IDWPoVVT5rj_Tw1gvps6K9_OZ6sabkJJzug3uGfjA6qiaLbLh5Fnafwv-nVgzzzBlU2kwRrcHc8Q"
      }
    ]
  },
  "pending_finalizer_policy": null,
  "last_tracked_votes": [{
      "description": "finalizer #1",
      "public_key": "PUB_BLS_B59vbf8hreKiI0-6pWvHs55VMPEGCwvcsnsfhLt-tmXnnakc7xDuEVDCwG6YAI0OHn2nydknjwA-et1tZHfckVGDNrffliKlcxoDHlmOuVWENwj300BLfdLmifuc2eIVms-V1w",
      "is_vote_strong": true,
      "finalizer_policy_generation": 1,
      "voted_for_block_id": "000000422dc57b4d1adc8a74c2c285fb2e8661afd440b7ff753e381fc9a8c58d",
      "voted_for_block_num": 66,
      "voted_for_block_timestamp": "2024-08-03T21:15:43.000"
    },{
      "description": "finalizer #2",
      "public_key": "PUB_BLS_aC9j4RbZ0mMixSwq2YeB-H7HzNGBCYYKRMTYD8JtPXgJnByhiEBV1Iudkxz6lJ8QzaPcko2mInz-ezMJpBc6PDN9BmHmME_ktESNId9AwuZkWmxB_dMBqdJbBC8m6nwRsHo4Qw",
      "is_vote_strong": true,
      "finalizer_policy_generation": 1,
      "voted_for_block_id": "000000422dc57b4d1adc8a74c2c285fb2e8661afd440b7ff753e381fc9a8c58d",
      "voted_for_block_num": 66,
      "voted_for_block_timestamp": "2024-08-03T21:15:43.000"
    },{
      "description": "finalizer #3",
      "public_key": "PUB_BLS_qacN8yy04oNE2keEue7oGEOqyBt2uDE61dorlRTA40I4Ftl4Gsh-fm2jpR_bbisKPnAHhK80sgfb8DSyUh7kNFlUIMxzYIQ9M9Ug3m2wnrBgs-1Aj8nP-vuhWvzihG4J5FFKGA",
      "is_vote_strong": true,
      "finalizer_policy_generation": 1,
      "voted_for_block_id": "000000422dc57b4d1adc8a74c2c285fb2e8661afd440b7ff753e381fc9a8c58d",
      "voted_for_block_num": 66,
      "voted_for_block_timestamp": "2024-08-03T21:15:43.000"
    },{
      "description": "finalizer #4",
      "public_key": "PUB_BLS_qVbh4IjYZpRGo8U_0spBUM-u-r_G0fMo4MzLZRsKWmm5uyeQTp74YFaMN9IDWPoVVT5rj_Tw1gvps6K9_OZ6sabkJJzug3uGfjA6qiaLbLh5Fnafwv-nVgzzzBlU2kwRrcHc8Q",
      "is_vote_strong": true,
      "finalizer_policy_generation": 1,
      "voted_for_block_id": "000000422dc57b4d1adc8a74c2c285fb2e8661afd440b7ff753e381fc9a8c58d",
      "voted_for_block_num": 66,
      "voted_for_block_timestamp": "2024-08-03T21:15:43.000"
    }
  ]
}

@linh2931 linh2931 requested review from heifner and greg7mdp August 3, 2024 21:29
@linh2931 linh2931 merged commit b8fb378 into main Aug 5, 2024
36 checks passed
@linh2931 linh2931 deleted the cleos_get_finalizer_info branch August 5, 2024 12:42
@ericpassmore
Copy link
Contributor

Note:start
group: STABILITY
category: INTERNALS
summary: cleos support for get_finalizer_info.
Note:end

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.

Add cleos command for the new get_finalizer_info RPC endpoint
4 participants