Wash the rice and soak in water for 15 minutes. Cook the rice with water and salt to taste. Spread the cooked rice in a plate to cool. Slice onions. Slice eggs lengthwise in half. Clean and cut chicken into small pieces. Wash, peel and cut the potatoes into quarter pieces. Grind the masala ingredients to a smooth paste.
Heat ghee in a frying pan and fry the onions until brown. Remove half and keep aside. Add ground masala to remaining onions and fry well. Add chicken pieces, potatoes, green peas, salt to taste and fry well. Add 2 cups of water and cook until all the water is absorbed. Put 2 tablespoons of ghee in an oven proof dish. Place a layer of fried onions, boiled eggs and sliced tomatoes. Repeat layers and finish with a layer of rice. Place in an oven and bake until the top gets brown. Serve hot with raitha (salad) and pickles.