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

Adding additional GRPC endpoints for block explorer #1922

Merged

Conversation

Krakaw
Copy link
Contributor

@Krakaw Krakaw commented May 27, 2020

Description

The following endpoints have been added to the GRPC service based on the core requirements.

  • GetConstants
  • GetBlockSize
  • GetBlockFees
  • GetVersion
  • GetTokensInCirculation
  • GetNetworkDifficulty

I've used the standard local LocalNodeCommsInterface to extract all of the data used in these responses, it will probably be faster to use an instance of async_db and even faster once the postgres_backend branch is in to build more of these metrics directly into the db.

I wanted to get this up in the mean time, but GetBlockSize and GetBlockFees still need to have their quartile and quantile implementations created which is why their response type is an array of double.

Motivation and Context

We required more stats from the base node for the block explorer.

How Has This Been Tested?

cargo test

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Feature refactor (No new feature or functional changes, but performance or technical debt improvements)
  • New Tests
  • Documentation

Checklist:

  • I'm merging against the development branch.
  • I ran cargo-fmt --all before pushing.
  • I have squashed my commits into a single commit.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

Added constants grpc endpoint

Added block size grpc call

Added block fee endpoint

Added version response

Added GetTokensInCirculation RPC call

Added network difficulty

Added estimated hashrate to difficulty response

Return array of values for size and fee

Some cleanup
@Krakaw Krakaw force-pushed the krakaw-additional-base-stats branch from 7e4b573 to e629046 Compare May 27, 2020 13:43
Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

LGTM

@sdbondi sdbondi merged commit ee06f9e into tari-project:development May 28, 2020
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.

2 participants