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

API: Add participation key generation endpoint to algod API #5781

Merged
merged 20 commits into from
Oct 17, 2023

Conversation

winder
Copy link
Contributor

@winder winder commented Oct 12, 2023

Summary

Implementation for #5578.

New endpoint for the admin API to generate and install participation keys.

POST /v2/participation/generate/{address}

The participation keys are generated in the background and installed when generation is complete. With this PR there is no progress reporting. Programs should poll the GET /v2/participation endpoint and look for the new key to appear. Once the new key is installed a key registration transaction can be made.

Test Plan

New unit tests.

@winder winder requested review from cce, jannotti and gmalouf October 12, 2023 15:49
@winder winder self-assigned this Oct 12, 2023
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #5781 (ecc16b0) into master (d3df476) will increase coverage by 0.00%.
The diff coverage is 38.27%.

@@           Coverage Diff           @@
##           master    #5781   +/-   ##
=======================================
  Coverage   55.53%   55.53%           
=======================================
  Files         473      474    +1     
  Lines       66815    66851   +36     
=======================================
+ Hits        37105    37127   +22     
- Misses      27192    27199    +7     
- Partials     2518     2525    +7     
Files Coverage Δ
daemon/algod/api/server/v2/test/helpers.go 77.15% <100.00%> (+0.11%) ⬆️
data/account/participation.go 63.97% <100.00%> (+0.53%) ⬆️
cmd/goal/account.go 13.61% <0.00%> (-0.06%) ⬇️
daemon/algod/api/server/router.go 16.00% <0.00%> (-0.33%) ⬇️
libgoal/participation.go 0.00% <0.00%> (ø)
libgoal/participation/participation.go 66.66% <66.66%> (ø)
daemon/algod/api/server/v2/handlers.go 0.77% <0.00%> (-0.02%) ⬇️

... and 12 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@winder winder marked this pull request as ready for review October 13, 2023 12:42
Copy link
Contributor

@jannotti jannotti left a comment

Choose a reason for hiding this comment

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

I had some comments that I forgot to submit. I think I still have more to look at and understand though.

daemon/algod/api/server/v2/handlers.go Outdated Show resolved Hide resolved
data/account/participation.go Show resolved Hide resolved
daemon/algod/api/algod.oas2.json Outdated Show resolved Hide resolved
daemon/algod/api/algod.oas2.json Outdated Show resolved Hide resolved
daemon/algod/api/algod.oas2.json Show resolved Hide resolved
daemon/algod/api/server/v2/handlers.go Outdated Show resolved Hide resolved
daemon/algod/api/server/v2/handlers.go Outdated Show resolved Hide resolved
daemon/algod/api/server/v2/handlers.go Outdated Show resolved Hide resolved
@winder winder requested a review from jasonpaulos October 17, 2023 13:56
Copy link
Contributor

@jannotti jannotti left a comment

Choose a reason for hiding this comment

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

I left some very small nits, but approving. If you want to change them, I'll reapprove immediately. Up to you.

daemon/algod/api/server/v2/handlers.go Show resolved Hide resolved
daemon/algod/api/server/v2/handlers.go Show resolved Hide resolved
Copy link
Contributor

@ohill ohill left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants