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

beginner's bugs #7

Open
dimarcom opened this issue Aug 19, 2022 · 3 comments
Open

beginner's bugs #7

dimarcom opened this issue Aug 19, 2022 · 3 comments

Comments

@dimarcom
Copy link

Hi Maher,

I am trying to run BlockSim and I run into a few bugs... but it's very probably because I don't know what I'm doing...

I set the model to 0 in InputsConfig.py.

I tried to run Main.py, but I got the following error:

File "/Users/dimarcom/Documents/blockchain/par les copains/BlockSim-master/Statistics.py", line 38, in blocks_results
Statistics.staleRate= round(Statistics.staleBlocks/Statistics.totalBlocks * 100, 2)
ZeroDivisionError: division by zero

So I opened statistics.py and changed the following line:

totalBlocks=0 --to--> totalBlocks=10

thinking it would create a chain composed of 10 blocks.

Then I ran again Main.py, and I got:

File "/Users/dimarcom/PycharmProjects/blockchain/venv/lib/python3.9/site-packages/pandas/core/internals/base.py", line 69, in _validate_set_axis
raise ValueError(
ValueError: Length mismatch: Expected axis has 0 elements, new values have 7 elements

... and I have to prepare my classes for next week, so I stopped there ;)

I'll come back to it soon enough I hope.

@maher243
Copy link
Owner

Hi,

model=0 is just for reference as it captures the main component of a blockchain. But it is incomplete so you have to extend it to suit your blockchain implementation.

You can use model = 1 which simulates the Bitcoin-like systems, or model=2 which simulates the Ethereum-like systems.

I hope this helps you!

@dimarcom
Copy link
Author

Thanks Maher, I have run your simulation with model = 1 and model = 2, and it works perfectly fine ! Great work.

@Amitdutta121
Copy link

Which python version are you using?

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

3 participants