Skip to content

Commit

Permalink
fix: init storage level
Browse files Browse the repository at this point in the history
  • Loading branch information
bao-sotatek committed May 7, 2024
1 parent 1d0d0e7 commit 1796db2
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/core/agent/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,6 @@ class Agent {
async start(): Promise<void> {
if (!Agent.ready) {
await this.storageSession.open(walletId);
await signifyReady();
const bran = await this.getBran();
// @TODO - foconnor: Review of Tier level.
this.signifyClient = new SignifyClient(
Agent.LOCAL_KERIA_ENDPOINT,
bran,
Tier.low,
Agent.LOCAL_KERIA_BOOT_ENDPOINT
);
try {
await this.signifyClient.connect();
} catch (err) {
await this.signifyClient.boot();
await this.signifyClient.connect();
}
this.basicStorageService = new BasicStorage(
this.getStorageService<BasicRecord>(this.storageSession)
);
Expand All @@ -187,10 +172,28 @@ class Agent {
this.notificationStorage = new NotificationStorage(
this.getStorageService<NotificationRecord>(this.storageSession)
);

await signifyReady();
const bran = await this.getBran();
// @TODO - foconnor: Review of Tier level.
this.signifyClient = new SignifyClient(
Agent.LOCAL_KERIA_ENDPOINT,
bran,
Tier.low,
Agent.LOCAL_KERIA_BOOT_ENDPOINT
);
try {
await this.signifyClient.connect();
} catch (err) {
await this.signifyClient.boot();
await this.signifyClient.connect();
}

this.agentServicesProps = {
signifyClient: this.signifyClient,
eventService: new EventService(),
};

Agent.ready = true;
}
}
Expand Down

0 comments on commit 1796db2

Please sign in to comment.