0
w3 = Web3(Web3.HTTPProvider('https://speedy-nodes-nyc.moralis.io/id/eth/ropsten'))
tx_params = {'chainId': 3, 'data': b'', 'gas': 21000, 'maxFeePerGas': '0x47868c00',
             'maxPriorityFeePerGas': '0x47868c00', 'nonce': 4, 'to': 'to_address',
             'type': 2, 'value': 1000000000000000, 'accessList': []}
account = Account.from_key('private_key')
signed_txn = account.sign_transaction(tx_params)
tx_hash = w3.eth.send_raw_transaction(signed_txn.rawTransaction)

rpc-node: {"jsonrpc":"2.0","id":1,"result":"Geth/v1.10.19-stable-23bee162/linux-amd64/go1.18.1"}

I get error Exception: {'code': -32000, 'message': 'invalid sender'} using Web3py on Ropsten network, and don't happen on rinkeby network.
Anyone know how to solve it? Thanks!

0 Answers0