If you are cooking on the stove (as opposed to Instant Pot/pressure cooker), soak the raw peanuts in water overnight before cooking. Add the sea salt, star anise, ginger, and black peppercorns to the pot the next morning. Bring to a boil and then simmer over low heat for 1-2 hours. Stir every 15 minutes and check for doneness after 1-hour.