-
Notifications
You must be signed in to change notification settings - Fork 188
Privatenet fails to initialize #1012
Description
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
- Use the instructions at https://github.com/CityOfZion/neo-privatenet-docker to spin up the latest docker image privatenet.
- Initialize your
venv
if applicable - Run
np-prompt -p
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