简体   繁体   English

Rospten Infura 上的松露迁移错误

[英]Truffle migration error on Rospten Infura

Trying to deploy a smart contract with:尝试通过以下方式部署智能合约:

$ truffle migrate --network ropsten

But I got this error:但我得到了这个错误:

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

My truffle-config.js:我的松露-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 )
    },}
  }

With ganache works perfectly, but I need try whit this testnet...使用 ganache 可以完美运行,但我需要尝试使用这个测试网...

I also got the same error and tried to use ws instead of https endpoint and got the following issue.我也遇到了同样的错误并尝试使用ws而不是https端点并遇到以下问题。

Error: Unexpected server response: 401.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM