There were many kingdoms along the west coast of Africa. One of the most famous was the ancient kingdom of Ghana. This is because Ghana handled the trade between traders to the north and traders to the south. The north had salt mines. The south had gold. Ghana was the the middle, and had a very strong army.
Ghana offered the traders protection, for a fee. Ghana set up the rules of trade. Trade was even - an ounce of gold for an ounce of salt. The kingdom of Ghana did not have gold mines or salt mines, but Ghana got rich handling the trade of gold for salt.
After a while, word reached the east coast of Africa about the riches to the west. All the east coast traders had to do was cross the Sahara to get there, which was no easy feat. Camels helped them do that. Camel trains began arriving ready to trade. They brought with them silks and spices and other luxury goods, like peacock feathers.
The king of Ghana was very smart. He wanted to protect his people from the foreigners. He was concerned about invasion. No one knew these people. No one knew if they were honest.
First, the king charged these new traders a tax. People had to pay a tax to enter Ghana, and a tax to leave Ghana. Ghana's army kept the trade routes protected from bandits. This system worked for everyone. Some traders did not want to pay the tax. They tried to negotiate directly with the miners to the north and south. But the miners would not work with them. They knew the value Ghana's army offered. They did not trust the new traders. The traders had no choice but to trade through Ghana and pay the tax. This tax helped to make Ghana even more rich than she was already.
Second, the king set up a system of silent barter. The traders from the camel trains never saw the people with whom they were trading. The west coast Africans left gold at a prearranged spot. The camel train traders took the gold and left goods in payment. If they did not leave enough good in payment, all trade stopped. So the camel traders often left more than they needed to, to make sure trade would continue. It was a very clever system. This solved the problem of speaking different languages and risking working with people you did not know or trust.
Third, the king of Ghana set up an entire city for the foreign traders, a place to eat and sleep and relax and worship in their own way. He did not want these Moslem traders, these new people, to disrupt life for his people. This city was built about 6 miles away from the real city.
This system worked very well for a very long time. While nearby, only 6 miles away, camel trains arrived and departed, the people in the capital city did not notice them. They continued to enjoy public prayer in the big open plazas in the real city, and the stories of the Griots, and the dancing at the many festivals. The drums beat. The people sang and laughed and worked. Life was good in ancient Ghana.