Following is my helloworld.sol contract:
pragma solidity ^0.4.17;
contract HelloWorld{
function sayHello() internal pure returns(string){
return("Hello 2018!");
}
}
Initial migrations.js:
var Migrations = artifacts.require("./Migrations.sol");
var HelloWorld = artifacts.require("./HelloWorld.sol");
module.exports = function(deployer) {
deployer.deploy(Migrations);
deployer.deploy(HelloWorld);
};
And since I'm using truffle, truffle.js:
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
}
}
};
When I run commands:
truffle compile
truffle migrate
truffle console
I get
Error: HelloWorld has not been deployed to detected network (network/artifact mismatch) at C:\Users\Kofola\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:317116:17 at at process._tickDomainCallback (internal/process/next_tick.js:228:7)
How do I correctly deploy my contract and test its method?