input: Write a function to implement a basic blockchain system in Python. The function should include classes for Block and Blockchain, with methods to add a block and retrieve the entire blockchain in JSON format.
  assert isinstance(Blockchain, type) and hasattr(Blockchain, '__init__')  # Ensure Blockchain is a class with an __init__ method
  assert isinstance(Block(), object) and hasattr(Block, '__init__')  # Ensure Block is a class with an __init__ method
  assert hasattr(Blockchain, 'add_block') and callable(Blockchain().add_block)  # Ensure add_block is a method of Blockchain
  assert hasattr(Blockchain, 'get_chain') and callable(Blockchain().get_chain)  # Ensure get_chain is a method of Blockchain
  assert Blockchain().get_chain() == '[]'  # Test empty blockchain
  blockchain = Blockchain()
  blockchain.add_block({'timestamp': '2023-01-01 12:00:00', 'data': 'First block'})
  block_data = json.loads(blockchain.get_chain())
  assert block_data[0]['data'] == 'First block'  # Test adding a block and retrieving blockchain
output: class Block:
      def __init__(self, index, timestamp, data, previous_hash):
          self.index = index
          self.timestamp = timestamp
          self.data = data
          self.previous_hash = previous_hash
          self.hash = self.calculate_hash()
  
      def calculate_hash(self):
          block_string = json.dumps(self.__dict__, sort_keys=True).encode()
          return hashlib.sha256(block_string).hexdigest()
  
  class Blockchain:
      def __init__(self):
          self.chain = []
          self.create_genesis_block()
  
      def create_genesis_block(self):
          genesis_block = Block(0, "2023-01-01 00:00:00", "Genesis Block", "0")
          self.chain.append(genesis_block)
  
      def add_block(self, data):
          previous_block = self.chain[-1]
          new_index = previous_block.index + 1
          new_timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
          new_block = Block(new_index, new_timestamp, data, previous_block.hash)
          self.chain.append(new_block)
  
      def get_chain(self):
          return json.dumps([block.__dict__ for block in self.chain])