Skip to content

Instantly share code, notes, and snippets.

@bajcmartinez
Created May 18, 2020 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bajcmartinez/7b92190e8afb4fc6cb1e00e82e96c812 to your computer and use it in GitHub Desktop.
Save bajcmartinez/7b92190e8afb4fc6cb1e00e82e96c812 to your computer and use it in GitHub Desktop.
From Zero to Blockchain in Python - Part 1 - Constructor
def __init__(self):
self.__current_transactions = []
self.__chain = []
# Create genesis block
self.create_genesis()
def create_genesis(self):
"""
Creates the Genesis block and passes it to the chain
:return: None
"""
genesis_block = Block(0, self.__current_transactions, 0, '00')
self.__chain.append(genesis_block)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment