Skip to content
Advertisement

web3 gives ” Error: Returned error: invalid sender” when broadcasting transaction

I am new to web3 and ethereum blockchain. I tried broadcasting a transaction using the following code but it always gives me an invalid sender error.The sample code is shown below.

JavaScript

The error occurs at the below line

JavaScript

Please help me know how to fix this problem. Thanks.

Advertisement

Answer

You can try changing const tx = new Tx(txObject); to const tx = new Tx(txObject, { chain: 'ropsten' });

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement