How did this bike dynamo work

The dynamo was fixed on the frame of the bike, right next to the wheel. A small castor came to stand against the tire. When you pedaled, the wheel was spinning, the roulette wheel was running too, and it was producing electricity.
This electricity directly supplied the lamp with the bicycle. The faster you cycled, the stronger the light. When we stopped, the light went out.
The small characteristic sound of the wheel-to-wheel dynamo was almost part of the journey, and I still remember it today.
