5 truffle部署合约到测试链的时候报错了,部署到Ganache就没问题

报错信息如下

image.png 错误信息:

Deploying 'ZombieCore'
   ----------------------
   > transaction hash:    0x26e7620cb31b07852f60be0a76c70b9fe2b577f3669ac996621da8cdcc16be7b
Error: Invalid JSON RPC response: ""94
    at Object.InvalidResponse (C:\Users\Larsy\Desktop\smartCon\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\web3\node_modules\web3-core-helpers\src\errors.js:42:1)
    at t.call [as onreadystatechange] (C:\Users\Larsy\Desktop\smartCon\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\web3\node_modules\web3-providers-http\src\index.js:92:1)
    at t.dispatchEvent (C:\Users\Larsy\Desktop\smartCon\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request-event-target.js:34:1)
    at t._setReadyState (C:\Users\Larsy\Desktop\smartCon\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request.js:208:1)
    at t._onHttpRequestError (C:\Users\Larsy\Desktop\smartCon\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request.js:349:1)
    at ClientRequest.<anonymous> (C:\Users\Larsy\Desktop\smartCon\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request.js:252:47)

我的 truffle-config.js配置如下

ropsten: {
provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/aebe320661154a789c1eab4c9e6ea0ba`),
      network_id: 3,       // Ropsten's id
      gas: 5500000,        // Ropsten has a lower block limit than mainnet
      confirmations: 2,    // # of confs to wait between deployments. (default: 0)
      timeoutBlocks: 200,  // # of blocks before a deployment times out  (minimum/default: 50)
      skipDryRun: true     // Skip dry run before migrations? (default: false for public nets )
    }
请先 登录 后评论

最佳答案 2022-05-05 12:13

Invalid JSON RPC response 提示,有可能是网络问题, 而不是合约问题。

请先 登录 后评论

其它 0 个回答

  • 1 关注
  • 0 收藏,2700 浏览
  • Larsy 提出于 2022-05-04 09:44