【发布时间】:2021-11-28 17:50:23
【问题描述】:
当 ganache 调用 eth_getTransactionByHash 时,我收到此错误 - “UnhandledPromiseRejectionWarning:错误:基于 EIP155 的 V 1 和链 id 1 不兼容。请参阅事务构造函数的第二个参数来设置链 id。”其他 web3 调用工作正常。这就是我调用 web3 函数来获取交易的方式
web3.eth.getTransaction('<txn-hash>')
.then(result => {
console.log('result: ', result);
}).catch(err => {
console.log('error: ', err);
})
这就是我运行 ganache 的方式
ganache-cli --fork https://mainnet.infura.io/v3/<project-id>
我见过其他人有这个问题,这是一个 ganache 问题,但没有一个解决方案对我有用,我也没有看到 eth_getTransactionByHash。我试过传递一个链 ID,但它也没有做任何事情。谢谢!
【问题讨论】:
标签: node.js blockchain ethereum web3js ganache