Decrees by the Qing dynasty issued in 1712 and 1724 forbade emigration and overseas trade and were primarily intended to prevent remnant supporters of the Ming dynasty from establishing bases overseas. However, these decrees were widely ignored. Large-scale immigration of Chinese laborers began after China began to receive news of deposits of gold found in California. The Burlingame Treaty with the United States in 1868 effectively lifted any former restrictions and large-scale immigration to the United States began. In order to avoid difficulties with departure, most Chinese gold-seekers embarked on their transpacific voyage from the docks of Hong Kong, a major trading port in the region. Less frequently, they left from the neighboring port of Macau, with the choice usually being decided by distance of either city. Only merchants were able to take their wives and children overseas. The vast majority of Chinese immigrants were peasants, farmers and craftsmen. Young men, who were usually married, left their wives and children behind since they intended to stay in America only temporarily. Wives also remained behind to fulfill their traditional obligation to care for their husbands' parents. The men sent a large part of the money they earned in America back to China. Because it was usual at that time in China to live in confined social nets, families, unions, guilds, and sometimes whole village communities or even regions (for instance, Taishan) sent nearly all of their young men to California. From the beginning of the California gold rush until 1882—when an American federal law ended the Chinese influx—approximately 300,000 Chinese arrived in the United States. Because the chances to earn more money were far better in America than in China, these migrants often remained considerably longer than they had planned initially, despite increasing xenophobia and hostility towards them.