JBaczuk / blockchain-dev-tools

Blockchain Development Tools
GNU General Public License v2.0
6 stars 10 forks source link

How do I import the coin module? #2

Closed Concorde89 closed 2 years ago

Concorde89 commented 4 years ago

line 14, in raise ModuleNotFoundError('There is no coin configuration file coins/' + coin) ModuleNotFoundError: There is no coin configuration file coins/bitcoin

Thanks

Concorde89 commented 4 years ago

I did manage to get through that error by renaming the learncoin.py file to my coin half.py I get the following error now: Traceback (most recent call last): File "/home/crypto/blockchain_fundamentals/bin/sha256", line 4, in from blockchain_fundamentals import * File "/home/crypto/blockchain_fundamentals/bin/blockchain_fundamentals.py", line 8, in coin = os.environ['COIN'] File "/usr/lib/python3.6/os.py", line 669, in getitem raise KeyError(key) from None KeyError: 'COIN'

how to solve. thanks

JBaczuk commented 4 years ago

Hi, sorry you're having trouble, can you show me your folder structure and where your coin file is in relation to the sha256.py file?

Concorde89 commented 4 years ago

No prob. I think it is a folder problem too but don't know how to solve. 1 2 3

JBaczuk commented 4 years ago

Something broke with virtualenv update or something. I have pushed a fix, can you pull the latest, give it a try and let me know? I've updated instructions on the README.

JTD420 commented 3 years ago

Hey,

to fix the problem you need to type the following into your terminal: $COIN=yourcoinhere $export COIN

Additionally you must have your coin file setup. This can be located in the blockchain/bin folder. You can copy the bitcoin & bitcoin.py files and rename them to your new coin. Alternatively you could use or change the learncoin & learncoin.py files to your new coin.

So long as you've got those two files added AND you've set the COIN variable to be equal to the filename of your coin (and don't forget to export!) then everything should work from there!

Hope that helps! :) Sorry if I made it hard to understand.

I did manage to get through that error by renaming the learncoin.py file to my coin half.py I get the following error now: Traceback (most recent call last): File "/home/crypto/blockchain_fundamentals/bin/sha256", line 4, in from blockchain_fundamentals import * File "/home/crypto/blockchain_fundamentals/bin/blockchain_fundamentals.py", line 8, in coin = os.environ['COIN'] File "/usr/lib/python3.6/os.py", line 669, in getitem raise KeyError(key) from None KeyError: 'COIN'

how to solve. thanks

imtotoh commented 3 years ago

Just do this on installation dir (cd blockchain-dev-tools).

//copy both coin files into blockchain-dev-tools folder cp coins/* .

// Execute the file ./msgprefixgen.py

and Voilla !! see the magic.