Short answer
Plain mild steel is the anode most home guides recommend for cast iron electrolysis. Rebar and steel plate are common choices. Other materials, such as stainless steel and graphite, are also used, and each comes with trade-offs.
What the anode does
The anode is connected to the positive side of the power source. During the bath, the anode corrodes, and that corrosion is what carries the current. The rust on the cast iron is what gets converted and loosened. The anode is the part that gives up material, so it is called sacrificial.
Because of this, the anode will wear down over time and leave a sludge in the bath. Expect to check and replace it after a number of runs.
Mild steel
Plain mild steel is the usual choice. It is easy to find, inexpensive and does its job well. Rebar and flat steel plate are the typical forms. Choose a piece that has enough surface area to carry the current, but not so much that it crowds the bath.
Stainless steel and graphite
Some people use stainless steel or graphite instead. Stainless steel is more durable than mild steel but is not always a clear improvement, and some guides warn about fumes or residue. Graphite is an inert option that does not corrode in the same way, so it does not sacrifice itself. It is worth reading up on the specific material before you rely on it.
Avoid galvanized steel
Most guides advise against galvanized steel, which has a zinc coating. The zinc can contaminate the bath, and it is not a good idea to put it in the same solution as the iron you are cleaning.
Placement and spacing
Keep the anode in the water on one side of the tank, facing the cast iron but not touching it. A few inches of water between them is usually enough. Make sure the anode is fully underwater and secured so it does not drift into contact with the iron.
Connecting and checking
Attach the anode to the positive lead of the power source. Check the clamp before switching on. Look at the anode after each run and note how much it has worn. When it wears thin or breaks apart, replace it.
Where this fits in the setup
The tank layout is covered in the article on how to build an electrolysis tank for cast iron. The power side is covered in the piece on whether you can use a battery charger for electrolysis. Timing is covered in how long to electrolysis cast iron.