0

How can I calculate the deployment time and completion time of a smart contract transaction using web3.js?

3
  • Could you explain why do you want to estimate the completion time? It is not deterministic? May there is another way to achieve it such as events.
    – logeekal
    Commented May 22, 2019 at 10:10
  • I wanted to do a comparative analysis of public blockchain platforms. So, I need to do the performance analysis of a blockchain platform. Blockchain researches in their published research work have used completion time of a set of transactions as one of the performance metric.
    – Monika
    Commented May 22, 2019 at 11:04
  • Thank you for suggesting events. I will look into this.
    – Monika
    Commented May 22, 2019 at 13:15

1 Answer 1

1

You cannot calculate the time, which the transaction will need to be mined and stored in a block. Each 15 second (main net) a new block is generated and it is up to the miners (how much fees you are willing to give) to include your transaction in that block or in one of the next comming blocks.

4
  • But researcher in their research papers have calculated the execution time of a transaction from its deployment time and completion time.Just they have not explained the commands or procedure to calculate it.
    – Monika
    Commented May 22, 2019 at 10:59
  • Transaction execution time is small but blockchain has various other steps before transaction gets executed. you need to bid the price(gas in Ethereum) you can pay for your transaction, the higher the price, faster it will be picked up by the miner. Then There are a multitude of steps before you transaction is added to blockchain biggest of which is consensus. I would highly recommend you first study the basics of blockchain and then your journey will be much easier.
    – logeekal
    Commented May 22, 2019 at 11:06
  • Thank you but actually I know all of these things about blockchain. My concern was there three research papers, out of which one is published in IEEE transaction and other two are also published in reputed conferences, and they have used execution time as a performance metric for comparing blockchain platforms. So I just wanted to know the web3.js commands to calculate it.
    – Monika
    Commented May 22, 2019 at 13:08
  • Check this out to see if it helps. There is not native web3 api to do this. I am not really sure how are they doing it. ethgasstation.info/calculatorTxV.php Also, check this out. ethereum.stackexchange.com/questions/54454/…
    – logeekal
    Commented May 22, 2019 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.