After the Civil War ended in 1865, California continued to grow rapidly. Independent miners were largely displaced by large corporate mining operations. Railroads began to be built, and both the railroad companies and the mining companies began to hire large numbers of laborers. The decisive event was the opening of the transcontinental railroad in 1869; six days by train brought a traveler from Chicago to San Francisco, compared to six months by ship. The era of comparative protection for California labor ended with the arrival of the railroad. For decades after, labor opposed Chinese immigrant workers and politicians pushed anti-Chinese legislation.