0
votes

Hi i am trying to migrate contract by using getch on oracle virtual box ubuntu. Although 1_initial_migration.js deploying it shows Block: 0 Seconds:16743 and it is not completed to deploy and also there is a 2_deploy_contract.js.Normally is it taking much time or deploy in a minute? What's wrong?Why it is not finished 1_initial_migration.js deploying and starting deploy 2_deploy_contract.js?

truffle migrate --reset --network rinkeby

Here is contract:

pragma solidity 0.4.2;

contract Election {
// Read/write candidate
string public candidate;

// Constructor
function Election () public {
    candidate = "Candidate 1";
}
}

migrations.sol

 pragma solidity >=0.4.21 <0.6.0;

 contract Migrations {
  address public owner;
  uint public last_completed_migration;

  constructor() public {
     owner = msg.sender;
  }

   modifier restricted() {
    if (msg.sender == owner) _;
   }

   function setCompleted(uint completed) public restricted {
    last_completed_migration = completed;
   }

   function upgrade(address new_address) public restricted {
    Migrations upgraded = Migrations(new_address);
      upgraded.setCompleted(last_completed_migration);
   }
  }

1_initial_migration.js

   const Migrations = artifacts.require("Migrations");

    module.exports = function(deployer) {
    deployer.deploy(Migrations);
    };
1
Can you show 1_initial_migration.js? - Vitaly Migunov
@ Vitaly Migunov I edited my question and added 1_initial_migration.js. But it is created default when truffle init - jhdm
Can you share your truffle.js file? - Zulhilmi Zainudin

1 Answers

0
votes

I had the same problem when migrating on private ethereum using geth. The problem was solved as soon as I started the mining process. Make sure that your blocks are getting mined.