Skip to content

Commit afe0b65

Browse files
authored
dashboard: remove the dashboard (ethereum#20279)
This removes the dashboard project. The dashboard was an experimental browser UI for geth which displayed metrics and chain information in real time. We are removing it because it has marginal utility and nobody on the team can maintain it. Removing the dashboard removes a lot of dependency code and shaves 6 MB off the geth binary size.
1 parent 987648b commit afe0b65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+9
-55810
lines changed

cmd/geth/config.go

+7-17
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
cli "gopkg.in/urfave/cli.v1"
2929

3030
"github.com/ethereum/go-ethereum/cmd/utils"
31-
"github.com/ethereum/go-ethereum/dashboard"
3231
"github.com/ethereum/go-ethereum/eth"
3332
"github.com/ethereum/go-ethereum/node"
3433
"github.com/ethereum/go-ethereum/params"
@@ -75,11 +74,10 @@ type ethstatsConfig struct {
7574
}
7675

7776
type gethConfig struct {
78-
Eth eth.Config
79-
Shh whisper.Config
80-
Node node.Config
81-
Ethstats ethstatsConfig
82-
Dashboard dashboard.Config
77+
Eth eth.Config
78+
Shh whisper.Config
79+
Node node.Config
80+
Ethstats ethstatsConfig
8381
}
8482

8583
func loadConfig(file string, cfg *gethConfig) error {
@@ -110,10 +108,9 @@ func defaultNodeConfig() node.Config {
110108
func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
111109
// Load defaults.
112110
cfg := gethConfig{
113-
Eth: eth.DefaultConfig,
114-
Shh: whisper.DefaultConfig,
115-
Node: defaultNodeConfig(),
116-
Dashboard: dashboard.DefaultConfig,
111+
Eth: eth.DefaultConfig,
112+
Shh: whisper.DefaultConfig,
113+
Node: defaultNodeConfig(),
117114
}
118115

119116
// Load config file.
@@ -134,7 +131,6 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
134131
cfg.Ethstats.URL = ctx.GlobalString(utils.EthStatsURLFlag.Name)
135132
}
136133
utils.SetShhConfig(ctx, stack, &cfg.Shh)
137-
utils.SetDashboardConfig(ctx, &cfg.Dashboard)
138134

139135
return stack, cfg
140136
}
@@ -179,12 +175,6 @@ func makeFullNode(ctx *cli.Context) *node.Node {
179175
if cfg.Ethstats.URL != "" {
180176
utils.RegisterEthStatsService(stack, cfg.Ethstats.URL)
181177
}
182-
183-
// Add dashboard daemon if requested. This should be the last registered service
184-
// in order to be able to collect information about the other services.
185-
if ctx.GlobalBool(utils.DashboardEnabledFlag.Name) {
186-
utils.RegisterDashboardService(stack, &cfg.Dashboard, gitCommit)
187-
}
188178
return stack
189179
}
190180

cmd/geth/main.go

+1-13
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ var (
7070
utils.NoUSBFlag,
7171
utils.SmartCardDaemonPathFlag,
7272
utils.OverrideIstanbulFlag,
73-
utils.DashboardEnabledFlag,
74-
utils.DashboardAddrFlag,
75-
utils.DashboardPortFlag,
76-
utils.DashboardRefreshFlag,
7773
utils.EthashCacheDirFlag,
7874
utils.EthashCachesInMemoryFlag,
7975
utils.EthashCachesOnDiskFlag,
@@ -236,16 +232,8 @@ func init() {
236232
app.Flags = append(app.Flags, metricsFlags...)
237233

238234
app.Before = func(ctx *cli.Context) error {
239-
logdir := ""
240-
if ctx.GlobalBool(utils.DashboardEnabledFlag.Name) {
241-
logdir = (&node.Config{DataDir: utils.MakeDataDir(ctx)}).ResolvePath("logs")
242-
}
243-
if err := debug.Setup(ctx, logdir); err != nil {
244-
return err
245-
}
246-
return nil
235+
return debug.Setup(ctx, "")
247236
}
248-
249237
app.After = func(ctx *cli.Context) error {
250238
debug.Exit()
251239
console.Stdin.Close() // Resets terminal mode.

cmd/geth/usage.go

-15
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import (
2222
"io"
2323
"sort"
2424

25-
"strings"
26-
2725
"github.com/ethereum/go-ethereum/cmd/utils"
2826
"github.com/ethereum/go-ethereum/internal/debug"
2927
cli "gopkg.in/urfave/cli.v1"
@@ -116,16 +114,6 @@ var AppHelpFlagGroups = []flagGroup{
116114
utils.EthashDatasetsOnDiskFlag,
117115
},
118116
},
119-
//{
120-
// Name: "DASHBOARD",
121-
// Flags: []cli.Flag{
122-
// utils.DashboardEnabledFlag,
123-
// utils.DashboardAddrFlag,
124-
// utils.DashboardPortFlag,
125-
// utils.DashboardRefreshFlag,
126-
// utils.DashboardAssetsFlag,
127-
// },
128-
//},
129117
{
130118
Name: "TRANSACTION POOL",
131119
Flags: []cli.Flag{
@@ -324,9 +312,6 @@ func init() {
324312
var uncategorized []cli.Flag
325313
for _, flag := range data.(*cli.App).Flags {
326314
if _, ok := categorized[flag.String()]; !ok {
327-
if strings.HasPrefix(flag.GetName(), "dashboard") {
328-
continue
329-
}
330315
uncategorized = append(uncategorized, flag)
331316
}
332317
}

cmd/utils/flags.go

-44
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import (
4242
"github.com/ethereum/go-ethereum/core"
4343
"github.com/ethereum/go-ethereum/core/vm"
4444
"github.com/ethereum/go-ethereum/crypto"
45-
"github.com/ethereum/go-ethereum/dashboard"
4645
"github.com/ethereum/go-ethereum/eth"
4746
"github.com/ethereum/go-ethereum/eth/downloader"
4847
"github.com/ethereum/go-ethereum/eth/gasprice"
@@ -272,26 +271,6 @@ var (
272271
Name: "ulc.onlyannounce",
273272
Usage: "Ultra light server sends announcements only",
274273
}
275-
// Dashboard settings
276-
DashboardEnabledFlag = cli.BoolFlag{
277-
Name: "dashboard",
278-
Usage: "Enable the dashboard",
279-
}
280-
DashboardAddrFlag = cli.StringFlag{
281-
Name: "dashboard.addr",
282-
Usage: "Dashboard listening interface",
283-
Value: dashboard.DefaultConfig.Host,
284-
}
285-
DashboardPortFlag = cli.IntFlag{
286-
Name: "dashboard.host",
287-
Usage: "Dashboard listening port",
288-
Value: dashboard.DefaultConfig.Port,
289-
}
290-
DashboardRefreshFlag = cli.DurationFlag{
291-
Name: "dashboard.refresh",
292-
Usage: "Dashboard metrics collection refresh rate",
293-
Value: dashboard.DefaultConfig.Refresh,
294-
}
295274
// Ethash settings
296275
EthashCacheDirFlag = DirectoryFlag{
297276
Name: "ethash.cachedir",
@@ -1530,13 +1509,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
15301509
}
15311510
}
15321511

1533-
// SetDashboardConfig applies dashboard related command line flags to the config.
1534-
func SetDashboardConfig(ctx *cli.Context, cfg *dashboard.Config) {
1535-
cfg.Host = ctx.GlobalString(DashboardAddrFlag.Name)
1536-
cfg.Port = ctx.GlobalInt(DashboardPortFlag.Name)
1537-
cfg.Refresh = ctx.GlobalDuration(DashboardRefreshFlag.Name)
1538-
}
1539-
15401512
// RegisterEthService adds an Ethereum client to the stack.
15411513
func RegisterEthService(stack *node.Node, cfg *eth.Config) {
15421514
var err error
@@ -1559,22 +1531,6 @@ func RegisterEthService(stack *node.Node, cfg *eth.Config) {
15591531
}
15601532
}
15611533

1562-
// RegisterDashboardService adds a dashboard to the stack.
1563-
func RegisterDashboardService(stack *node.Node, cfg *dashboard.Config, commit string) {
1564-
err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
1565-
var (
1566-
ethServ *eth.Ethereum
1567-
lesServ *les.LightEthereum
1568-
)
1569-
_ = ctx.Service(&ethServ)
1570-
_ = ctx.Service(&lesServ)
1571-
return dashboard.New(cfg, ethServ, lesServ, commit, ctx.ResolvePath("logs")), nil
1572-
})
1573-
if err != nil {
1574-
Fatalf("Failed to register the dashboard service: %v", err)
1575-
}
1576-
}
1577-
15781534
// RegisterShhService configures Whisper and adds it to the given node.
15791535
func RegisterShhService(stack *node.Node, cfg *whisper.Config) {
15801536
if err := stack.Register(func(n *node.ServiceContext) (node.Service, error) {

dashboard/README.md

-58
This file was deleted.

0 commit comments

Comments
 (0)