Prepare the tamarind paste. Then, preheat the oven to 250°F. Spread the coconut on a baking tray and roast until golden, 20 to 30 minutes (depending on the moisture content).
In a small nonstick saucepan, dry-roast together the broken red chile peppers, urad and channa dals, garlic, coriander, cumin, and fenugreek over medium heat until a few shades darker, about 2 minutes.
. Let cool, then grind in a spice or coffee grinder, in two batches if necessary, to make a fine powder. Remove spices to a bowl.
In the same grinder, grind the coconut, in two batches if necessary, to make it as fine as possible. Mix with the spices.
Heat the oil in a medium nonstick wok or saucepan over medium-high heat and add the whole red chile peppers and mustard seeds; they should splutter upon contact with the hot oil, so lower the heat and cover the pan until the spluttering subsides.
Add the asafoetida and curry leaves, then mix in the coconut-spice mixture.
Add the tamarind paste and the salt, and stir over medium heat until well mixed.
Transfer to a bowl and serve immediately, refrigerate about 10 days, or freeze up to 6 months.