I've never used electrolysis on guns or gun parts, but, it is the cat's meow for cast iron automotive or tractor parts. I used Red Devil lye in the water, and a piece of stainless steel plate as the electrode thingy, because the rust that is drawn off the to be cleaned part migrates toward the stainless, and then falls to the bottom of the tank. The metal parts come out clean, with a raw cast iron color.
I used a 50 gallon "pickle barrel" made of plastic, and an old 12 volt battery charger. It works like a charm. You can google for more information. You shouldn't do it in an enclosed area, as it generates some hydrogen gas, but, it works excellent.

Best,
Ted