我在 IBFT 上安装了带有 quorum-wizard 的 goQuorum,有 4 个仲裁节点和 4 个 tessera 节点。当我用“./start.sh”启动网络时,我得到
Starting Quorum network...
Waiting until all Tessera nodes are running...
Waiting until all Tessera nodes are running...
All Tessera nodes started
Starting Quorum nodes
Successfully started Quorum network.
--------------------------------------------------------------------------------
Tessera Node 1 public key:
BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo=
Tessera Node 2 public key:
QfeDAys9MPDs2XHExtc84jKGHxZg/aj52DTh0vtA3Xc=
Tessera Node 3 public key:
1iTZde/ndBHvzhcl7V68x44Vx7pl8nwx9LqnM/AfJUg=
Tessera Node 4 public key:
oNspPPgszVUFw0qmGFfWwh1uxVUXgvBxleXORHj07g8=
--------------------------------------------------------------------------------
当我运行“nmap -p 21000-21100”时,我得到
21000/tcp 打开 irtrans 21001/tcp 打开未知 21002/tcp 打开未知 21003/tcp 打开未知
这是我的 truffle-config.js
const HDWalletProvider = require("@truffle/hdwallet-provider");
const mnemonic = "not my real mn mon ic num phrase dum get l gg";
module.exports = {
networks: {
rinkeby: {
provider: function() {
return new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/v3/"+mnemonic);
},
network_id: '*',
timeoutBlocks: 100000,
networkCheckTimeout:2000000
},
quorum: {
provider: function() {
return new HDWalletProvider(mnemonic, "http://127.0.0.1:21000/", chainId=10);
},
network_id: '*',
type: 'quorum',
timeoutBlocks: 100000,
networkCheckTimeout:2000000
},
compilers: {
solc: {
version: "0.5.0",
settings: {
optimizer: {
enabled: true, // Default: false
runs: 1000 // Default: 200
},
evmVersion: "homestead" // Default: "byzantium"
}
}
}
};
当我使用 truffle-config.js 进入目录并运行 truffle deploy --reset --network quorum 来编译我的智能合约时,我收到以下错误。
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
/root/dapp1/Dapp/node_modules/web3-core-helpers/src/errors.js:42
return new Error(message);
^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: Invalid JSON RPC response: ""
at Object.InvalidResponse (/root/dapp1/Dapp/node_modules/web3-core-helpers/src/errors.js:42:16)
at XMLHttpRequest.request.onreadystatechange (/root/dapp1/Dapp/node_modules/web3-providers-http/src/index.js:92:32)
at XMLHttpRequestEventTarget.dispatchEvent (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpRequestError (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:379:8)
at ClientRequest.<anonymous> (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:266:37)
at ClientRequest.emit (events.js:315:20)
at Socket.socketOnEnd (_http_client.js:493:9)
at Socket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
at PollingBlockTracker._performSync (/root/dapp1/Dapp/node_modules/eth-block-tracker/src/polling.js:51:24)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
我可以在此环境中将智能合约部署到 rinkeby 测试网,但我无法将智能合约部署到法定人数
我正在使用
节点 v14.16.1
Ubuntu 18.04(64 位)
法定人数 21.1.0
Web3.js v1.3.5
Truffle v5.3.4(核心:5.3.4)
solidity v0.5.0
答案 0 :(得分:0)
我没有将 truffle 与 HDWalletProvider
一起使用,我相信它来自旧版本的 Truffle。我不确定是否会建立节点连接。
我们通常会在 quorum: {}
部分设置如下配置:
host: "localhost",
port: 22001,
type: "quorum"
我建议使用它,看看它是否有效。
查看有关使用法定人数的 truffle 文档:https://www.trufflesuite.com/docs/truffle/distributed-ledger-support/working-with-quorum
答案 1 :(得分:0)
您是否更改了仲裁向导中的默认端口?
节点 1 RPC 的默认值为 22000,21000 范围用于 p2p 网络。
我会根据上面 Satpal 的回答设置主机和端口,如 hdwallet 文档 here 中所述。