This plugin calls webhooks when a certain events occurs. You can use it to post alerts on Slack, Discord, send Emails/SMS or use whichever service that supports webhooks.
If you find this or other plugins useful please consider
- voting for
deadlock
delegate - donating to
AWtgFYbvtLDYccJvC5MChk4dpiUy2Krt2U
to support development new plugins and tools for Ark's Ecosystem and maintenance of existing ones. Full list of contributions can be found on https://arkdelegatesio/delegate/deadlock/. 🖖
yarn global add @deadlock-delegate/notifier
cd ~/ark-core/plugins
git clone https://github.com/deadlock-delegate/notifier
lerna bootstrap
Open ~/.config/ark-core/{mainnet|devnet|testnet}/plugins.js
and add the following at the end (it has to be bellow p2p and api).
'@deadlock/notifier': {}
like so:
module.exports = {
'@arkecosystem/core-event-emitter': {},
'@arkecosystem/core-config': {},
...
'@deadlock/notifier': {
enabled: true,
webhooks: [{
endpoint: 'https://discordapp.com/api/webhooks/612412465124612462/A1Ag12F&ijafa-3mtASA121mja',
payload: {
msg: 'content'
},
events: ['wallet.vote', 'wallet.unvote', 'forger.missing', 'forger.failed']
}, {
endpoint: 'https://hooks.slack.com/services/T1212ASDA/BAEWAS12/ASxASJL901ajkS',
payload: {
msg: 'text'
},
events: ['wallet.vote', 'wallet.unvote', 'forger.missing', 'forger.failed']
},
{
endpoint: 'https://api.pushover.net/',
payload: {
msg: 'message',
user: '<pushover user key>',
token: '<pushover token>'
},
events: ['forger.missing', 'forger.failed']
}]
}
}
{
enabled: true, // true/false if you want to enable/disable the plugin
webhooks: [{
endpoint: 'webhook endpoint url',
payload: {
msg: 'name of the message field eg. discord has "content", slack has "text"'
},
events: ['list of events you want to subscribe to']
}]
}
Handlers for unticked events haven't been implemented yet. Feel free to make a contribution.
- wallet.vote
- wallet.unvote
- forger.missing - when a delegate fails to forge in a round (could be any delegate)
- forger.failed - if your forger process fails to forge (only works if a plugin is running on a node with a forging process running)
- forger.started - when your forging process starts
- block.applied
- block.forged - when your forging process forges a new block
- block.reverted
- delegate.registered
- delegate.resigned
- peer.added
- peer.removed
- transaction.applied
- transaction.expired
- transaction.forged
- transaction.reverted
MIT © roks0n