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

Feature: Add Params API #153

Closed
2 of 25 tasks
ghost opened this issue Jun 25, 2021 · 0 comments · Fixed by #161
Closed
2 of 25 tasks

Feature: Add Params API #153

ghost opened this issue Jun 25, 2021 · 0 comments · Fixed by #161
Assignees
Labels
api Adding/updating an API enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@ghost
Copy link

ghost commented Jun 25, 2021

Summary

Some chain modules have params attached to them. It would be nice to have them displayed.

Problem Definition

Modules like governance, staking, and slashing all have params that are used within chain calcs. Create an API that pulls those params and formats them for FE usage.
Example: https://regen.aneka.io/params

Proposal

  • Add gRPC clients for missing query sets
  • Add mapping from param to description
    • Possibly pass this off to FE to handle there instead
  • Add function to ExplorerService that pulls params from the following modules
    • cosmos
      • auth
      • bank
      • distribution
      • gov
      • mint
      • slashing
      • staking
      • ibc
        • application/transfer
        • client
    • provenance
      • attribute
      • marker
      • metadata
      • name
  • Add to GeneralController to return list of params by type
    • /api/v2/params

Example response:

{
      "mint":{
        "mint_denom":"nhash",
        "inflation_rate_change":"0.130000000000000000",
        "inflation_max":"0.200000000000000000",
        "inflation_min":"0.070000000000000000",
        "goal_bonded":"0.670000000000000000",
        "blocks_per_year":"4360000"
      },
      "slashing":{
        "signed_blocks_window":"10000",
        "min_signed_per_window":"0.050000000000000000",
        "downtime_jail_duration":"600000000000",
        "slash_fraction_double_sign":"0.050000000000000000",
        "slash_fraction_downtime":"0.000100000000000000"
      },
      "staking":{
        "unbonding_time":"1814400000000000",
        "max_validators":50,
        "max_entries":7,
        "historical_entries":10000,
        "bond_denom":"nhash"
      },
      "gov":{
        "deposit":{
          "min_deposit":[
            {
              "denom":"nhash",
              "amount":"200000000"
            }
          ],
          "max_deposit_period":"1209600000000000"
        },
        "voting":{
          "voting_period":"1209600000000000"
        },
        "tallying":{
          "quorum":"0.400000000000000000",
          "threshold":"0.500000000000000000",
          "veto_threshold":"0.334000000000000000"
        }
      }
}

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ghost ghost added enhancement New feature or request good first issue Good for newcomers api Adding/updating an API labels Jun 25, 2021
@ghost ghost added this to the v2.1.0 milestone Jun 25, 2021
@fkneeland-figure fkneeland-figure self-assigned this Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Adding/updating an API enhancement New feature or request good first issue Good for newcomers
Projects
Status: Release v2.1.0
Development

Successfully merging a pull request may close this issue.

1 participant