The US and Iran have announced a memorandum of understanding to end the war and re-open the Strait of Hormuz.