1.0.2 • Published 8 years ago
earn v1.0.2
earn
Middleware for paying rewards to validator nodes (used with lotion and coins).
Usage
npm install earn
let earn = require('earn')
let lotion = require('lotion')
let coins = require('coins')
let app = lotion({ ... })
app.use(coins({
handlers: {
earn({ perValidatorPerBlock: 100 })
}
}))Use by including as a handler inside your coins options.
perValidatorPerBlock specifies the amount of coins each validator will earn per block.
The validators will all be paid equally each block, using their pubkey (both secp256k1 and ed25519 keys are supported). In the future, it can be possible to only pay validators who have a precommit signature in the block, but this is non-trivial since there might be some game theoretical attacks between validators (e.g. censoring others to prevent their rewards).