These files simulate a blockchain. Notably this demo shows a simplification of some of the harder to understand details in order to shed light. Key elements that can be seen here:
- How Ethereum prevents double spending
- How the proof-of-work algorithm creates blocks
- How blocks are chained together
- How accounts update state
-
clone and cd into folder
-
type
python3 BlockchainDemo.py
-
mine first block -> choose '8' from option menu
-
add account -> choose '1' or '2'
-
bradcast txn -> choose '3' (follow prompts)
-
view txns -> choose '5' (txn should appear)
-
mine block -> choose '8'
-
view txns -> choose '5' (txn should be empty)