geth
is returning transaction hash and remix
is returning value. This is a fundamental difference in behavior of geth
and remix
.
Transactions don’t return a contract value to the front end because transactions are not immediately mined and included in the blockchain.
To get values from a function either you should use solidity events or you should use calls in ethereumEthereum.
Refer this blog to understand more about calls and transactions in solidity.
Refer to thisthis blog for understanding more about solidity events.