0

I have two accounts on my geth node . The geth node is syncing with the Ropsten testnet . I executed the following commands

personal.unlockAccount(eth.accounts[1],'Test');

The result was true

After this I tried to sign data by using the following :-

web3.eth.sign("Hello world", eth.accounts[1]).then(console.log);

But can see an error message "invalid address"

What could be causing this error ? Any help appreciated.

1

Correct syntax for eth.sign is web3.eth.sign(address, dataToSign, [, callback]), you switched address and data, also make sure to give hex string or use web3.toHex for dataToSign parameter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.