Example #1
0
if __name__ == '__main__':

    # get config data
    data = Config()
    network = Network(data.network)
    u = Util(data.network)
    client = u.get_client(network.api_port)

    dynamic = Dynamic(data.database_user, data.voter_msg, data.network,
                      network.api_port)
    transaction_fee = data.atomic * 0.1

    # initialize db connection
    # get database
    arkdb = ArkDB(network.database, data.database_user,
                  network.database_password, data.public_key)

    #conversion check for pre 2.3 databases
    conversion_check()

    # check to see if db exists, if not initialize db, etc
    db = data.home + '/core2_tbw/' + data.network + '_' + data.delegate + '.db'
    if os.path.exists(db) is False:
        snekdb = SnekDB(data.database_user, data.network, data.delegate)
        initialize()

    # check for new rewards accounts to initialize if any changed
    snekdb = SnekDB(data.database_user, data.network, data.delegate)
    get_rewards()

    # set block count
Example #2
0
                print('\n' + 'Waiting for the next block....' + '\n')
                # sleep 5 seconds between allocations
                time.sleep(2)

        # pause 30 seconds between runs
        time.sleep(data["block_check"])


if __name__ == '__main__':

    data, network = parse_config()

    dynamic = Dynamic(data['dbusername'], data['voter_msg'])
    dynamic.get_node_configs()
    transaction_fee = dynamic.get_dynamic_fee()

    arkdb = ArkDB(network[data['network']]['db'], data['dbusername'],
                  network[data['network']]['db_pw'], data['publicKey'])

    if os.path.exists(tbw_path / 'ark.db') is False:
        snekdb = SnekDB(data['dbusername'])
        initialize()

    # check for new rewards accounts to initialize if any changed
    snekdb = SnekDB(data['dbusername'])
    get_rewards()

    # set block count
    block_count = block_counter()
    process()