The California Gold Rush included thousands of Mexican and Chinese arrivals . Chinese migrants , many of whom were impoverished peasants , provided the major part of the workforce for the building of Central Pacific portion of the transcontinental railroad . Most of them went home by 1870 when the railroad was finished . Those who stayed on worked in mining , agriculture , and opened small shops such as groceries , laundries and restaurants . Hostility against the Chinese remained high in the western states/territories as seen by the Chinese Massacre Cove episode and the Rock Springs massacre . The Chinese were generally forced into self-sufficient " Chinatowns " in cities such as San Francisco , Portland , and Seattle . In Los Angeles , the last major anti-Chinese riot took place in 1871 , after which local law enforcement grew stronger . In the late 19th century , Chinatowns were squalid slums known for their vice , prostitution , drugs , and violent battles between " tongs " . By the 1930s , however , Chinatowns had become clean , safe and attractive tourist destinations
Rock Springs massacre
Rock Springs massacre
American frontier