code: def requires_genesis(self):
          
  
          genesis_file = os.path.join(self._data_dir, 'genesis.batch')
          has_genesis_batches = Path(genesis_file).is_file()
          LOGGER.debug('genesis_batch_file: %s',
                       genesis_file if has_genesis_batches else 'not found')
  
          chain_head = self._block_store.chain_head
          has_chain_head = chain_head is not None
          if has_chain_head:
              LOGGER.debug('chain_head: %s', chain_head)
  
          block_chain_id = self._chain_id_manager.get_block_chain_id()
          is_genesis_node = block_chain_id is None
          LOGGER.debug(
              'block_chain_id: %s',
              block_chain_id if not is_genesis_node else 'not yet specified')
  
          if has_genesis_batches and has_chain_head:
              raise InvalidGenesisStateError(
                  'Cannot have a genesis_batch_file and an existing chain')
  
          if has_genesis_batches and not is_genesis_node:
              raise InvalidGenesisStateError(
                  'Cannot have a genesis_batch_file and join an existing network'
              )
  
          if not has_genesis_batches and not has_chain_head:
              LOGGER.info('No chain head and not the genesis node: '
                          'starting in peering mode')
  
          return has_genesis_batches and not has_chain_head and is_genesis_node
docs: Determines if the system should be put in genesis mode
  
          Returns:
              bool: return whether or not a genesis block is required to be
                  generated.
  
          Raises:
              InvalidGenesisStateError: raises this error if there is invalid
                  combination of the following: genesis.batch, existing chain
                  head, and block chain id.