#! /usr/bin/python3

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

from common.content_server_runner import run
from tree.pachinko.content_server import ContentServer
import argparse

parser = argparse.ArgumentParser(description='Run a pachinko content server')
parser.add_argument('coordinator', type=str, help='address of the coordinator')
parser.add_argument('address', type=str, help='address to bind to')
parser.add_argument('level', type=int, help="in which level of the tree should this process reside?")
parser.add_argument('position', type=int, help='which bucket of the keyspace should be assigned to this process?')

args = parser.parse_args()

content_server = ContentServer(args.coordinator, args.address, args.level, args.position)
run(content_server)

