Soak the dry cowpeas in some water for about half an hour for best results (this is not necessary but will make it better).
After soaking in water for about half an hour, drain the water and rinse the cowpeas in fresh water.
Add the red cowpeas to pressure cooker with 3 cups of water and enough salt, close the cooker and cook for about 12 minutes or until 3 to 4 whistles come.
After 10 to 12 minutes of cooking in medium heat, switch off the pressure cooker and wait for the cooker to cool down.
Meanwhile coarsely grind the coconut, green chili, cumin seeds, ginger and garlic in a food processor without adding water. If the mixture gets too dry, you may sprinkle very little water. Keep this coconut mixture aside.
Once the pressure cooker is cooled enough, open the cooker and see if the red cowpeas is cooked enough and soft.
There may be a little water remaining in the cooker after the red cowpeas is cooked, now you can drain this water and discard it or save it for later use as it is great to be used as a healthy delicious broth. However I am just going to heat the contents along with the water for a few minutes in a pan, and I have noticed that as I add the coconut mixture, there won't be anymore water left, as some of the water evaporates and any remaining water will get absorbed in the coconut mixture, so I am not draining the water here, as it will make the dish more delicious with much more flavor. So I will explain how to make the vanpayar thoran without draining out any excess water remaining after cooking the cowpeas.
Peel the shallots or pear onions, wash them and slice in half, keep aside.
Heat 1 tablespoon of oil in a pan and add the mustard seeds.
When the mustard seeds splutter, add the red chilies and curry leaves, fry for a few seconds.
Add the sliced shallots (or pearl onions) and saute for a few minutes, say 2 minutes until the onions starts turning brown.
Transfer the contents of the pressure cooker, the cooked red cowpeas and water, to the pan, stir well the contents.
Saute in medium heat for 2 to 3 minutes so the water content will almost evaporate.
Add the turmeric powder and red chili powder, mix the contents well.
Add the grind coconut mixture to the pan, mix everything well and saute for another 2 to 3 minutes so the remaining water will get absorbed by the contents in the pan.
Cover and cook the contents in low heat for another 2 minutes so the flavors will blend nicely.
After 2 minutes, open the pan and add the extra one tablespoon of oil to the thoran, mix well the contents and lightly saute for one more minute.
The delicious vanpayar thoran or red cowpeas dry dish with coconut and spices is ready to be served!