Grind the candlenuts, galangal, chilies, shallots and garlic to a smooth paste in a mortar or blender, adding a little oil if necessary to keep the mixture turning.
Heat the oil in a wok over medium high heat and stir-fry the ground mixture until fragrant, 2 to 3 minutes. Add the dried shrimp and sugar, and continue to stir-fry for 2 more minutes.