Skip to content

Add endpoint to return the network weight for POS chains#377

Merged
dangershony merged 4 commits intomasterfrom
add-pos-net-weight
Jan 21, 2022
Merged

Add endpoint to return the network weight for POS chains#377
dangershony merged 4 commits intomasterfrom
add-pos-net-weight

Conversation

@dangershony
Copy link
Copy Markdown
Member

Endpoints to get the POS network difficulty to be used with the indexer for this issue
block-core/blockcore-indexer#56

There are two approaches this can go:

  • the approach of this PR where we have an additional endpoint for the POS difficulty and the current network weight.
  • adding the network weight and difficulty to each block on the api method GetBlock (then on the explorer we can display the network weight on each block)

(note the difficulty on POS is calculated slightly differently when it comes to calculating the network weight)

Copy link
Copy Markdown
Member

@sondreb sondreb left a comment

Choose a reason for hiding this comment

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

Good work! At minimum the error message must be fixed.

Comment thread src/Blockcore/Interfaces/INetworkWeight.cs
Comment thread src/Features/Blockcore.Features.Miner/Api/Controllers/StakingController.cs Outdated
@dangershony
Copy link
Copy Markdown
Member Author

I will wait for tests then push

@dangershony
Copy link
Copy Markdown
Member Author

All tests passed now

@dangershony dangershony merged commit d4e38ee into master Jan 21, 2022
@dangershony dangershony deleted the add-pos-net-weight branch January 21, 2022 20:45
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