Skip to main content

Install events-into-rabbitmq plugin into headless wallet

Goal

This article will guide you to install the events-into-rabbitmq plugin into Hathor headless wallet.

The events-into-rabbitmq plugin is part of the external notification feature. To know more about this feature, see Hathor external notifications.

Requirement

Hathor headless wallet \ge v0.19.0

Step-by-step

  1. Install dependency.
  2. Configure and enable the plugin.

Step 1: install dependency

  1. Open the command line from the directory where you installed Hathor headless wallet.
  2. Run the command to install the dependencies:
npm install amqplib@^0.10.3

Step 2: configure and enable the plugin

If you installed Hathor headless wallet from source code, you must modify both the src/config.js file and the command to start the application, to respectively enable and configure the plugin:

  1. Open the command line from the directory where you installed Hathor headless wallet.
  2. Open the src/config.js file.
  3. Add 'rabbitmq' to the array of values of the enabled_plugins property to enable the plugin.

If you are enabling multiple plugins, value shall be an array of plugin ids: enabled_plugins: ['PluginId1', 'PluginId2', ...].

At the end of this substep, the config.js file will be as follows:

hathor-wallet-headless/src/config.js
module.exports = {

...

enabled_plugins: ['rabbitmq'],

plugin_config: {},

...

};
  1. Append the --plugin_rabbitmq_queue <queue_name> parameter into the command to start the wallet application, replacing the <queue_name> placeholder with the RabbitMQ queue name.

  2. Append the --plugin_rabbitmq_url <queue_url> parameter into the command to start the wallet application, replacing the <queue_url> placeholder with the RabbitMQ queue URL.

At the end of this substep, the command to start the wallet application will be as follows:

At the end of this step, the config.js file will be as follows:

npm start -- --plugin_rabbitmq_queue <queue_name> --plugin_rabbitmq_url <queue_url>

Task completed

You have installed the events-into-rabbitmq plugin in your instance of Hathor headless wallet.

The events-into-rabbitmq plugin is part of the external notification feature. To know how to use this plugin or install other plugins of this feature, see Hathor external notifications.