Install events-into-stdout plugin into headless wallet
Goal
This article will guide you to install the events-into-stdout plugin into Hathor headless wallet.
The events-into-stdout plugin is part of the external notification feature. For more on this feature, see Hathor external notifications.
Requirement
Hathor headless wallet v0.19.0
Step-by-step
- Configure and enable the plugin.
Step 1: configure and enable the plugin
- Source code
- Docker container
- Docker compose
If you installed Hathor headless wallet from source code, you must append the src/config.js file and the command to start the application, to respectively enable and configure the plugin:
- Open the command line from the directory where you installed Hathor headless wallet.
- Open the src/config.jsfile.
- Add 'debug'to the array of values of theenabled_pluginsproperty 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:
module.exports = {
  ...
  enabled_plugins: ['debug'],
  plugin_config: {},
  ...
};
Note that some of the messages may be longer than 1000 characters. Such long messages make stdout non-human readable, defeating thus the debugging purpose of the plugin.
- (Optional) Choose one of the following behaviors for the plugin to handle the long messages:
- Default behavior: cut long messages to avoid the problem.
- all: log completed long messages.
- off: completely turn off the log of long messages.
If, in the previous substep, you chose to leave the default behavior, you may start the wallet application with the usual command.
- (Optional) On the other hand, if in the previous substep you chose to alter the plugin default behavior, you must append the --plugin_debug_long <all_or_off>parameter to the command to start the wallet application, replacing the<all_or_off>placeholder with your chosen value:
npm start -- --plugin_debug_long <all_or_off>
If you installed Hathor headless wallet as a Docker container, you must add parameters to the docker run command to enable and configure the plugin:
- Append --enabled_plugins='debug'to thedocker runcommand.
If you are enabling multiple plugins, parameter value shall be an array of plugin ids: --enabled_plugins='PluginId1 PluginId2 ...'.
Note that some of the messages may be longer than 1000 characters. Such long messages make stdout non-human readable, defeating thus the debugging purpose of the plugin.
- (Optional) Choose one of the following behaviors for the plugin to handle the long messages:
- Default behavior: cut long messages to avoid the problem.
- all: log completed long messages.
- off: completely turn off the log of long messages.
- (Optional) If you want a behavior different from the default, append the --plugin_debug_long <all_or_off>parameter, replacing the<all_or_off>placeholder with the chosen value of the previous substep. To maintain the default behavior, do not append the--plugin_debug_longparameter.
At the end of this step, the docker run command will be as follows:
docker run \
  -it -p 8000:8000 \
  hathornetwork/hathor-wallet-headless \
  --seed_default '<24_words_seed_phrase_string>' \
  --network mainnet \
  --server https://node2.mainnet.hathor.network/v1a/ \
  --enabled_plugins=debug \
  --plugin_debug_long='<all_or_off>'
If you installed Hathor headless wallet along Hathor full node with Docker compose, you must add new lines to the docker-compose.yml file to enable and configure the plugin:
- Open the command line from the directory where you installed Hathor headless wallet.
- Open the docker-compose.ymlfile.
- At the end of the list of items within environment, fromhathor-wallet-headless, add the key/value pairHEADLESS_ENABLED_PLUGINS=debug.
If you are enabling multiple plugins, value shall be an array of plugin ids: HEADLESS_ENABLED_PLUGINS=PluginId1 PluginId2.
Note that some of the messages may be longer than 1000 characters. Such long messages make stdout non-human readable, defeating thus the debugging purpose of the plugin.
- (Optional) Choose one of the following behaviors for the plugin to handle the long messages:
- Default behavior: cut long messages to avoid the problem.
- all: log completed long messages.
- off: completely turn off the log of long messages.
- (Optional) If you want a behavior different from the default, add the key/value pair HEADLESS_PLUGIN_DEBUG_LONG=<all_or_off>(belowHEADLESS_ENABLED_PLUGINS=debug), replacing the<all_or_off>placeholder with your option in the previous substep. To maintain the default behavior, do not add this item.
At the end of this step, the docker-compose.yml file will be as follows:
hathor-core:
  ...
hathor-wallet-headless:
  ...
  environment:
    - HEADLESS_SEED_DEFAULT=<24_words_seed_phrase_string>
    - HEADLESS_NETWORK=testnet
    - HEADLESS_SERVER=http://hathor-core:8080/v1a/
    - HEADLESS_ENABLED_PLUGINS=debug
# with or without:
#     - HEADLESS_PLUGIN_DEBUG_LONG=all
# or: - HEADLESS_PLUGIN_DEBUG_LONG=off
Task completed
You have installed the events-into-stdout plugin in your instance of Hathor headless wallet.
The events-into-stdout plugin is part of the external notification feature. For how to use this plugin or install other plugins of this feature, see Hathor external notifications.