As you knit the "tube", you start to do decreases, spaced out around the tube, which will cause it to narrow and become a closed top/dome of a hat.
Are you not using a pattern?
Is this your first hat?
There are plenty of free hat patterns you could look at/use to see how this works.
ETA - You will HAVE to transfer needles somehow (DPNs, two circs, magic loop)