I've being trying to create a basic smart contract and deploy it on blockchain using truffle,ganache.When i put this command on my truffle console it throws an error.I've looked for the solution but can't seem to understand where i am going wrong!Can anyone help me out?
这是我的迁移第二个文件,即 2_deploy_contracts.sol
var Election = artifacts.require("./Election.sol");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
这是我的 truffle-config.js
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// for more about customizing your Truffle configuration!
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*" // Match any network id
},
develop: {
port: 8545
}
}
};
这是错误:
Uncaught:
Error: Election has not been deployed to detected network (network/artifact mismatch)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at Function.deployed (C:\Users\harshad\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\contract\constructorMethods.js:84:1)
at Object.checkNetworkArtifactMatch (C:\Users\harshad\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\utils\index.js:249:1)