Add curry paste to pot and cook, while stirring, for 2 minutes. Stir in beer and bring to a boil, reduce heat, and simmer until reduced by half, about 5 minutes. Add coconut milk, stock, fish sauce, sugar, star anise, cinnamon. chicken and potatoes. Bring to a boil, reduce heat to low, cover and simmer for 20 minutes. Add onions back in and continue simmering with the cover off, until potatoes are tender and chicken is cooked through but not falling apart, 15 to 20 minutes. Turn off heat and remove star anise and cinnamon stick. Spoon off any excess fat on the surface, if needed. Stir in peanuts and lime juice, and season to taste with salt, if needed.