So I am building a service that will be creating high amount of transactions on different substrate base chains.
The infrastructure I have in mind is having microservices that will generate transactions depending on the chain and different outcomes. Then the constructed transaction parameters are sent to another microservice that selects the key and signs the transaction. The signed transaction is saved into the database and a cron job picks it up and sends it to the node. While another worker is checking and updating the transaction status in the database.
Why I have this is mind is so that I can have a secure way of signing the transaction. Then since a node can be unresponsive or dynamically chosen based on the chain we are transmitting to I have a separate worker that just makes sure the transactions are transmitted to the network in the correct sequence. And finally a service that monitors transactions and their statuses.
Now almost all examples I found do all this 3 things at the same time using signAndSend method and waiting for response.
I found this: https://wiki.polkadot.network/docs/build-transaction-construction for creating each step individually.
But from researching further I found out that
transactionHash is not unique like with EVM chains to monitor the transaction through that.
Now my main questions are:
- Is the infrastructure I have in mind appropriate= It works very well for EVM based chains but is there is a different/better way to do things for substrate based transactions?
- How to uniquely identify and monitor transactions? And can you get the unique key before actually sending the transaction to the chain?