The court of the Maritime Consulate was set up in the main Mediterranean ports ruled by the Crown to deal with maritime and trading issues, and to exercise criminal jurisdiction, with decisions made by two maritime consuls and one appeals judge. Drawing on the direct precedent of the Carta consulatius riparie Barchinone of 1258, Catalan maritime law and the rules governing the maritime consulates were compiled in the Llibre del Consolat de Mar, a code which spread internationally in the 15th century and became a model of mercantile law.