Crankshaft Wikipedia
The crankshaft is able to rotate in the engine block due to the main bearings. Since the crankshaft is subject to large sideways forces from each cylinder, bearings are located at various points along the crankshaft, not just one at each end. This was a factor in V8 engines replacing straighteight engines in the 1950s.