#! /usr/bin/python3

import sys
sys.path.append(".")

from linear.common.coordinator import Coordinator
import linear.twopc.config as config

if len(sys.argv) != 3:
   raise RuntimeError("Invalid arguments. Call like this <name> <num_partitions>")

coordinator = Coordinator(sys.argv[1], int(sys.argv[2]), config.COORDINATOR_PORT, config.COORDINATOR_PORT_INTERNAL)
while coordinator.running:
    coordinator.update()
    
coordinator.close()
