Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Latest commit

 

History

History
64 lines (43 loc) · 2.17 KB

File metadata and controls

64 lines (43 loc) · 2.17 KB

SEND TRANSACTION WORKER

ABOUT

This worker will build a queue based on the routing key and type of message exchange to consume the message sent from Send Transactions controller.

After consuming the message, sign the transactions (using the vault key mentioned in the message) and send the transactions to Tezos block chain. Then it updates the corresponding job status to PUBLISHED and updates the operation hash (which is retrieved after sending the transactions).

Before running

Check if postgres database, rabbitMq and vault server are running. If not, you could start the services by using docker-compose.

docker-compose up -d postgres rabbitmq vault

Run with docker

docker-compose up send-transactions-worker

Run locally

Install dependencies and build the project

NOTES: This step could be skipped if it already ran.

npm i
npm run build

Install bunyan and nodemon

NOTES: This is optional. Bunyan helps to format the logs, so it is easier to read and nodemon helps auto recompile the code while you are in dev mode.

npm i -g bunyan nodemon

Run the project

npm run send-transactions-worker | bunyan

Run in dev mode

npm run send-transactions-worker:dev | bunyan

ENVIRONMENT VARIABLES

Name Default Value Explanation
AMQP_URL amqp://localhost The URL to link to the RabbitMQ server
AMQP_QUEUES send-transaction The name of the queues that can be used
LOGGER_NAME Send Transactions Worker The name of the logger
LOGGER_LEVEL info The level of the logger
SEND_TRANSACTION_WORKER_NAME Send Transactions Worker The name of the process
SEND_TRANSACTION_WORKER_TIMEOUT 3000 The process timeout in milliseconds