decred / tinydecred

Python tools for Decred
ISC License
27 stars 14 forks source link

app: Unable to restore from seed when dcrdata is down. #176

Open JoeGruffins opened 4 years ago

JoeGruffins commented 4 years ago

dcrdata is currently under maintenance. When trying to restore from seed I get this error:

[joe@hyrule tinywallet]$ poetry run tinywallet --testnet --log=debug
2020-04-22 10:26:07,090 app INFO initLogging(172) configuration file at /home/joe/.local/share/TinyWallet/tinywallet.c
2020-04-22 10:26:07,090 app INFO initLogging(173) data directory at /home/joe/.local/share/TinyWallet
  File "/home/joe/git/tinydecred/decred/decred/util/tinyhttp.py", line 40, in request
    raw = urlrequest.urlopen(req, context=context).read().decode()
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
  File "/home/joe/git/tinydecred/tinywallet/tinywallet/screens.py", line 2074, in create
    app.dcrdata.connect()
  File "/home/joe/git/tinydecred/decred/decred/dcr/dcrdata.py", line 443, in connect
    self.dcrdata = DcrdataClient(self.datapath, emitter=self.pubsubSignal)
  File "/home/joe/git/tinydecred/decred/decred/dcr/dcrdata.py", line 155, in __init__
    endpoints = tinyhttp.get(listURL, headers=GET_HEADERS)
  File "/home/joe/git/tinydecred/decred/decred/util/tinyhttp.py", line 18, in get
    return request(url, **kwargs)
  File "/home/joe/git/tinydecred/decred/decred/util/tinyhttp.py", line 42, in request
    raise DecredError(f"Error in requesting URL {url}: {formatTraceback(err)}")
2020-04-22 10:26:13,898 screens ERROR create(2080) failed to create wallet: Error in requesting URL https://testnet.dcrdata.org/api/list: HTTP Error 503: Service Unavailable
Traceback:
None
Traceback:
None

I doubt that dcrdata's api/list is really necessary to create the wallet.

buck54321 commented 4 years ago

I doubt that dcrdata's api/list is really necessary to create the wallet.

It's true that you could create the wallet without dcrdata, but you can't sync it, so you can't really "restore" from seed. I think it's correct to error when this happens. We should just handle it better.

JoeGruffins commented 4 years ago

But I was able to connect to dcrd. So I need to be able to choose a blockchain before I get to the accounts screen.