This worker will consume the messages from the Injection Queue, which contains the messages sent from Injection controller.
After consuming the message, pre-apply the transactions and inject the transactions to Tezos block chain. Then it updates the corresponding job status to PUBLISHED and updates the operation hash (which is retrieved after injecting 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 injection-worker
NOTES: This step could be skipped if it already ran.
npm i
npm run build
NOTES: This is optional. Bunyan helps formatting 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 injection-worker | bunyan
npm run injection-worker:dev | bunyan
Name | Default Value | Explanation |
---|---|---|
AMQP_URL | amqp://localhost | The URL to link to the RabbitMQ server |
AMQP_QUEUES | inject-transaction | The name of the queues that can be used |
LOGGER_NAME | Injection Worker | The name of the logger |
LOGGER_LEVEL | info | The level of the logger |
INJECTION_WORKER_NAME | Injection Worker | The name of the process |
INJECTION_WORKER_TIMEOUT | 3000 | The process timeout in milliseconds |