首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误:使用马季奇测试网络部署失败

错误:使用马季奇测试网络部署失败
EN

Stack Overflow用户
提问于 2020-12-01 01:57:26
回答 2查看 913关注 0票数 3

我开始着手在马季奇上进行应用程序开发。并且我正在遵循文档https://docs.matic.network/docs/develop/getting-started中提供的说明

但我在使用松露时遇到了问题。在我运行该命令之后

代码语言:javascript
复制
truffle migrate --network matic

错误信息如下:

代码语言:javascript
复制
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.



Starting migrations...
======================
> Network name:    'matic'
> Network id:      80001
> Block gas limit: 20000000 (0x1312d00)


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

   Deploying 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

"Migrations" -- insufficient funds for gas * price + value.

    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
    at process._tickCallback (internal/process/next_tick.js:68:7)
Truffle v5.1.55 (core: 5.1.55)
Node v10.19.0

truffle的配置文件如下:

代码语言:javascript
复制
const HDWalletProvider = require('truffle-hdwallet-provider');
const fs = require('fs');
const mnemonic = fs.readFileSync(".secret").toString().trim();

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",     // Localhost (default: none)
      port: 8545,            // Standard Ethereum port (default: none)
      network_id: "*",       // Any network (default: none)
    },
    matic: {
      provider: () => new HDWalletProvider(mnemonic, `https://rpc-mumbai.matic.today`),
      network_id: 80001,
      confirmations: 2,
      timeoutBlocks: 200,
      skipDryRun: true
    },
  },

  // Set default mocha options here, use special reporters etc.
  mocha: {
    // timeout: 100000
  },

  // Configure your compilers
  compilers: {
    solc: {
    }
  }
}

它在网络开发中使用效果良好。

代码语言:javascript
复制
truffle develop

有没有人能告诉我如何在使用马季奇测试网的时候克服错误?

EN

回答 2

Stack Overflow用户

发布于 2021-02-07 23:10:38

确保您有足够的马季奇用于交易,您可以从here获取一些并将其转移到账户中。我在部署松露时遇到了问题,因为我所有的令牌都在account1,而不是account

票数 4
EN

Stack Overflow用户

发布于 2021-08-30 09:59:34

在我的例子中,它是ETH,确保我在第一个帐户中有令牌就成功了

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65078705

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档