During the California Gold Rush , Sacramento was a major distribution point, a commercial and agricultural center, and a terminus for wagon trains , stagecoaches , riverboats , the telegraph , the Pony Express , and the First Transcontinental Railroad .