Example Staking Pool Service

If you’re excited about collaborating on the first example staking pool service, then here are some pointers to get you started! There is API infrastructure available to make example staking pool services possible. We encourage you to work with your fellow community members to build a staking pool on Coda! High quality contributions on the open-source repo can earn up to 3000 testnet points* in Testnet Release 3.1.
For credit, please share your project below in this forum thread. Submissions can be one of a code contribution, documentation, help, screenshots, etc.

Tips:

What’s in a staking service?

  1. should print a list of who is delegating to you
  2. Automatically pay out percent of block rewards to each delegator proportional to how much they’ve delegated on a configurable schedule, with a configurable fee %

Useful APIs:

  • accounts in the GraphQL API have a
    • delegators field (for the current epoch being staked in)
    • lastEpochDelegators field (for the last epoch)
  • using those you can get the information to decide the transactions to send back to whoever is delegating to you

Tip: if you have tried out the staking pool API, we’d love to hear your feedback about it. Thoughtful feedback will be awarded with testnet points* as well! (See the description of challenge #8 here). Share your feedback here.

3 Likes

Delegation is really interesting, more documentation about how it works in CODA would be really good to have. Also, if someone is running a node with a SNARK worker, it would be good to have a notice that self-delegation is automatically/manually assigned.

When I try querying with the field ‘delegators’, it appears that that field doesn’t exist.


I’m not sure my syntax is correct though.

Yeah I was working on this too but I think they’ve had to roll back some necessary parts of the API while trying to right the ship. When the new version comes out I assume it will be fixed, if not it should be fixed soon after.