record io

This commit is contained in:
Dmitry Vasilev
2023-02-06 01:53:34 +08:00
parent 4410d4135a
commit be4d104dc6
16 changed files with 25216 additions and 35 deletions

View File

@@ -3,12 +3,29 @@ import {ethers} from 'https://unpkg.com/ethers/dist/ethers.esm.js'
const URL = 'https://ethereum-goerli-rpc.allthatnode.com'
const p = ethers.getDefaultProvider(URL)
await p._networkPromise
const latest = await p.getBlock()
latest
const txs = await Promise.all(latest.transactions.map(t =>
p.getTransactionReceipt(t)
))
const totalGas = txs.reduce((gas,tx) =>
gas.add(tx.gasUsed), ethers.BigNumber.from(0))
totalGas.add(25)