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).
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
docker-compose up send-transactions-worker
NOTES: This step could be skipped if it already ran.
npm i
npm run build
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
npm run send-transactions-worker | bunyan
npm run send-transactions-worker:dev | bunyan
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 |