The correct answer is:
The federal government moved the customs house to town.
In 1853 the Washington Territory was created and in 1854 the headquarters of the Puget Sound Customs Collection District house were moved to Port Townsend from Olympia.
The city's harbor then became the official port of entry allowing the economy to prosper as every ship coming from foreign ports would stop to clear customs.