首页 > 解决方案 > 尝试使用松露将智能合约部署到我的区块链时不断出错

问题描述

我有一组我已经编译并部署到 rinkeby 测试网络的智能合约。我现在需要将其部署到在 IBFT 共识上运行的私有 goquorum 区块链。区块链是使用 quorum-wizard 构建的。它在我运行 ./start.sh 时开始

当我在我的松露项目的根目录中时,我运行 sudo truffle deploy --reset --network quorum 我收到以下错误。

> 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)

这是我的 truffle-config.js

const HDWalletProvider = require("@truffle/hdwallet-provider");
const mnemonic = "not my real mn emon ic words this is pl cfff was";

module.exports = {
  networks: {
  rinkeby: {
    provider: function() {
      return new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/v3/2342342342344345344343434");
    },
    network_id: '*',
    timeoutBlocks: 100000,
    networkCheckTimeout:2000000
  },
// https://www.trufflesuite.com/docs/truffle/distributed-ledger-support/working-with-quorum
   quorum: {
    provider: function() {
      return new HDWalletProvider(mnemonic, "http://127.0.0.1:21000/");
    },
    network_id: '*',
    type: "quorum",
    timeoutBlocks: 1000000,
    networkCheckTimeout:20000000
  }
  },
  compilers: {
    solc: {
      version: "0.5.0",
      settings: {
        optimizer: {
          enabled: true, // Default: false
          runs: 1000     // Default: 200
        },
        evmVersion: "homestead"  // Default: "byzantium"
      }
    }
  }
};

我在用

节点 v14.16.1

Ubuntu 18.04(64 位)

法定人数 21.1.0

Web3.js v1.3.5

松露 v5.3.4(核心:5.3.4)

坚固性 v0.5.0

标签: javascriptweb3trufflequorumconsensys-truffle

解决方案


推荐阅读