【问题标题】:Truffle migration error on Rospten InfuraRospten Infura 上的松露迁移错误
【发布时间】:2022-08-05 21:26:26
【问题描述】:

尝试通过以下方式部署智能合约:

$ truffle migrate --network ropsten

但我得到了这个错误:

/home/user/Documentos/testcontract/node_modules/eth-block-tracker/src/polling.js:51
        const newErr = new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\\n${err.stack}`)
                       ^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
undefined
    at PollingBlockTracker._performSync (/home/user/Documentos/testcontract/node_modules/eth-block-tracker/src/polling.js:51:24)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

我的松露-config.js:

networks: {
    development: {
      host: \"127.0.0.1\",     // Localhost (default: none)
      port: 8545,            // Standard Ethereum port (default: none)
      network_id: \"*\",       // Any network (default: none)
    },
    ropsten: {
      provider: () => new HDWalletProvider(mnemonicPhras, \'https://ropsten.infura.io/v3/1a470cedbc0d423592811o8bd1aa3e33\'),
      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 )
    },}
  }

使用 ganache 可以完美运行,但我需要尝试使用这个测试网...

  • 尝试将提供程序 URL 中的 \'https\' 替换为 \'wss\'。来源:github.com/trufflesuite/truffle/issues/3357
  • @MuhtasimUlfatTanmoy 仍然无法正常工作,我得到:abortHandshake(this, req, Unexpected server response: ${res.statusCode});
  • 你能分享一下statusCode吗?

标签: blockchain smartcontracts truffle


【解决方案1】:

我也遇到了同样的错误,并尝试使用 ws 而不是 https 端点并遇到以下问题。

Error: Unexpected server response: 401.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-17
    相关资源
    最近更新 更多