To interact with your smart contract that resides in Ethereum blockchain, execute this command inside your Truffle project directory:
$ truffle console
Then, in the truffle console prompt, execute the following command:
truffle(development)> Donation.deployed().then(function(instance) { return instance.useless_variable.call(); });
'Donation string'
If you are confused about then, the Truffle console uses the concept of callback, on which accessing the smart contract object is executed asynchronously. This statement in the Truffle console returns immediately before the callback is being executed. In the callback function, you will accept the smart contract instance as an instance parameter. Then, we can access our useless_variable variable from this instance parameter. Then, to retrieve the value, we have to execute the call method on...