ethereum / pyethapp

MIT License
1.28k stars 604 forks source link

Specifying a custom bootnode fails with "AssertionError: e" #270

Closed karalabe closed 6 years ago

karalabe commented 6 years ago

If I start pyethapp with -c discovery.bootstrap_nodes='enode://0b5ccd88c1904ad78ef455149eb88f4a5f92835a4604ecd9639ddcfb86d2a2999ad9328bc088452efffe4a7c6cd0eaaef77c779dc56fc1d0f21cd578eeb92cb5@23.101.151.28:30303'

it fails with:

[...]

  File "/usr/lib/python2.7/site-packages/pyethapp-1.5.0-py2.7.egg/pyethapp/app.py", line 228, in run
    app.start()
  File "/usr/lib/python2.7/site-packages/devp2p-0.9.2-py2.7.egg/devp2p/app.py", line 41, in start
    service.start()
  File "/usr/lib/python2.7/site-packages/devp2p-0.9.2-py2.7.egg/devp2p/discovery.py", line 580, in start
    nodes = [Node.from_uri(x) for x in self.app.config['discovery']['bootstrap_nodes']]
  File "/usr/lib/python2.7/site-packages/devp2p-0.9.2-py2.7.egg/devp2p/discovery.py", line 122, in from_uri
    ip, port, pubkey = utils.host_port_pubkey_from_uri(uri)
  File "/usr/lib/python2.7/site-packages/devp2p-0.9.2-py2.7.egg/devp2p/utils.py", line 30, in host_port_pubkey_from_uri
    b'@' in uri and b':' in uri, uri
AssertionError: e

Not sure what the error might be, enode seems to look ok to me and seems to be in sync with the python assertion (that fails for some reason).

hwwhww commented 6 years ago

Try

pyethapp -c discovery.bootstrap_nodes="['enode://0b5ccd88c1904ad78ef455149eb88f4a5f92835a4604ecd9639ddcfb86d2a2999ad9328bc088452efffe4a7c6cd0eaaef77c779dc56fc1d0f21cd578eeb92cb5@23.101.151.28:30303']" run

And confirm it with console:

In [3]: eth.services.peermanager.peers
Out[3]: [<Peer('23.101.151.28', 30303) >]

(But it's still really hard to start syncing...)

karalabe commented 6 years ago

Yay, indeed it works now. Didn't occur to me to do quotes within quotes. Thx!