Развертывание по контракту в основной сети - Ошибка: недостаточно средств на газ * цена + стоимость

Бег

гет v 1.7.3

трюфель 4.0.5

truffle-config.js

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*" // Match any network id
    },
    live: {
      host: "localhost",
      port: 8545,
      network_id: "1",
      from: "0x2cd02c6bfb7d36be9c98be275c5c30aa8d3848b8",
      gas:5000000
    }
   }
};

1_initial_migration.js

var Migrations = artifacts.require("./Migrations.sol");

module.exports = function(deployer) {
  deployer.deploy(Migrations, {gas:7987299});
};

2_deploy_contracts.js

var DevContest = artifacts.require("./DevContest.sol");

module.exports = function(deployer) {

  deployer.deploy(DevContest, "0xf7B098298f7C69Fc14610bf71d5e02c60792894C", 4942901, 4977461, {gas:7987299});

};

Ошибка, которую я получаю, находится в файле миграции, похоже, -

mokn$ truffle migrate --network live --reset
Using network 'live'.

Running migration: 1_initial_migration.js
  Deploying Migrations...
  ... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: insufficient funds for gas * price + value
    at Object.InvalidResponse (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:41483:16)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:330353:36
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:176198:11
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:326008:9
    at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:329052:7)
    at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176427:18)
    at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176717:12)
    at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176872:12)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176832:24)
    at IncomingMessage.emit (events.js:165:20)

Я проверил, сколько должен стоить контракт в Remix — не более 3,5 миллионов. Кто-нибудь знает, что здесь происходит? Спасибо

ОБНОВЛЕНИЕ. Похоже, что миграция развернута, но второй контракт не завершен. Возможно ли, что у меня недостаточно eth на счету? Контракт на миграцию не очень большой и стоит 300 тысяч газа.

Теперь я получаю эту проблему -

mokn$ truffle migrate --network live --reset
Using network 'live'.

Running migration: 1_initial_migration.js
  Deploying Migrations...
  ... 0x92cc08d87aac4ea464d2b1bfe89a747fbb52e4cf8bdade1c5d992705cffcad3c
  Migrations: 0x12613c93ae25f51d956cf9fcd80edc05babdc2fc
Saving successful migration to network...
  ... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: insufficient funds for gas * price + value
    at Object.InvalidResponse (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:41483:16)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:330353:36
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:176198:11
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:326008:9
    at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:329052:7)
    at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176427:18)
    at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176717:12)
    at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176872:12)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176832:24)
    at IncomingMessage.emit (events.js:165:20)
У меня та же проблема.

Ответы (1)

Я использую infura и решил проблему, объединив код миграции в 1_initial_migrations.js следующим образом:

var Migrations = artifacts.require("./Migrations.sol");
var Kratoken = artifacts.require("./Kratoken.sol");

module.exports = function(deployer) {
  deployer.deploy(Migrations)
    .then(() => Migrations.deployed())
    .then(kratoken => new Promise(resolve => setTimeout(() => resolve(kratoken), 60000)))
    .then(kratoken => deployer.deploy(Kratoken))
};