Skip to content
Merged
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
39 changes: 39 additions & 0 deletions __tests__/unit/core-container/__stubs__/config/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
cli: {
core: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
relay: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
forger: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
chain: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
snapshot: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
},
}
39 changes: 39 additions & 0 deletions __tests__/utils/config/testnet/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
cli: {
core: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
relay: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
forger: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
chain: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
snapshot: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
},
}
39 changes: 39 additions & 0 deletions __tests__/utils/config/unitnet/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
cli: {
core: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
relay: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
forger: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
chain: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
snapshot: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
},
}
2 changes: 1 addition & 1 deletion packages/core-api/src/handlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export = {
}

// TODO: hook into core-api instead in V3
if (app.has("core-marketplace")) {
if (app.has("core-magistrate-transactions")) {
Businesses.register(server);
Bridgechains.register(server);
}
Expand Down
39 changes: 39 additions & 0 deletions packages/core/bin/config/devnet/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
cli: {
core: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
relay: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
forger: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
chain: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
snapshot: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
},
}
39 changes: 39 additions & 0 deletions packages/core/bin/config/mainnet/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
cli: {
core: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
relay: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
forger: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
chain: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
snapshot: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
},
}
39 changes: 39 additions & 0 deletions packages/core/bin/config/testnet/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
cli: {
core: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
relay: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
forger: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
chain: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
snapshot: {
run: {
plugins: {
include: ["@arkecosystem/core-magistrate-transactions"],
},
},
},
},
}
3 changes: 3 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
"cli-table3": "^0.5.1",
"cli-ux": "^5.3.1",
"dayjs": "^1.8.15",
"deepmerge": "^4.0.0",
"dottie": "^2.0.1",
"env-paths": "^2.2.0",
"envfile": "^3.0.0",
"execa": "^2.0.3",
Expand All @@ -96,6 +98,7 @@
"@types/bip39": "^2.4.2",
"@types/bytebuffer": "^5.0.40",
"@types/cli-progress": "^1.8.1",
"@types/dottie": "^2.0.3",
"@types/execa": "^0.9.0",
"@types/fast-levenshtein": "^0.0.1",
"@types/fs-extra": "^8.0.0",
Expand Down
23 changes: 15 additions & 8 deletions packages/core/src/commands/core/run.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { app } from "@arkecosystem/core-container";
import { flags } from "@oclif/command";
import deepmerge from "deepmerge";
import { CommandFlags } from "../../types";
import { getCliConfig } from "../../utils";
import { BaseCommand } from "../command";

export class RunCommand extends BaseCommand {
Expand Down Expand Up @@ -43,14 +45,19 @@ $ ark core:run --launchMode=seed
public async run(): Promise<void> {
const { flags } = await this.parseWithNetwork(RunCommand);

await this.buildApplication(app, flags, {
options: {
"@arkecosystem/core-p2p": this.buildPeerOptions(flags),
"@arkecosystem/core-blockchain": {
networkStart: flags.networkStart,
await this.buildApplication(
app,
flags,
deepmerge(getCliConfig(flags), {
exclude: [],
options: {
"@arkecosystem/core-p2p": this.buildPeerOptions(flags),
"@arkecosystem/core-blockchain": {
networkStart: flags.networkStart,
},
"@arkecosystem/core-forger": await this.buildBIP38(flags),
},
"@arkecosystem/core-forger": await this.buildBIP38(flags),
},
});
}),
);
}
}
30 changes: 18 additions & 12 deletions packages/core/src/commands/forger/run.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { app } from "@arkecosystem/core-container";
import { flags } from "@oclif/command";
import deepmerge from "deepmerge";
import { CommandFlags } from "../../types";
import { getCliConfig } from "../../utils";
import { BaseCommand } from "../command";

export class RunCommand extends BaseCommand {
Expand All @@ -26,17 +28,21 @@ $ ark forger:run --bip38="..." --password="..."
public async run(): Promise<void> {
const { flags } = await this.parseWithNetwork(RunCommand);

await this.buildApplication(app, flags, {
include: [
"@arkecosystem/core-event-emitter",
"@arkecosystem/core-config",
"@arkecosystem/core-logger",
"@arkecosystem/core-logger-pino",
"@arkecosystem/core-forger",
],
options: {
"@arkecosystem/core-forger": await this.buildBIP38(flags),
},
});
await this.buildApplication(
app,
flags,
deepmerge(getCliConfig(flags), {
include: [
"@arkecosystem/core-event-emitter",
"@arkecosystem/core-config",
"@arkecosystem/core-logger",
"@arkecosystem/core-logger-pino",
"@arkecosystem/core-forger",
],
options: {
"@arkecosystem/core-forger": await this.buildBIP38(flags),
},
}),
);
}
}
22 changes: 14 additions & 8 deletions packages/core/src/commands/relay/run.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { app } from "@arkecosystem/core-container";
import { flags } from "@oclif/command";
import deepmerge from "deepmerge";
import { CommandFlags } from "../../types";
import { getCliConfig } from "../../utils";
import { BaseCommand } from "../command";

export class RunCommand extends BaseCommand {
Expand Down Expand Up @@ -42,14 +44,18 @@ $ ark relay:run --launchMode=seed
public async run(): Promise<void> {
const { flags } = await this.parseWithNetwork(RunCommand);

await super.buildApplication(app, flags, {
exclude: ["@arkecosystem/core-forger"],
options: {
"@arkecosystem/core-p2p": this.buildPeerOptions(flags),
"@arkecosystem/core-blockchain": {
networkStart: flags.networkStart,
await super.buildApplication(
app,
flags,
deepmerge(getCliConfig(flags), {
exclude: ["@arkecosystem/core-forger"],
options: {
"@arkecosystem/core-p2p": this.buildPeerOptions(flags),
"@arkecosystem/core-blockchain": {
networkStart: flags.networkStart,
},
},
},
});
}),
);
}
}
Loading