I have been trying to deploy and invoke my first smart contract (HelloWorld) into Ganache test network, I am able to view the logs in Ganache after deploying the Hello World( there is a log for every attempt I did), but when trying to invoke( or call the contract) it seems that the contract is not deployed and also the Gas fee isn't charged .
C:\Users\aakas\workspace\firstProject>truffle console truffle(development)> HelloWorld.deployed().then(function(instance) {return instance}) Uncaught: Error: HelloWorld has not been deployed to detected network (network/artifact mismatch) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Function.deployed (C:\Users\aakas\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\contract\constructorMethods.js:83:1) at Object.checkNetworkArtifactMatch (C:\Users\aakas\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\utils\index.js:256:1)
Trying to tackle with this error, but couldn't
Support is much appreciated.
I tried deploying and invoking the contract and have been expecting to be charged Gas Fee from ganache testnet, but that didn't happen. And also when tried invoking (calling) the contract it says the contract has not been deployed, but the log has been entered.
Also, tried adding the project in ganache.
I was expecting a smooth coding experience but I am not.
I have come across a online tutor , and when he run the command >truffle deploy --reset
He was able to deploy the contract and also he was charged Gas.