Until now, I used rinkeby test network, where things are a lot faster, i discovered.
I was doing this
const receipt = await web3.eth.sendSignedTransaction(signed_tx.rawTransaction);
console.log(receipt.transactionHash);
console.log(receipt.gasUsed);
So I can send signed transaction, ans simply wait to get the tx hash.
I tried on main net and, to keep gas cost lower, it takes also 15 minutes per transaction to be mined.
My caller script goes in timeout a lot earlier than 15 minutes.
Is there a way to simply 'fire' the sending but obtaining the transactionHash anyway without keep listening for a long time?
Have you other strategies to suggest me?
I recently discovered contract events. So i'm firing an event when the called function ends. But is this a good way to fight this problem?
Web3Js version is set as: "web3": "^1.2.6",