diff --git a/demo/runners/support/agent.py b/demo/runners/support/agent.py index 7b98ee5fbe..48ff4418f5 100644 --- a/demo/runners/support/agent.py +++ b/demo/runners/support/agent.py @@ -1,5 +1,6 @@ import asyncio import asyncpg +import base64 import functools import json import logging @@ -252,7 +253,13 @@ async def create_and_publish_revocation_registry( # if PUBLIC_TAILS_URL is specified, upload tails file to tails server if os.getenv("PUBLIC_TAILS_URL"): - tails_server_hash = await self.admin_PUT_FILE(tails_file, tails_file_url) + b64_genesis = base64.b64encode(str.encode((await default_genesis_txns()))) + tails_server_hash = await self.admin_PUT_FILE( + tails_file, + tails_file_url, + params=None, + headers={"X-Genesis-Transactions": b64_genesis.decode("utf-8")} + ) assert my_tails_hash == tails_server_hash.decode("utf-8") log_msg(f"Public tails file URL: {tails_file_url}") @@ -538,11 +545,11 @@ async def admin_GET_FILE(self, path, params=None) -> bytes: self.log(f"Error during GET FILE {path}: {str(e)}") raise - async def admin_PUT_FILE(self, file, url, params=None) -> bytes: + async def admin_PUT_FILE(self, file, url, params=None, headers=None) -> bytes: try: params = {k: v for (k, v) in (params or {}).items() if v is not None} resp = await self.client_session.request( - "PUT", url, params=params, data=file + "PUT", url, params=params, data=file, headers=headers ) resp.raise_for_status() return await resp.read()