【发布时间】:2021-10-29 02:51:02
【问题描述】:
我在本地环境中安装了 Geth,并成功与 ETH 主网同步。我用来启动Geth的命令如下:
geth --ethash.dagdir F:\Ethereum\Ethash --datadir F:\Ethereum --http --graphql --http --http.corsdomain "*" --http.api personal,eth,net,web3
但是,当我尝试使用 ethers 提供程序连接到这个本地以太坊节点时:
let provider = new ethers.providers.JsonRpcProvider();
然后尝试使用此提供程序通过 Uniswap SDK 获取配对信息:
var pair = await uniswap.Fetcher.fetchPairData(tokens.WETH, tokens.DAI, provider);
显示以下错误消息:
(node:32252) UnhandledPromiseRejectionWarning: Error: call revert exception (method="getReserves()", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.4.0)
有人可以帮忙告知这是否与 Geth Ethereum 节点的错误设置有关,还是与使用 uniswap SDK 不正确地使用 ethers 本地 ETH 节点提供程序有关(当我使用 Infura 端点时,上面的工作非常好) ?
【问题讨论】:
标签: node.js blockchain ethereum geth ethers.js