Skip to main content

Install events-into-amazon-sqs plugin into headless wallet

Goal

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

The events-into-amazon-sqs 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 dependency:
npm install aws-sdk@^8.11.0

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 'sqs' 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: ['sqs'],

plugin_config: {},

...

};
  1. Append the --plugin_sqs_region <aws_region> parameter into the command to start the wallet application, replacing the <aws_region> placeholder with the AWS region code of the Amazon SQS.

  2. Append the --plugin_sqs_queue_url <queue_url> parameter into the command to start the wallet application, replacing the <queue_url> placeholder with the URL of the Amazon SQS queue.

  3. (Optional) When developing, you may want to run a local queue. In this case, do this substep to point the aws-sdk to a local instance. Append the --plugin_sqs_endpoint_url <endpoint_url> parameter, replacing the <endpoint_url> placeholder with the endpoint of your local queue instance.

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

npm start -- --plugin_sqs_region <aws_region> --plugin_sqs_queue_url <queue_url>

Task completed

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

The events-into-amazon-sqs 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.