input: Write a function to create a basic blockchain system in Python by defining 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 a new block to the chain and to return the entire blockchain in JSON format.
  
  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)
  
  assert Blockchain().get_chain() == "[]"
  blockchain = Blockchain()
  block_data1 = {'timestamp': '2023-01-01', 'data': 'Block 1 Data'}
  blockchain.add_block(block_data1)
  block_data2 = {'timestamp': '2023-01-02', 'data': 'Block 2 Data'}
  blockchain.add_block(block_data2)
  assert blockchain.get_chain() != "[]"
  assert blockchain.chain[0].index == 0
  assert blockchain.chain[1].index == 1
  assert blockchain.chain[1].previous_hash == blockchain.chain[0].hash
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 = 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)
  