@@ -550,6 +550,7 @@ async def create_rev_reg(request: web.BaseRequest):
550550 issuer_rev_reg_rec = await revoc .init_issuer_registry (
551551 credential_definition_id ,
552552 max_cred_num = max_cred_num ,
553+ notify = False ,
553554 )
554555 except RevocationNotSupportedError as e :
555556 raise web .HTTPBadRequest (reason = e .message ) from e
@@ -1128,17 +1129,16 @@ async def send_rev_reg_entry(request: web.BaseRequest):
11281129 raise web .HTTPBadRequest (reason = "No endorser connection found" )
11291130
11301131 if not write_ledger :
1131- try :
1132- async with profile . session () as session :
1132+ async with profile . session () as session :
1133+ try :
11331134 connection_record = await ConnRecord .retrieve_by_id (
11341135 session , connection_id
11351136 )
1136- except StorageNotFoundError as err :
1137- raise web .HTTPNotFound (reason = err .roll_up ) from err
1138- except BaseModelError as err :
1139- raise web .HTTPBadRequest (reason = err .roll_up ) from err
1137+ except StorageNotFoundError as err :
1138+ raise web .HTTPNotFound (reason = err .roll_up ) from err
1139+ except BaseModelError as err :
1140+ raise web .HTTPBadRequest (reason = err .roll_up ) from err
11401141
1141- async with profile .session () as session :
11421142 endorser_info = await connection_record .metadata_get (
11431143 session , "endorser_info"
11441144 )
@@ -1295,14 +1295,16 @@ async def on_revocation_registry_init_event(profile: Profile, event: Event):
12951295 meta_data = event .payload
12961296 if "endorser" in meta_data :
12971297 # TODO error handling - for now just let exceptions get raised
1298+ endorser_connection_id = meta_data ["endorser" ]["connection_id" ]
12981299 async with profile .session () as session :
12991300 connection = await ConnRecord .retrieve_by_id (
1300- session , meta_data [ "endorser" ][ "connection_id" ]
1301+ session , endorser_connection_id
13011302 )
13021303 endorser_info = await connection .metadata_get (session , "endorser_info" )
13031304 endorser_did = endorser_info ["endorser_did" ]
13041305 write_ledger = False
13051306 else :
1307+ endorser_connection_id = None
13061308 endorser_did = None
13071309 write_ledger = True
13081310
@@ -1313,10 +1315,8 @@ async def on_revocation_registry_init_event(profile: Profile, event: Event):
13131315 # Generate the registry and upload the tails file
13141316 async def generate (rr_record : IssuerRevRegRecord ) -> dict :
13151317 await rr_record .generate_registry (profile )
1316- await rr_record .set_tails_file_public_uri (
1317- profile ,
1318- f"{ tails_base_url } /{ registry_record .revoc_reg_id } " ,
1319- )
1318+ public_uri = tails_base_url .rstrip ("/" ) + f"/{ registry_record .revoc_reg_id } "
1319+ await rr_record .set_tails_file_public_uri (profile , public_uri )
13201320 rev_reg_resp = await rr_record .send_def (
13211321 profile ,
13221322 write_ledger = write_ledger ,
@@ -1381,6 +1381,7 @@ async def generate(rr_record: IssuerRevRegRecord) -> dict:
13811381 registry_record .cred_def_id ,
13821382 registry_record .max_cred_num ,
13831383 registry_record .revoc_def_type ,
1384+ endorser_connection_id = endorser_connection_id ,
13841385 )
13851386
13861387
@@ -1450,18 +1451,25 @@ async def on_revocation_entry_event(profile: Profile, event: Event):
14501451
14511452
14521453async def on_revocation_registry_endorsed_event (profile : Profile , event : Event ):
1453- """Handle revocation tails file event."""
1454+ """Handle revocation registry endorsement event."""
14541455 meta_data = event .payload
14551456 rev_reg_id = meta_data ["context" ]["rev_reg_id" ]
14561457 revoc = IndyRevocation (profile )
14571458 registry_record = await revoc .get_issuer_rev_reg_record (rev_reg_id )
1458- # NOTE: if there are multiple pods, then the one processing this
1459- # event may not be the one that generated the tails file.
1460- await registry_record .upload_tails_file (profile )
1459+
1460+ if profile .settings .get_value ("endorser.auto_request" ):
1461+ # NOTE: if there are multiple pods, then the one processing this
1462+ # event may not be the one that generated the tails file.
1463+ await registry_record .upload_tails_file (profile )
1464+
1465+ # Post the initial revocation entry
1466+ await notify_revocation_entry_event (
1467+ profile , registry_record .record_id , meta_data
1468+ )
14611469
14621470 # create a "pending" registry if one is requested
14631471 # (this is done automatically when creating a credential definition, so that when a
1464- # revocation registry fills up, we ca continue to issue credentials without a
1472+ # revocation registry fills up, we can continue to issue credentials without a
14651473 # delay)
14661474 create_pending_rev_reg = meta_data ["processing" ].get (
14671475 "create_pending_rev_reg" , False
0 commit comments