cosme12 / SimpleCoin

Just a really simple, insecure and incomplete implementation of a blockchain for a cryptocurrency made in Python as educational material. In other words, a simple Bitcoin clone.
http://copitosystem.com
MIT License
1.78k stars 400 forks source link

Running miner.py in wallet.py #69

Closed mehanalavimajd closed 2 years ago

mehanalavimajd commented 3 years ago

After this Pr the user don't need to run miner.py in another terminal

mehanalavimajd commented 3 years ago

No one will anwser me ?

cosme12 commented 3 years ago

No one will anwser me ?

Be patient. I will be looking at it as soon as I can. It's still weekend 😬

mehanalavimajd commented 3 years ago

Ok. Sorry

cosme12 commented 3 years ago

Hey @mehanalavimajd , I tried your pull request but I found a little problem. If we execute the miner.py script there, the terminal starts running the miner and we lose access to the wallet code we were running in the beggining. You probably have 2 options here: think another way of starting miner.py (if it's not already running) or use exceptions to display a message saying something like: "there are no nodes running". Keep researching and good job!

As an extra note: when importing os, use import os. So when we call os.system and the code becomes to long we know to which module it belongs.

mehanalavimajd commented 3 years ago

Ok . I will try to fix it 😉