rewrite to support FPGAs and multiple miners