Here is a link on Blender Artist for help rigging the chain and gears w/ a blend file…
and Like @Sackadoo said, a lot of parenting and roundy-round, back-n-forth, and feety-uppy-downy.
Just about any Tank Track or Locomotive tutorial will give you everything you need, if adapted.