In ethers.js you can log JSON-RPC calls like this:

  ethers.provider.on("debug", (info) => {
    if (info.request) {
      console.log("Request:", info.request);
    if (info.response) {
      console.log("Response:", info.response);

Is there any similar code for web3.js?

1 Answer 1


Use something like Alchemy here to create scripts which link to your desired chain and allow you to debug all sorts of RPC calls, from logs, via web3's eth_getLogs, to token datas via alchemy's alchemy_getTokenMetadata.

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.