Fastest way to emit a transaction on BSC node

714 views Asked by At

I have a node setup running on bsc network. I need to create a transaction in a specific point and it has to be very fast because it's very time-sensitive.

  • I used sendTransaction function like below:

wallet.sendTransaction({to: to, value: value, data: data, gasPrice: gasPrice, gasLimit: gasLimit, })

  • I tried to call contract function as well.

But transactions succeed only one or two times in 10 tries.

Can anyone help this? Is there any fastest way to create a transaction rather than what I've used?

Thanks.

wallet.sendTransaction({to: to, value: value, data: data, gasPrice: gasPrice, gasLimit: gasLimit, })

contract.function_name(..., {value, gasPrice, gasLimit})

1

There are 1 answers

2
Xavier Hamel On

The exact method you use to send the transaction should not have a perceptible effet on the ordering of the transaction. The timing difference caused by an unoptimal function delay is relatively small relatively to the time between block. (Even on fast chains like BSC).

The hard truth is that the best way to increase the speed of your transaction is likely to increase your gas price.

Keep in mind that it is very hard to predict where exactly a transaction will end up since the validators are the ones that decide what transaction to include and their order. They might be incentivised to include the transactions with the higgest gas price in order to maximise the limited space in their block, but they can still manipulate the ordering to their advantage.

Here are other solutions you might want to explore:

  1. Reduce the time between you and the validator nodes. (Internet connexion but also chose the connexions of your node)

  2. Optimise the logic that triggers the call.