[英]Truffle migration takes too much time
Hi i am trying to migrate contract by using getch on oracle virtual box ubuntu.嗨,我正在尝试通过在 oracle 虚拟机 ubuntu 上使用 getch 来迁移合同。 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?虽然 1_initial_migration.js 部署它显示 Block: 0 Seconds:16743 并且它没有完成部署并且还有一个 2_deploy_contract.js.Normally 是花费很多时间还是在一分钟内部署? What's wrong?Why it is not finished 1_initial_migration.js deploying and starting deploy 2_deploy_contract.js?怎么了?为什么1_initial_migration.js 部署和开始deploy 2_deploy_contract.js 没有完成?
truffle migrate --reset --network rinkeby松露迁移 --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迁移.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 1_initial_migration.js
const Migrations = artifacts.require("Migrations");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
I had the same problem when migrating on private ethereum using geth.使用 geth 在私有以太坊上迁移时,我遇到了同样的问题。 The problem was solved as soon as I started the mining process.我一开始挖矿,问题就解决了。 Make sure that your blocks are getting mined.确保您的区块正在被开采。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.