If I were you, I would use 2 X 4" welded wire instead of farm fencing. It comes readily available in 5' heights.
Electric fence wire works like a charm to keep busy dogs inside the fencing.
I would not put it on the top. I would put it about 18 to 24 inches above the ground.
They will touch it once, MAYBE twice, (probably not) and then they will stay OFF your fence.
No digging.
No climbing.
No jumping, pushing, prodding, etc on the fence.
I have used this fencing combination in the past with 100% success to confine Rottweilers who were pushy diggers.
Remember you will need to stretch the fencing VERY TIGHTLY, so you need GOOD wooden posts with reinforcement for the corners, and down the sides in the middle if it's a long distance.
Set your wooden posts DEEP with good cement, and give them a couple days to set before you put up the metal posts and pull the wire.
JENNSLK, electric fencing is NOT cruel, and it is a marvelous way to keep dogs safely inside fenced enclosures.
-----------------------
"It's better to be silent and thought dumb than to speak and remove all doubt"
old proverb....