I might be getting a couple of stories mixed up with this but I read it quite a few years ago.
The main character is a young boy whose mother dies and he is brought up in a brothel where he does odd jobs - he befriends an old prospector who dies and leaves him his old shack which has some gold stashed away. As he gets older he works building a bridge in the town which has tolls for the wagon trains going west and I think he ends up being an Engineer.
As I said it was quite a few years ago and it might have been on asstr.