微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

尝试使用 truffle 将智能合约部署到我的区块链时,我不断收到错误消息

如何解决尝试使用 truffle 将智能合约部署到我的区块链时,我不断收到错误消息

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

时开始

当我在 truffle 项目的根目录中时,我运行 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/");
    },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

Truffle v5.3.4(核心:5.3.4)

solidity v0.5.0

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。