def deserialize(cls, value):
        parsed = json.loads(value)
        if "name" not in parsed:
            raise ValueError("No peer name.")
        if "ip" not in parsed:
            raise ValueError("No peer IP.")
        if "port" not in parsed:
            parsed["port"] = DEFAULT_PEER_PORT
        return cls(parsed["name"], parsed["ip"], parsed["port"])