input: Write a function to implement a basic blockchain system in Python. The system should include a `Block` class to represent each block and a `Blockchain` class to manage the chain of blocks. The `Blockchain` class should have methods to add new blocks and to retrieve the entire blockchain in JSON format. The function should return the blockchain as a JSON object.
  
  def blockchain_system():
      import hashlib
      import json
  
      # We will use SHA256 as our hashing function
      def sha256(data):
          hash_function = hashlib.sha256()
          hash_function.update(data.encode('utf-8'))
          return hash_function.hexdigest()
  
      # Create a class for each block
      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 = sha256(f'{self.index}{self.timestamp}{self.data}{self.previous_hash}')
  
      # Create a class for the blockchain
      class Blockchain:
          def __init__(self):
              self.chain = []
  
          def add_block(self, data):
              previous_hash = self.chain[-1].hash if len(self.chain) > 0 else None
              block = Block(len(self.chain), data['timestamp'], data['data'], previous_hash)
              self.chain.append(block)
  
          # This method will return the entire blockchain in JSON format
          def get_chain(self):
              return json.dumps([b.__dict__ for b in self.chain], indent=2)
  
      # Create a blockchain instance and add some blocks
      my_blockchain = Blockchain()
      my_blockchain.add_block({'timestamp': '2023-04-01T10:00:00', 'data': 'Genesis Block'})
      my_blockchain.add_block({'timestamp': '2023-04-01T11:00:00', 'data': 'Block 1 Data'})
      my_blockchain.add_block({'timestamp': '2023-04-01T12:00:00', 'data': 'Block 2 Data'})
  
      return my_blockchain.get_chain()
  
  assert blockchain_system()=='{\n  "index": 0,\n  "timestamp": "2023-04-01T10:00:00",\n  "data": "Genesis Block",\n  "previous_hash": null,\n  "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"\n}\n{\n  "index": 1,\n  "timestamp": "2023-04-01T11:00:00",\n  "data": "Block 1 Data",\n  "previous_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",\n  "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"\n}\n{\n  "index": 2,\n  "timestamp": "2023-04-01T12:00:00",\n  "data": "Block 2 Data",\n  "previous_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",\n  "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"\n}'
output: 
  def blockchain_system():
      import hashlib
      import json
  
      def sha256(data):
          hash_function = hashlib.sha256()
          hash_function.update(data.encode('utf-8'))
          return hash_function.hexdigest()
  
      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 = sha256(f'{self.index}{self.timestamp}{self.data}{self.previous_hash}')
  
      class Blockchain:
          def __init__(self):
              self.chain = []
  
          def add_block(self, data):
              previous_hash = self.chain[-1].hash if len(self.chain) > 0 else None
              block = Block(len(self.chain), data['timestamp'], data['data'], previous_hash)
              self.chain.append(block)
  
          def get_chain(self):
              return json.dumps([b.__dict__ for b in self.chain], indent=2)
  
      my_blockchain = Blockchain()
      my_blockchain.add_block({'timestamp': '2023-04-01T10:00:00', 'data': 'Genesis Block'})
      my_blockchain.add_block({'timestamp': '2023-04-01T11:00:00', 'data': 'Block 1 Data'})
      my_blockchain.add_block({'timestamp': '2023-04-01T12:00:00', 'data': 'Block 2 Data'})
  
      return my_blockchain.get_chain()
  