Last active
July 17, 2023 13:04
-
-
Save nflaig/ea5b1b3f0413cd36e4391cad110ec177 to your computer and use it in GitHub Desktop.
Call eth_estimateGas on different ELs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require("ethers"); // v5.0.3 | |
(async () => { | |
[ | |
{ client: "Nethermind", url: "" }, | |
{ client: "Besu", url: "" }, | |
{ client: "Geth", url: "" }, | |
].forEach(({ client, url }) => estimateGas(client, url)); | |
})(); | |
async function estimateGas(client, url) { | |
const provider = new ethers.providers.JsonRpcProvider(url); | |
const estimate = await provider.estimateGas({ | |
from: "0x9d055dd23de15114ec95921208c741873ede8558", | |
to: "0xe74bc1c4c27284ab7dbcf55f71fcc04b832fc32c", | |
data: "0x73053410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000342f697066732f516d61624763754354786a57637a6b766f323977616d69355057435372514435656e744c62717a7a55486b79566f000000000000000000000000", | |
}); | |
console.log(`${client}: ${estimate.toString()}`); | |
} |
I am not that familiar with Nethermind itself but I am guessing you should be able to use the CLI as well. Make sure you install ethers v5.0.3, I have not tested the script with other versions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm running Nethermind locally (http://localhost:8545) but I'm getting the following error:
Instead of using this script, could I use the
Nethermind.Cli
like this?