Esempio n. 1
0
def start_mn():
    log = get_logger("MasternodeFactor")
    log.critical("\n***Starting Masternode\n")

    DB.set_context('{}_masternode'.format(DB_NAME))

    with DB(should_reset=True) as db:
        pass

    NodeFactory.run_masternode()
Esempio n. 2
0
def start_witness(i):
    log = get_logger("WitnessFactory")

    DB.set_context('{}_witness_{}'.format(DB_NAME, i))
    with DB(should_reset=True) as db:
        pass

    w_info = Constants.Testnet.Witnesses[i]
    log.critical("\n\nStarting witness on slot {} with info {}\n\n".format(
        i, w_info))
    NodeFactory.run_witness(signing_key=w_info['sk'],
                            ip=w_info['url'],
                            name="Witness_{}".format(i + 1))
Esempio n. 3
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))