Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/.env.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# OCA_URL sourced from upstream bcgov/aries-oca-bundles repository
OCA_URL=https://raw.githubusercontent.com/bcgov/aries-oca-bundles/main/
MEDIATOR_URL=https://f326-207-194-65-204.ngrok.io?c_i=eyJAdHlwZSI6ICJodHRwczovL2RpZGNvbW0ub3JnL2Nvbm5lY3Rpb25zLzEuMC9pbnZpdGF0aW9uIiwgIkBpZCI6ICI2MjQ0ZThiNS0wNWYzLTRhYWItYjM1Yy1lYWVlMWNmZTAyM2MiLCAicmVjaXBpZW50S2V5cyI6IFsiQ3lqM1BHRUJzQ3RyUGFtTTQyRngza3BlYmR2QWdNd1lGejlFS3RmNnlUN3giXSwgImxhYmVsIjogIk1lZGlhdG9yIiwgInNlcnZpY2VFbmRwb2ludCI6ICJodHRwczovL2YzMjYtMjA3LTE5NC02NS0yMDQubmdyb2suaW8ifQ==
# Enable Pickup V2 live mode + batch pickup (required for Credo-TS mediators)
MEDIATOR_USE_V2_BATCH_PICKUP=false
MEDIATOR_USE_PUSH_NOTIFICATIONS=false
LOAD_STORYBOOK=false
PROOF_TEMPLATE_URL=
Expand Down
11 changes: 5 additions & 6 deletions app/src/hooks/useBCAgentSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ const loadCachedLedgers = async (): Promise<IndyVdrPoolConfig[] | undefined> =>
}
}

const checkMediatorType = async (agent: Agent, mediatorUrl: string): Promise<void> => {
if (mediatorUrl.startsWith('https://mediator-credo-dev.apps.silver.devops.gov.bc.ca/')) {
const configureMessagePickup = async (agent: Agent): Promise<void> => {
if (Config.MEDIATOR_USE_V2_BATCH_PICKUP === 'true') {
await agent.mediationRecipient.initiateMessagePickup(undefined, MediatorPickupStrategy.PickUpV2LiveMode)
} else {
batchPickup(agent)
}
}
Expand Down Expand Up @@ -198,7 +197,7 @@ const useBCAgentSetup = () => {
const restartedAgent = await restartExistingAgent(agentInstanceRef.current, walletSecret)
if (restartedAgent) {
logger.info('Successfully restarted existing agent...')
await checkMediatorType(restartedAgent, mediatorUrl)
await configureMessagePickup(restartedAgent)
periodicPickupCleanupRef.current?.()
periodicPickupCleanupRef.current = startPeriodicTrustPing(restartedAgent, PERIODIC_PICKUP_INTERVAL_MS)
refreshAttestationMonitor(restartedAgent)
Expand All @@ -221,8 +220,8 @@ const useBCAgentSetup = () => {
logger.info('Initializing agent...')
await newAgent.initialize()

logger.info(`checking mediator type for ${mediatorUrl}`)
await checkMediatorType(newAgent, mediatorUrl)
logger.info(`configuring message pickup for ${mediatorUrl}`)
await configureMessagePickup(newAgent)
periodicPickupCleanupRef.current?.()
periodicPickupCleanupRef.current = startPeriodicTrustPing(newAgent, PERIODIC_PICKUP_INTERVAL_MS)

Expand Down
Loading