Wash and soak the black eyed peas overnight. Change water a couple of times, and pressure cook till soft. Keep it aside. Don't drain the water, you can use it for cooking.
Heat a kadai with cooking oil, fry the red chilies, keep aside. Fry the other ingredients for the masala individually and add cooking oil if necessary. Keep aside.
In the same pan fry the coconut, onions, and garlic, on low flame till the coconut is reddish brown in color, use cooking oil if needed. Cool.
Grind to a fine paste all the fried spices, coconut onion mixture, along with the tamarind. Keep it aside.
Heat a nonstick pan with cooking oil, fry finely chopped onions till soft, add the boiled beans without water. Combine and cook well.
Next, add the ground masala paste, turmeric powder, and salt. Saute everything well until the beans get coated well. Then, add the reserved water and bring it to boil.
When the gravy thickens as required, add chopped coriander leaves and simmer for 5 mins.
Serve hot with Rotis.