【问题标题】:INFURA: sender account not recognizedINFURA:发件人帐户无法识别
【发布时间】:2020-05-10 05:28:46
【问题描述】:

我正在尝试部署我的合同,但它返回此错误

松露迁移 --network ropsten --reset

1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------
Error: Error: Error:  *** Deployment Failed ***

"Migrations" -- sender account not recognized.

truffle_config.js

ropsten: {
      provider: function() {
          return new HDWalletProvider(mnemonic, "https://ropsten.infura.io/v3/<PROJECTID>")
      },
      network_id: "*", 
      gas: 4000000,
      from: "0x4e2f89...."
    }

【问题讨论】:

  • 您是否尝试将地址的索引应用到提供者? HDWalletProvider(助记符, "ropsten.infura.io/v3/<PROJECTID>", indexOfYourAddress)
  • 我没有看到任何关于它的文档,你在哪里读到的?
  • 在 HDWalletProvider 文档中
  • 有效!!!谢谢 !!!非常感谢您的帮助!
  • 我写了一个正确的答案

标签: ethereum truffle geth


【解决方案1】:

默认情况下,HDWalletProvider 会使用第一个地址 从助记符生成的地址。如果你传入一个特定的 索引,它将使用该地址。

所以如果你使用的地址不是这个助记符的第一个地址,你应该指定地址

HDWalletProvider(mnemonic, "ropsten.infura.io/v3/<PROJECTID>", indexOfYourAddress)

或通过将数字添加到第四个参数来解锁多个地址

HDWalletProvider(mnemonic, "ropsten.infura.io/v3/<PROJECTID>",0, numberOfAddresses)

【讨论】:

    猜你喜欢
    • 2019-03-19
    • 1970-01-01
    • 2019-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-16
    • 1970-01-01
    相关资源
    最近更新 更多