If using dried black-eyed peas, check and remove stones and unwanted debris, rinse them thoroughly, and soak them in water for 5-6 hours or overnight. Drain and rinse again before cooking. If using canned beans, simply drain and rinse, without boiling.
In a large pot, add the soaked and drained uncooked black-eyed peas (skip this step if using canned beans). Cover with water, bring to a boil, and then reduce the heat to a simmer. Cook for about 40-60 minutes, or until the beans are tender. Keep adding water to the pot if necessary, to prevent burning. Drain the cooked beans, then set aside.
Using a blender, process the tomatoes, garlic, ginger, and scotch bonnet peppers (adjust the number of peppers based on your spice tolerance) until you have a smooth puree.
In a large, pot or pan, heat the palm oil over medium heat. Add the sliced onions and sauté until they become translucent, about 2-3 minutes.
Add the blended tomato mixture, shrimp seasoning cube, chili powder, all-purpose seasoning cube, and salt to the pot or pan. Stir well to combine.
Reduce the heat to medium-low and simmer the sauce for about 15-20 minutes, stirring occasionally, until it thickens, darkens, and the oil begins to separate from the sauce.
Gently add the cooked beans and fish (optional). Allow the stew to simmer for an additional 10-15 minutes, stirring occasionally, to combine (see notes).
Taste, and adjust the seasoning if needed, to your preference. Serve this African bean stew with rice, fried plantain, gari, boiled yams, or as preferred.