Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This program not work correctly on linux #59

Open
mateusfg7 opened this issue May 20, 2020 · 5 comments
Open

This program not work correctly on linux #59

mateusfg7 opened this issue May 20, 2020 · 5 comments

Comments

@mateusfg7
Copy link

Output error when execute python3 miner.py on terminal:

Traceback (most recent call last):
  File "/home/mateusfg7/Desktop/SimpleCoin/simpleCoin/miner.py", line 267, in <module>
    p2 = Process(target=node.run(), args=b)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 990, in run
    run_simple(host, port, self, **options)
  File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 1052, in run_simple
    inner()
  File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 1005, in inner
    fd=fd,
  File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 848, in make_server
    host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
  File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 740, in __init__
    HTTPServer.__init__(self, server_address, handler)
  File "/usr/lib/python3.7/socketserver.py", line 452, in __init__
    self.server_bind()
  File "/usr/lib/python3.7/http/server.py", line 137, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.7/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/home/mateusfg7/Desktop/SimpleCoin/simpleCoin/miner.py", line 112, in mine
    NODE_PENDING_TRANSACTIONS = json.loads(NODE_PENDING_TRANSACTIONS)
  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 5 (char 4)
@cosme12
Copy link
Owner

cosme12 commented May 20, 2020

Hmm... It looks like you are running something else in that port. May it be possible?
I think you can check if the port is in use with $ lsof -i :5000

@mateusfg7
Copy link
Author

image
nothing :(

@mateusfg7
Copy link
Author

I used this other command, and was display this:
image
apparently the port 5000 is being used
but, i don't know why

can i change the used port? if yes, how?

@cosme12
Copy link
Owner

cosme12 commented May 22, 2020

I though you could change port, but after testing apparently is not that simple. Will let you know if I make it work

@mateusfg7
Copy link
Author

ok 😃

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

No branches or pull requests

2 participants