Using web3
version 1 beta 27, connected to a remote Parity node that's connected to the Ropsten network.
I have created an account with public and private keys, I have sent some test Eth to that address. That all works fine.
Now trying to actually invoke a function on my contract I get the message
Your account is locked. Unlock the account via CLI, personal_unlockAccount or use Trusted Signer
I don't have access to the node via CLI so need to use Trusted Signer
.
Looking at the docs for web3.eth.accounts.sign
I see the following
sign
web3.eth.accounts.sign(data, privateKey);
Signs arbitrary data. This data is before UTF-8 HEX decoded and enveloped as follows: "\x19Ethereum Signed Message:\n" + message.length + message
.
Parameters
data - String
: The data to sign. If its a string it will beprivateKey - String
: The private key to sign with.
which quite frankly doesn't make any sense.
Assuming the function I am calling is
TestContract.methods.test(testAddress).send()
How exactly do I use web3.eth.accounts.sign
in this context?