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

Commit

Permalink
Merge pull request #6096 from trufflesuite/dashboard-open
Browse files Browse the repository at this point in the history
Allow Truffle Dashboard to run without launching a browser window automatically
  • Loading branch information
cliffoo authored Jun 15, 2023
2 parents 8053e2f + 8b19951 commit 3c242ff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
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

0 comments on commit 3c242ff

Please sign in to comment.