I can not understand how I can prepare the transaction to be signed. Because INFURA does not support eth_sendTransaction
but only eth_sendRawTransaction
(INFURA API which then requires you to prepare a signed transaction) I have no idea how I can do that.
This is the code that I use to try send transaction, that it fails:
PrintProofOfWork.methods.printRequested(web3.utils.keccak256(gcodeHash)).send('0x' + serializedTransaction.toString('hex'))
.then((result) => {
log(`result of the invokation: ${result})`.red);
}).catch((err) => {
log(`error occurred: ${err})`.red);
});
The error I get is:
error occurred: Error: Node error: {"code":-32601,"message":"The method eth_sendTransaction does not exist/is not available"})
Can anyone kindly show me how I can prepare a transaction that invokes the method of a Smart Contract with parameters, sign it and then send it with INFURA?