Beispiel #1
0
def run_delegate(slot_num):
    from cilantro.logger import get_logger
    from cilantro.nodes import NodeFactory
    import os

    log = get_logger("DELEGATE FACTORY")

    d_info = delegates[slot_num]
    d_info['ip'] = os.getenv('HOST_IP')

    NodeFactory.run_delegate(ip=d_info['ip'], signing_key=d_info['sk'])
Beispiel #2
0
def run_delegate(slot_num):
    from cilantro.logger import get_logger
    from cilantro import Constants
    from cilantro.nodes import NodeFactory
    from cilantro.db import DB, DB_NAME
    import os

    log = get_logger("DELEGATE FACTORY")

    d_info = Constants.Testnet.Delegates[slot_num]
    d_info['ip'] = os.getenv('HOST_IP')

    NodeFactory.run_delegate(ip=d_info['ip'], signing_key=d_info['sk'])
Beispiel #3
0
def run_delegate(slot_num):
    from cilantro.logger import get_logger
    from cilantro import Constants
    from cilantro.nodes import NodeFactory
    import os

    log = get_logger("DELEGATE FACTORY")

    d_info = Constants.Testnet.Delegates[slot_num]
    d_info['ip'] = os.getenv('HOST_IP')

    log.critical("Building delegate on slot {} with info {}".format(slot_num, d_info))
    NodeFactory.run_delegate(ip=d_info['ip'], signing_key=d_info['sk'])
Beispiel #4
0
def run_delegate(slot_num):
    from cilantro.logger import get_logger, overwrite_logger_level
    from cilantro.nodes import NodeFactory
    import os
    import logging

    # overwrite_logger_level(logging.WARNING)
    overwrite_logger_level(21)

    d_info = delegates[slot_num]
    d_info['ip'] = os.getenv('HOST_IP')

    NodeFactory.run_delegate(ip=d_info['ip'], signing_key=d_info['sk'], should_reset=True)
Beispiel #5
0
def run_delegate(slot_num):
    from cilantro.logger import get_logger, overwrite_logger_level
    from cilantro import Constants
    from cilantro.nodes import NodeFactory
    import os
    import logging

    overwrite_logger_level(logging.WARNING)

    d_info = Constants.Testnet.Delegates[slot_num]
    d_info['ip'] = os.getenv('HOST_IP')

    NodeFactory.run_delegate(ip=d_info['ip'], signing_key=d_info['sk'])
Beispiel #6
0
def run_delegate(slot_num):
    from cilantro.logger import get_logger, overwrite_logger_level
    from cilantro.nodes import NodeFactory
    from cilantro.constants.testnet import TESTNET_DELEGATES
    import os
    import logging

    # overwrite_logger_level(logging.WARNING)
    # overwrite_logger_level(21)

    d_info = TESTNET_DELEGATES[slot_num]
    d_info['ip'] = os.getenv('HOST_IP')

    NodeFactory.run_delegate(ip=d_info['ip'], signing_key=d_info['sk'], reset_db=True)
Beispiel #7
0
def start_delelegate(i):
    log = get_logger("DelegateFactory")
    db_name = DB_NAME + '_delegate_' + str(i)

    d_info = Constants.Testnet.Delegates[i]
    log.critical(
        "\n***Instantiating a new delegate on slot {} with db name: {}, and info {}\n"
        .format(i, db_name, d_info))

    DB.set_context(db_name)
    with DB(should_reset=True) as db:
        pass

    NodeFactory.run_delegate(ip=d_info['url'],
                             signing_key=d_info['sk'],
                             name="Delegate_{}".format(i + 1))
Beispiel #8
0
def run_delegate(slot_num):
    from cilantro.logger import get_logger, overwrite_logger_level
    from cilantro.constants.testnet import delegates
    from cilantro.nodes import NodeFactory
    import os
    import logging
    from cilantro.logger.base import get_logger
    log = get_logger('D')

    # overwrite_logger_level(logging.WARNING)
    # overwrite_logger_level(21)
    log.critical(slot_num)
    d_info = delegates[slot_num]
    d_info['ip'] = os.getenv('HOST_IP')

    NodeFactory.run_delegate(ip=d_info['ip'],
                             signing_key=d_info['sk'],
                             should_reset=True)
Beispiel #9
0
def run_delegate(slot_num):
    from cilantro.logger import get_logger
    from cilantro import Constants
    from cilantro.nodes import NodeFactory
    from cilantro.db import DB, DB_NAME
    import os

    log = get_logger("DELEGATE FACTORY")

    d_info = Constants.Testnet.Delegates[slot_num]
    port = d_info['url'][-4:]
    d_info['url'] = 'tcp://{}:{}'.format(os.getenv('HOST_IP'), port)

    with DB('{}_delegate_{}'.format(DB_NAME, slot_num),
            should_reset=True) as db:
        pass

    log.critical("Building witness on slot {} with info {}".format(
        slot_num, d_info))
    NodeFactory.run_delegate(ip=d_info['url'], signing_key=d_info['sk'])
Beispiel #10
0
def run_delegate(slot_num):
    from cilantro.logger import get_logger
    from cilantro import Constants
    from cilantro.nodes import NodeFactory
    from cilantro.db import DB, DB_NAME
    import os

    log = get_logger("DELEGATE FACTORY")

    d_info = Constants.Testnet.Delegates[slot_num]
    d_info['ip'] = os.getenv('HOST_IP')

    # Set default database name for this instance
    with DB('{}_delegate_{}'.format(DB_NAME, slot_num),
            should_reset=True) as db:
        pass

    log.critical("Building delegate on slot {} with info {}".format(
        slot_num, d_info))
    NodeFactory.run_delegate(ip=d_info['ip'], signing_key=d_info['sk'])