ethereum / web3.py

A python interface for interacting with the Ethereum blockchain and ecosystem.
http://web3py.readthedocs.io
MIT License
5k stars 1.7k forks source link

ENS Ropsten #1078

Closed randomlogin closed 6 years ago

randomlogin commented 6 years ago

It seems it's not possible (at least in easy way) to use Ropsten ENS.

web3py has hardcoded ens registry for mainnet:

>>> ns.ens.address '0x314159265dD8dbb310642f98f50C066173C1259b' What is the workaround to this issue?

carver commented 6 years ago

You would initialize the ENS() class directly, like:

from ens import ENS
from web3 import Web3

ropsten_ns = ENS(Web3.IPCProvider(...), "0xF00BAA...")

Where F00BAA... is replaced by the Ropsten ENS registry's address.

filips123 commented 5 years ago

@carver Shouldn't ENS class also detect current network and use correct registry's address by default? This is already used in Web3.js.

I created PR #1396 for this.