0

First let me explain my development environment. I am using Jupyter Notebook to play around with the Web3.py front-end code and Remix for the Solidity smart contract code. I am using the Metamask wallet

firstly i configure the Metamask wallet to pick the Rinkeby network. The i use the Remix IDE to configure it to use Rinkeby, using Injected Web3.

I want to connect to the Rinkeby testnet, using an Infura RPC URL like this;

https://rinkeby.infura.io/v3/YOUR_INFURA_API_KEY_GOES_HERE

and i succeed in doing so through the Web3.py code.

when i call a function, which is a call and not a state modifying function, it works fine

e.g the below code works

contract.functions.getMessage().call() # displays a message string

However, whenever i try to make a transaction or call a state modifying function in the contract, say something like

tx_hash = contract.functions.setMessage('Call from Jupyter').transact()

It gives me the following error

The field extraData is 97 bytes, but should be 32. It is quite likely that you are connected to a POA chain.

Refer http://web3py.readthedocs.io/en/stable/middleware.html#geth-style-proof-of-authority for more details.

The full extraData is: HexBytes('0xd883010900846765746888676f312e31322e34856c696e757800000000000000d2c6d883001d158bf0718c1dc64b2809d4c90c9a9450324c22be595e598205e85f5f73d61bd864b3aac4e7ec8f101564cde8faf72cd3ef52b15d3c8a3c6ab6c900')

( I have spaced out the error, into 3 parts, to allow for more legibility )

From what i read in the provided link, i have to use Geth or Parity to successfully conduct transactions on test networks like Rinkeby.

I am also quite confused with the IPC provider mentioned in the above link. I have no idea how to use it ( i think it conflicts with HTTP provider, which is what i intend to use. but feel free to elaborate and clear up any misconceptions on this )

However, if i don't want to use Geth or Parity, is there any method i can use to connect to Rinkeby and conduct transactions by simply using my Infura URL and Web3.py ?

Please let me know any prospective solution or even any relevant work around to this issue

Many thanks

0

Web3 and Metamask are all you need to connect to Rinkeby. You don't need Infura, Geth, or Parity. For state modifying, check out the method send command:

myContract.methods.myMethod([param1[, param2[, ...]]]).send(options[, callback])

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.