CryptoFly.us | CRYPTOCURRENCY BITCOIN SHIRTS CLOTHING APPAREL HATS

CRYPTO NEWS

Bitcoin all-time highs ‘just a matter of time’ after a BTC ETF approval looks certain

Bitcoin’s price spiked above $61,800 as the promise of a BTC ETF approval reignited the discussion on whether the top-ranked cryptocurrency will hit $100,000 by the end of the year.

How to calculate optimal gasPrice and gasLimit? [duplicate]

I am using rawTransactions and web3Instance.eth.sendSignedTransaction to deploy and interact with smart-contracts. The problem is that I can’t figure out hot to calculate optimal gasPrice & gasLimit, so the transactions get mined & approved asap. Currently I have these two functions: async function getGasPrice() { return web3Instance.eth.getGasPrice() .then((gasPrice) => { return gasPrice; }) .catch((err) =>::Listen

I am using rawTransactions and web3Instance.eth.sendSignedTransaction to deploy and interact with smart-contracts.

The problem is that I can’t figure out hot to calculate optimal gasPrice & gasLimit, so the transactions get mined & approved asap.

Currently I have these two functions:

async function getGasPrice() {     return web3Instance.eth.getGasPrice()         .then((gasPrice) => {             return gasPrice;         })         .catch((err) => {             console.log('getGasPrice-error', err);         }); } 
async function getGasLimit() {     return web3Instance.eth.getBlock('latest', false)         .then((result) => {             return result.gasLimit;         })         .catch((err) => {             console.log('getGasLimit-error', err);         }); } 

But when I try to deploy the contract it takes veeeeery long the transaction to get approved and mined. Then it shows Transaction was not mined within750 seconds error and gets deployed after undefined amount of time, which is not what we expect. :/

Any suggestions?

Bitcoin all-time highs ‘just a matter of time’ after a BTC ETF approval looks certain

Shopping cart
There are no products in the cart!
Continue shopping
0