Пример #1
0
def whirlpool_page():
    check_logged_in()

    whirlpool_api_key = 'Not found'
    try:
        whirlpool_api_key = subprocess.check_output(
            "cat /mnt/hdd/mynode/whirlpool/whirlpool-cli-config* | grep -i cli.Apikey= | cut -c 12-",
            shell=True)
    except:
        whirlpool_api_key = 'error'

    whirlpool_status = "Running"
    whirlpool_status_code = get_service_status_code("whirlpool")
    if not is_whirlpool_initialized():
        whirlpool_status = "Waiting on Initialization..."
    elif whirlpool_status_code != 0:
        whirlpool_status = "Inactive"

    # Load page
    templateData = {
        "title": "myNode Whirlpool",
        "ui_settings": read_ui_settings(),
        "local_ip": get_local_ip(),
        "whirlpool_status": whirlpool_status,
        "whirlpool_enabled": is_service_enabled("whirlpool"),
        "whirlpool_initialized": is_whirlpool_initialized(),
        "whirlpool_api_key": whirlpool_api_key
    }
    return render_template('whirlpool.html', **templateData)
Пример #2
0
def whirlpool_page():
    check_logged_in()

    whirlpool_api_key = 'Not found'
    try:
        whirlpool_api_key = subprocess.check_output(
            "cat /mnt/hdd/mynode/whirlpool/whirlpool-cli-config* | grep -i cli.Apikey= | cut -c 12-",
            shell=True)
    except:
        whirlpool_api_key = 'error'

    whirlpool_status, whirlpool_status_color, whirlpool_initialized = get_whirlpool_status(
    )

    # Load page
    templateData = {
        "title": "myNode Whirlpool",
        "ui_settings": read_ui_settings(),
        "local_ip": get_local_ip(),
        "whirlpool_status": whirlpool_status,
        "whirlpool_status_color": whirlpool_status_color,
        "whirlpool_enabled": is_whirlpool_enabled(),
        "whirlpool_initialized": whirlpool_initialized,
        "whirlpool_api_key": whirlpool_api_key
    }
    return render_template('whirlpool.html', **templateData)
Пример #3
0
def electrum_server_page():
    check_logged_in()

    # Make sure data is up to date
    update_electrs_info()

    # Get latest info
    current_block = get_electrum_server_current_block()
    if current_block == None:
        current_block = "Unknown"
    status = get_electrs_status()

    #server_url = get_local_ip() + ":50002:s"
    server_ip = get_local_ip()
    server_standard_port = "50001"
    server_secure_port = "50002"

    # Get IP URLs
    electrs_command = "./electrum -1 -s {}:50002:s".format(server_ip)

    # Get Onion URLs
    electrs_onion_hostname = "..."
    electrs_onion_password = "******"
    electrs_onion_command = "..."
    if os.path.isfile("/var/lib/tor/mynode/hostname"):
        with open("/var/lib/tor/mynode/hostname") as f:
            contents = f.read().split()
            electrs_onion_hostname = contents[0]
            electrs_onion_password = contents[1]
            electrs_onion_command = "./electrum -1 -s {}:50002:s -p socks5:localhost:9050".format(electrs_onion_hostname)
    else:
        electrs_onion_hostname = "disabled"
        electrs_onion_password = "******"
        electrs_onion_command = "disabled"

    # Load page
    templateData = {
        "title": "myNode Electrum Server",
        "port": 50002,
        "status": status,
        "product_key_skipped": skipped_product_key(),
        "current_block": current_block,
        #"server_url": server_url,
        "server_ip": server_ip,
        "server_standard_port": server_standard_port,
        "server_secure_port": server_secure_port,
        "electrs_command": electrs_command,
        "electrs_onion_hostname": electrs_onion_hostname,
        "electrs_onion_password": electrs_onion_password,
        "electrs_onion_command": electrs_onion_command,
        "ui_settings": read_ui_settings()
    }
    return render_template('electrum_server.html', **templateData)
Пример #4
0
def electrum_server_page():
    check_logged_in()

    # Make sure data is up to date
    update_electrs_info()

    # Get latest info
    current_block = get_electrum_server_current_block()
    if current_block == None:
        current_block = "Unknown"
    status = get_electrs_status()
    db_size = get_electrs_db_size(is_testnet_enabled())

    #server_url = get_local_ip() + ":50002:s"
    server_ip = get_local_ip()
    server_standard_port = "50001"
    server_secure_port = "50002"

    # Get IP URLs
    electrs_command = "./electrum -1 -s {}:50002:s".format(server_ip)

    # Get Onion URLs
    electrs_onion_hostname = get_onion_url_electrs()
    electrs_onion_command = "./electrum -1 -s {}:50002:s -p socks5:localhost:9050".format(
        electrs_onion_hostname)

    # Load page
    templateData = {
        "title": "myNode Electrum Server",
        "port": 50002,
        "status": status,
        "db_size": db_size,
        "product_key_skipped": skipped_product_key(),
        "current_block": current_block,
        #"server_url": server_url,
        "server_ip": server_ip,
        "server_standard_port": server_standard_port,
        "server_secure_port": server_secure_port,
        "electrs_command": electrs_command,
        "electrs_onion_hostname": electrs_onion_hostname,
        "electrs_onion_command": electrs_onion_command,
        "ui_settings": read_ui_settings()
    }
    return render_template('electrum_server.html', **templateData)