예제 #1
0
파일: views.py 프로젝트: tariq786/Peerapps
def check_peercoin_conf(request):
    """
        Get peercoin configuration and status of gpg / wallet / transaction index.
    """
    conf = helpers.get_service_status()
    return HttpResponse(json.dumps({
        "status": "success",
        "config": conf
    }, default=helpers.json_custom_parser), content_type='application/json')
예제 #2
0
파일: views.py 프로젝트: tariq786/Peerapps
def config_automatic_setup(request):
    """
        Used on setup page, setup peercoin configuration for rpc_server.
    """
    forced_updates = {
        "server": "1",
        "txindex": "1"
    }
    optional_updates = {
        "rpcuser": ''.join(random.choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') for _ in range(10)),
        "rpcpassword": ''.join(random.choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') for _ in range(10)),
    }
    helpers.edit_config(forced_updates, optional_updates)

    conf = helpers.get_service_status()
    return HttpResponse(json.dumps({
        "status": "success",
        "config": conf
    }, default=helpers.json_custom_parser), content_type='application/json')