Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Privatenet fails to initialize #1012

Open
jseagrave21 opened this issue Aug 31, 2019 · 2 comments
Open

Privatenet fails to initialize #1012

jseagrave21 opened this issue Aug 31, 2019 · 2 comments

Comments

@jseagrave21
Copy link
Contributor

jseagrave21 commented Aug 31, 2019

Current behavior

When trying to run neo-python using a privatenet, the program hangs and I receive the follow error after exiting using "Ctrl-C":

(venv) jseagrave21@DESKTOP-F7E94IM:/mnt/c/users/jseag/neo/neo-python-coz$ np-prompt -p
Privatenet useragent '/Neo:2.10.2/', nonce: 1195469497
Maxpeers set to  5
[I 190824 23:26:08 LevelDBImpl:45] Created DB at /home/jseagrave21/.neopython/Chains/privnet
[I 190824 23:26:08 Blockchain:164] Current stored headers empty, re-creating from stored blocks...
[I 190824 23:26:08 Blockchain:166] Recreate headers
[I 190824 23:26:08 LevelDBImpl:45] Created DB at /home/jseagrave21/.neopython/Chains/privnet_notif
^CShutting down sync manager...DONE
Shutting down node manager...DONE
Traceback (most recent call last):
  File "/mnt/c/users/jseag/neo/neo-python-coz/venv/bin/np-prompt", line 11, in <module>
    load_entry_point('neo-python', 'console_scripts', 'np-prompt')()
  File "/mnt/c/users/jseag/neo/neo-python-coz/neo/bin/prompt.py", line 393, in main
    loop.run_until_complete(shutdown())
  File "/usr/lib/python3.7/asyncio/base_events.py", line 566, in run_until_complete
    return future.result()
  File "/mnt/c/users/jseag/neo/neo-python-coz/neo/bin/prompt.py", line 376, in shutdown
    await task
  File "/mnt/c/users/jseag/neo/neo-python-coz/neo/Network/nodemanager.py", line 80, in start
    raise e
  File "/mnt/c/users/jseag/neo/neo-python-coz/neo/Network/nodemanager.py", line 74, in start
    await self.loop.create_server(proto, host, port)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1346, in create_server
    % (sa, err.strerror.lower())) from None
PermissionError: [Errno 13] error while attempting to bind on address ('127.0.0.1', 20333): permission denied

After troubleshooting and receiving advice on Slack, @hal0x2328 led to me a solution: changing the nodeport in the json file to something other than 20333.
This is an issue because anyone running the docker image for the privatenet on the same workstation they are using neo-python will run into this problem.
The default protocol.privnet.json lists

"SeedList": [
      "127.0.0.1:20333",
      "127.0.0.1:20334",
      "127.0.0.1:20335",
      "127.0.0.1:20336"

And the Nodeport as 20333.
Ref: https://github.com/CityOfZion/neo-python/blob/master/neo/data/protocol.privnet.json

Expected behavior

Using the docker image and np-prompt -p, a user should be able to access a privatenet without additional work.

How to reproduce

Your environment

Let us know in what environment you're running into the issue:

  • OS: Windows 10, Ubuntu 18.04 LTS
  • neo-python version: 0.8.6-dev
  • Python version: 3.7
@ixje
Copy link
Member

ixje commented Sep 9, 2019

I think the discussion here is; should we change the default port of neo-python to not conflict with neo-privatenet if that is running? If so, to what?
The issue will still persist when people copy their config files (which is very likely)

@jseagrave21
Copy link
Contributor Author

jseagrave21 commented Sep 10, 2019

@ixje perhaps this could be improved with better documentation in https://github.com/CityOfZion/neo-privatenet-docker.
I was caught off guard originally because I have been using the privatenet without any additional steps since I started contributing. I am not sure what the best way forward is, my only thought was to make the user experience as simple and as straightforward as possible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants