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

EN-7874: Rest API endpoint for economics data #2350

Merged
merged 6 commits into from
Oct 8, 2020

Conversation

bogdan-rosianu
Copy link
Contributor

Added a new endpoint /node/economics that will return the economics data for the last epoch. It is available for both meta nodes and shard nodes.

Note that the values are returned in string format and the denomination is included.

Example output:

{
  "data": {
    "metrics": {
      "erd_dev_rewards": "0",
      "erd_epoch_number": 2,
      "erd_inflation": "14030640106544902492",
      "erd_total_fees": "350000000000000",
      "erd_total_supply": "20000027511395306950789200"
    }
  },
  "error": "",
  "code": "successful"
}

Testing procedure:

  1. run a testnet with this branch and make sure that api.toml has this endpoint enabled
  2. open /node/economics endpoint (of type GET) on multiple nodes.
    2.1. in epoch 0, only the total supply value should be populated
    2.2. after passing in a new epoch, the values will update and should be the same for all the nodes.

@bogdan-rosianu bogdan-rosianu added the type:feature New feature or request label Oct 8, 2020
@bogdan-rosianu bogdan-rosianu self-assigned this Oct 8, 2020
@iulianpascalau iulianpascalau self-requested a review October 8, 2020 10:29
iulianpascalau
iulianpascalau previously approved these changes Oct 8, 2020
sasurobert
sasurobert previously approved these changes Oct 8, 2020
Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

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

System tests passed.

@LucianMincu LucianMincu merged commit ca4d321 into development Oct 8, 2020
@LucianMincu LucianMincu deleted the EN-7874-economics-metrics-api-endpoint branch October 8, 2020 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants