Skip to content

Plugin that allows you to subscribe and be notified about any events

License

Notifications You must be signed in to change notification settings

c0nsol3/notifier

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ark Notifier Plugin

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.

❤️ Support maintenance and development of plugins

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/. 🖖

Installation

For production:

yarn global add @deadlock-delegate/notifier

For development:

cd ~/ark-core/plugins
git clone https://github.com/deadlock-delegate/notifier
lerna bootstrap

Registration

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']
    }]
  }
}

Configuration

{
  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']
  }]
}

Events you can 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

Credits

License

MIT © roks0n

About

Plugin that allows you to subscribe and be notified about any events

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%