I have a setup where no accounts exist on a local node and communication with contracts is done by creating raw transactions with Web3 (signed in code and not by user or node).
On the contracts there are permissioned constant getter functions. EG
function getSomething() public onlyOwner constant returns(bool) {
return something;
}
I understand it is easy to use contract.methods.getSomething.call()
with Web3 but that would require an unlocked account on the local node.
It is also possible to make "calls" with web3.eth.call(obj)
but only with raw unsigned transactions.
How would I make a call with a signed transaction?
onlyOwner
? This is a constant function, so anyone can get the return value anyways, even if he's not the owner. It only takes a little more effort than withoutonlyOwner
.