In short, there were several vaccine candidates within days to weeks of the genome being decoded.
What takes time is testing the vaccine candidates for safety and effectiveness. Companies normally go step-by-step. They run a phase-I trial, then evaluate the results and decide whether to go on to a phase-II trial. If they run a phase-II trial, they again wait until the results are in and have been evaluated before moving on to a phase-III trial. That reduces financial risk. In this case, companies began preparing phase-III trials before the phase-II trials were even completed. You can begin enrolling people into the trials and producing the necessary doses before you even know whether the phase-II results are any good. One of the reasons they could do that was because the government was taking on the financial risk.
Technically, Moderna's phase-I trial is not even complete yet: [1]. It runs until November 2021. But Moderna moved forward onto the next phase as soon as it had enough data from the phase-I trial to justify doing so (I assume this meant some combination of safety and efficacy data).