-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(evm-api-worker): start API server from Start handler (#724)
* Add start handler * Move identifiers * Rename identifier * Start server from start handler * Start evm worker * Empty boot
- Loading branch information
1 parent
464b5d5
commit ea33dac
Showing
10 changed files
with
54 additions
and
12 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export * from "./identifiers.js"; | ||
export * as Schemas from "./schemas.js"; | ||
export * from "./server.js"; | ||
export * from "./service-provider.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./commit.js"; | ||
export * from "./set-peer-count.js"; | ||
export * from "./start.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { inject, injectable, tagged } from "@mainsail/container"; | ||
import { Contracts, Identifiers } from "@mainsail/contracts"; | ||
import { Providers } from "@mainsail/kernel"; | ||
|
||
@injectable() | ||
export class StartHandler { | ||
@inject(Identifiers.Application.Instance) | ||
protected readonly app!: Contracts.Kernel.Application; | ||
|
||
@inject(Identifiers.State.Store) | ||
private readonly store!: Contracts.State.Store; | ||
|
||
@inject(Identifiers.ServiceProvider.Configuration) | ||
@tagged("plugin", "api-evm") | ||
private readonly configuration!: Providers.PluginConfiguration; | ||
|
||
public async handle(height: number): Promise<void> { | ||
this.store.setHeight(height); | ||
|
||
if (this.configuration.get("server.http.enabled")) { | ||
await this.app.get<Contracts.Api.Server>(Identifiers.Evm.API.HTTP).boot(); | ||
} | ||
|
||
if (this.configuration.get("server.https.enabled")) { | ||
await this.app.get<Contracts.Api.Server>(Identifiers.Evm.API.HTTPS).boot(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters