A simple BlockChain implelemtation using Python. It also has PoW(Proof of Work) concept which is how mining works.
timestamp
- Block creation time
transactions
- Data
previous_hash
- SHA-256 hash of previous block
nonce
- Initial number used for PoW
hash
- SHA-256 hash of current block
generate_hash()
- Generates SHA-256 hash of current block
print_contents()
- Prints the content of current block
chain
- Block chain (list)
all_transactions
- All performed transactions
genesis_block
- First block of blockchain
genesis_block()
- Creates first block(init)
print_blocks()
- Prints all blocks in the blockchain
add_block()
- Adds new block to block chain
validate_chain()
- Validates the blockchain
proof_of_work()
- PoW function to solve the required hash