I'm trying to deploy a solidity program to my private ethereum network. However, when i call a method it's not working properly.
This is what i'vd done before the call method.
$ truffle console
truffle(development)> var dApp
undefined
truffle(development)> Hello.deployed().then(function(instance) { dApp = instance; })
undefined
truffle(development)> dApp.message.call()
test env is below
truffle@5.0.28
solc@0.5.10
linux centOS 7
geth@1.8.23
I tried all of the solution in answer about the below error in stack overflow, but it didn't work.
Weird thing is that I installed geth on my macos using same release version, but its version was different from what I've installed on my centOS. It's 1.8.27 on macos and 1.8.23 on centOS 7.
By the way, it was working well when I tried same progress on my macos. Its return is below.
truffle(development)> dApp.message.call()
'Hello, World : This is a Solidity Smart ' +
'Contract on the Private Ethereum ' +
'Blockchain'
Bammmmmmmmmmmm.
This below is a solidity program I deploied.
pragma solidity >=0.4.15 <0.6.0;
contract Hello {
string public message;
function HelloEth() public {
message = "Hello, World : This is a Solidity Smart Contract on the Private Ethereum Blockchain";
}
}
This is the error returned.
Thrown:
Error: Returned values aren't valid, did it run Out of Gas?
at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:318:1)
at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:208:1)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request-event-target.js:34:1)
at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-providers-http/src/index.js:96:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:112:1
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3-core-requestmanager/src/index.js:147:1
at sendTxCallback (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/~/web3-core-method/src/index.js:473:1)
at Method.formatOutput (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/~/web3-core-method/src/index.js:163:1)
at Method.outputFormatter (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/src/index.js:818:1)
at Contract._decodeMethodReturn (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/src/index.js:465:1)
at ABICoder.decodeParameters (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-abi/src/index.jsa:226:1)
I really want to know because i tried almost 1 months... if you have any idea or any solution please let me know. :(