input: Write a function to implement a basic blockchain system in Python. The function should define a Block class and a Blockchain class, where the Block class represents individual blocks in the blockchain, and the Blockchain class manages the chain of blocks. The function should include methods to add a block to the chain and to return the entire blockchain in JSON format.
output: def blockchain_system():
      import hashlib
      import json
      import time
  
      class Block:
          def __init__(self, index, previous_hash, timestamp, data, hash):
              self.index = index
              self.previous_hash = previous_hash
              self.timestamp = timestamp
              self.data = data
              self.hash = hash
  
          def to_dict(self):
              return {
                  'index': self.index,
                  'previous_hash': self.previous_hash,
                  'timestamp': self.timestamp,
                  'data': self.data,
                  'hash': self.hash
              }
  
      class Blockchain:
          def __init__(self):
              self.chain = []
              self.create_genesis_block()
  
          def create_genesis_block(self):
              genesis_block = Block(0, "0", time.time(), "Genesis Block", self.calculate_hash(0, "0", time.time(), "Genesis Block"))
              self.chain.append(genesis_block)
  
          def calculate_hash(self, index, previous_hash, timestamp, data):
              value = str(index) + previous_hash + str(timestamp) + data
              return hashlib.sha256(value.encode()).hexdigest()
  
          def add_block(self, data):
              previous_block = self.chain[-1]
              index = previous_block.index + 1
              timestamp = time.time()
              hash = self.calculate_hash(index, previous_block.hash, timestamp, data)
              new_block = Block(index, previous_block.hash, timestamp, data, hash)
              self.chain.append(new_block)
  
          def to_json(self):
              return json.dumps([block.to_dict() for block in self.chain], indent=4)