maher243 / BlockSim

BlockSim: An Extensible Simulation Tool forBlockchain Systems
82 stars 51 forks source link

beginner's bugs #7

Open dimarcom opened 2 years ago

dimarcom commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

Amitdutta121 commented 1 year ago

Which python version are you using?