Learn

Congratulations! You have completed all the steps required to build a basic blockchain! In this exercise, we will bring the key parts together to review what we have built so far.

*Note: * The blockchain we have built only exists on a local machine. It is important to know that actual blockchain applications operate on multiple computers in a decentralized manner.

Instructions

1.

Create a Blockchain object named local_blockchain. Verify that this automatically creates a Genesis Block by printing out the contents of local_blockchain.

2.

Individually add block_one_transactions, block_two_transactions, and block_three_transactions respectively into local_blockchain. Print out the contents of local_blockchain to see what the block holds.

3.

Modify the second block you added in local_blockchain by changing the block’s transactions to fake_transactions. Check to see if the blockchain is still valid using the correct method.

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?