code: def check_network_id(network_id, web3: Web3):
      
      while True:
          current_id = int(web3.version.network)
          if network_id != current_id:
              raise RuntimeError(
                  f'Raiden was running on network with id {network_id} and it detected '
                  f'that the underlying ethereum client network id changed to {current_id}.'
                  f' Changing the underlying blockchain while the Raiden node is running '
                  f'is not supported.',
              )
          gevent.sleep(CHECK_NETWORK_ID_INTERVAL)
docs: Check periodically if the underlying ethereum client's network id has changed