コード例 #1
0
ファイル: api_methods.py プロジェクト: chris0203/pmes
def get_storage_handler():
    if storage_type == 'ipfs':
        return R8Storage.init_ipfs(host=storage_host,
                                   port=storage_port,
                                   time_limit=storage_download_time_limit)
    else:
        return R8Storage.init_no_storage()
コード例 #2
0
        try:
            flag = Qtum.verify_message(message, signature, pubkey)
        except:
            flag = None
        if not flag:
            result = {"error": 403, "reason": "Invalid signature"}
        else:
            result = await func(*args, **kwargs)
        return result

    return wrapper


if storage_type == 'ipfs':
    storage_handler = R8Storage.init_ipfs(
        host=storage_host,
        port=storage_port,
        time_limit=storage_download_time_limit)
else:
    storage_handler = R8Storage.init_no_storage()


def get_storage_handler():
    storage_handler.reload_http_provider(storage_host, storage_port)
    return storage_handler


if blockchain_type == 'qtum':
    blockchain_handler = R8Blockchain.init_qtum_http(http_provider)
elif blockchain_type == 'eth':
    if ipc_path:
        blockchain_handler = R8Blockchain.init_ethereum_ipc(ipc_path)