Closed DenisCarriere closed 4 days ago
const { ethers, JsonRpcProvider } = require("ethers");
const provider = new JsonRpcProvider("https://api.testnet.evm.eosnetwork.com/");
async function checkTransactionReceipt(txHash) {
const receipt = await provider.getTransactionReceipt(txHash);
console.log("Transaction Receipt:", receipt);
if (receipt) {
console.log("Transaction Receipt Found:", receipt);
console.log("Logs:", receipt.logs.length);
receipt.logs.forEach((log) => {
console.log("Log Address:", log.address);
});
} else {
console.log("Transaction is still pending or does not exist.");
}
}
checkTransactionReceipt(
"0x6e063e1fedf16d61488a3026d0abc16edd62b33b523d9ee84612ee2d317e80da"
);
I make script and use official node from documentation EOS EVM https://docs.eosnetwork.com/evm/quick-start/endpoints
Here is a test function to retrieve Logs from a block range, this returns an empty []
Array
const { JsonRpcProvider } = require("ethers");
const provider = new JsonRpcProvider("https://api.testnet.evm.eosnetwork.com/");
async function checkLogs(fromBlock, toBlock) {
const logs = await provider.getLogs({ fromBlock, toBlock });
console.log(`Block range ${fromBlock}-${toBlock}`);
console.log("Logs:", logs.length);
logs.forEach((log) => {
console.log("Log Address:", log.address);
});
}
checkLogs(47502143, 47502144);
// Block range 47502143-47502144
// Logs: 0
https://www.quicknode.com/docs/ethereum/eth_getLogs
/**
* A **Filter** allows searching a specific range of blocks for mathcing
* logs.
*/
export interface Filter extends EventFilter {
/**
* The start block for the filter (inclusive).
*/
fromBlock?: BlockTag;
/**
* The end block for the filter (inclusive).
*/
toBlock?: BlockTag;
}
/**
* A **FilterByBlockHash** allows searching a specific block for mathcing
* logs.
*/
export interface FilterByBlockHash extends EventFilter {
/**
* The blockhash of the specific block for the filter.
*/
blockHash?: string;
}
Seems like the
eth_getLogs
does not return any resultsTest RPC request
Feedback from @elmato
Note:
eth_getTransactionReceipt
does return logs