The War between the Swallows and Amazons was fought in Swallows and Amazons in order to decide which ship's captain would be the commodore of the fleet.
At the parley on Wild Cat Island when they meet, Nancy wants an alliance against all enemies .... that will let us fight one another. Titty says That's not an alliance ... that's a treaty of offence and defence. There are lots in the history book. So Nancy agrees: defence against our enemies and all sorts of desperate battles between ourselves whenever we want. So they agree on a Treaty of Offence and Defence which Nancy writes out. John says it looks alright (SA10).
Later Nancy says " ... it'll be very good practice for us to try to capture Swallow, and for you to try to capture Amazon. The one who wins shall be flagship .... if we capture Swallow, then Amazon will be flagship and I'll be commodore" (SA11).
After Titty captures Amazon, Nancy acknowledges that Swallow is .... the flagship (SA21,22).