how to operate quary mining