我开始着手在马季奇上进行应用程序开发。并且我正在遵循文档https://docs.matic.network/docs/develop/getting-started中提供的说明
但我在使用松露时遇到了问题。在我运行该命令之后
truffle migrate --network matic错误信息如下:
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.0truffle的配置文件如下:
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: {
}
}
}它在网络开发中使用效果良好。
truffle develop有没有人能告诉我如何在使用马季奇测试网的时候克服错误?
发布于 2021-02-07 23:10:38
确保您有足够的马季奇用于交易,您可以从here获取一些并将其转移到账户中。我在部署松露时遇到了问题,因为我所有的令牌都在account1,而不是account
发布于 2021-08-30 09:59:34
在我的例子中,它是ETH,确保我在第一个帐户中有令牌就成功了

https://stackoverflow.com/questions/65078705
复制相似问题