def METHOD_NAME(self, mode):
    """set whether the node is a client or a server
    :param mode: "client" or "server"
    """
    if mode != "client" and mode != "server":
        raise ValueError("Mode should be 'client' or 'server'",  mode)
    self.config["mode"] = mode