如何在 rinkeby 测试 rpc

问题描述

我正在尝试为部署在 rinkeby 测试网络中的合约编写一个子图。

为此,我需要在同一个 rinkeby 测试网络中运行图形节点。

参考下面的repo

https://github.com/graphprotocol/graph-node

我使用下面的cargo命令在我的本地机器上运行它

cargo run -p graph-node --release --  --postgres-url postgresql://postgres:postgres@localhost:5432/graph-node  --ethereum-rpc 'rinkeby:https://rinkeby.infura.io/v3/2a46ac7cdb4c44acac4de87dadfd6e39'  --ipfs 127.0.0.1:5001

我使用 infura.io 来获取 rinkeby rpc url。

但它会抛出错误 401 Unauthorized。我不知道我在哪里犯了错误

enter image description here

我无法连接 rinkeby 网络。

请帮助我解决问题。

提前致谢。

解决方法

您的 Infura 端点似乎未正确设置,请检查您的项目 ID 和您在帐户中设置的权限,可以在此处或通过您的 Infura 登录找到一些示例:https://infura.io/docs/gettingStarted/chooseaNetwork

,

我在命令中犯了一个大错。

删除 rpc url 中的单引号可解决问题

cargo run -p graph-node --release -- --postgres-url postgresql://postgres:postgres@localhost:5432/graph-node --ethereum-rpc rinkeby:https://rinkeby.infura.io/v3/2a46ac7cdb4c44acac4de87dadfd6e39 --ipfs 127.0.0.1:5001

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...