Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Allow Truffle Dashboard to run without launching a browser window automatically #6096

Merged
merged 2 commits into from
Jun 15, 2023
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
1 change: 1 addition & 0 deletions packages/config/src/configDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const getInitialConfig = ({
dashboard: {
host: "localhost",
port: 24012,
autoOpen: true,
verbose: false
},
ens: {
Expand Down
14 changes: 11 additions & 3 deletions packages/core/lib/commands/dashboard/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ module.exports = {
description:
"Start Truffle Dashboard to sign development transactions using browser wallet",
builder: {
port: {
"port": {
describe: "Specify the port to start the dashboard and RPC endpoint on",
type: "number"
},
host: {
"host": {
describe: "Specify the host to start the dashboard and RPC endpoint on",
type: "string"
},
verbose: {
"no-auto-open": {
describe: "Disable opening dashboard in default browser on start",
type: "boolean"
},
"verbose": {
describe: "Display debug logs for the dashboard server and message bus",
type: "boolean"
}
Expand All @@ -27,6 +31,10 @@ module.exports = {
option: "--host <string>",
description: "Start the dashboard and RPC endpoint on a specific host."
},
{
option: "--no-auto-open",
description: "Disable opening dashboard in default browser on start"
},
{
option: "--verbose",
description:
Expand Down
3 changes: 2 additions & 1 deletion packages/core/lib/commands/dashboard/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ module.exports = async function (options) {

const port = options.port || config.dashboard.port;
const host = options.host || config.dashboard.host;
const autoOpen = options.autoOpen ?? config.dashboard.autoOpen;
const verbose = options.verbose || config.dashboard.verbose;
const rpc = true;

const dashboardServerOptions = { port, host, verbose, rpc };
const dashboardServerOptions = { port, host, autoOpen, verbose, rpc };
const dashboardServer = new DashboardServer(dashboardServerOptions);
await dashboardServer.start();

Expand Down