I want to sign a transaction that calls a smart contract function and send it to the Rinkeby network.
I found on Web3j documentation the RawTransaction class that supports the methods for the contract creation and for Ethereum exchange, however I'm not able to send a raw transaction that calls a function from the smart contract.
How can I do this? is there a way to use createFunctionCallTransaction from the Transaction class and sign it with my credentials?
Best Answer
Let's take for example the following simple storage contract:
You can send a transaction to a (already deployed) smart contract with the following code:
The code is also available on github
There other and more convenient solutions using a Java Smart contract wrapper (see here)