我知道ethers.js是web3js的替代品。
我使用过web3js和ethers.js以及仲裁。以前有人使用过ether.js和仲裁吗?
发布于 2018-06-15 11:01:05
还没试过法定人数。我正在使用它与围棋集团,这是权威的实现的证据,埃瑟姆(专用网络)。
快速查看一下就会发现,它们有一个稍微修改过的web3 api (web3j-qu仲裁和https://github.com/jpmorganchase/quorum/blob/master/docs/api.md )。
当然,ethersjs或标准web3不适用于仲裁提供的额外功能,如星座。
您仍然可以将ethersjs客户端连接到节点上的JSON-RPC,以发送正常事务。
const ethers = require('ethers')
const Providers = ethers.providers
const node1= "http://127.0.0.1:8501"
const node2= "http://127.0.0.1:8502"
const provider1 = new Providers.JsonRpcProvider(node1, 'clique')
const provider2 = new Providers.JsonRpcProvider(node2, 'clique')
const fallbackProvider = new Providers.FallbackProvider([provider1, provider2])这将设置到一个节点的RPC连接,并返回到另一个节点。然后您可以通过其中一种方法启动钱包,并将fallbackProvider绑定到wallet.provider。
不过,我确实在源代码中将我的网络添加到了networks.json中。ethers>providers>networks.json
"clique": {
"chainId": 999,
"name": "clique"
}https://ethereum.stackexchange.com/questions/50533
复制相似问题