quorum/dashboard
Sai V c215989c10
Quorum geth upgrade to 1.9.7 (#960)
Co-authored-by: amalraj.manigmail.com <amalraj.manigmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Flash Sheridan <flash@pobox.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Nguyen Kien Trung <trung.n.k@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Rob Mulholand <rmulholand@8thlight.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: soc1c <soc1c@users.noreply.github.com>
Co-authored-by: Rafael Matias <rafael@skyle.net>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Lucas Hendren <lhendre2@gmail.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: ywzqwwt <39263032+ywzqwwt@users.noreply.github.com>
Co-authored-by: zcheng9 <zcheng9@hawk.iit.edu>
Co-authored-by: zzy96 <zhou0250@e.ntu.edu.sg>
Co-authored-by: kikilass <36239971+kikilass@users.noreply.github.com>
Co-authored-by: Darrel Herbst <dherbst@gmail.com>
Co-authored-by: Ross <9055337+Chadsr@users.noreply.github.com>
Co-authored-by: Jeffery Robert Walsh <rlxrlps@gmail.com>
Co-authored-by: Marius Kjærstad <sandakersmann@users.noreply.github.com>
Co-authored-by: Piotr Dyraga <piotr.dyraga@keep.network>
Co-authored-by: Guillaume Ballet <gballet@gmail.com>
Co-authored-by: Michael Forney <mforney@mforney.org>
Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
2020-04-29 10:50:56 -04:00
..
assets Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
README.md Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
assets.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
config.go cmd, dashboard: use webpack dev server, remove custom assets (#16263) 2018-03-08 10:22:21 +02:00
cpu.go dashboard: CPU, memory, diskIO and traffic on the footer (#15950) 2018-01-23 22:51:04 +02:00
cpu_windows.go dashboard: CPU, memory, diskIO and traffic on the footer (#15950) 2018-01-23 22:51:04 +02:00
dashboard.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
geoip.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
log.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
message.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
peers.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
system.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00

README.md

Go Ethereum Dashboard

The dashboard is a data visualizer integrated into geth, intended to collect and visualize useful information of an Ethereum node. It consists of two parts:

  • The client visualizes the collected data.
  • The server collects the data, and updates the clients.

The client's UI uses React with JSX syntax, which is validated by the ESLint linter mostly according to the Airbnb React/JSX Style Guide. The style is defined in the .eslintrc configuration file. The resources are bundled into a single bundle.js file using Webpack, which relies on the webpack.config.js. The bundled file is referenced from dashboard.html and takes part in the assets.go too. The necessary dependencies for the module bundler are gathered by Node.js.

Development and bundling

As the dashboard depends on certain NPM packages (which are not included in the go-ethereum repo), these need to be installed first:

$ (cd dashboard/assets && yarn install && yarn flow)

Normally the dashboard assets are bundled into Geth via go-bindata to avoid external dependencies. Rebuilding Geth after each UI modification however is not feasible from a developer perspective. Instead, we can run yarn dev to watch for file system changes and refresh the browser automatically.

$ geth --dashboard --vmodule=dashboard=5
$ (cd dashboard/assets && yarn dev)

To bundle up the final UI into Geth, run go generate:

$ (cd dashboard && go generate)

Static type checking

Since JavaScript doesn't provide type safety, Flow is used to check types. These are only useful during development, so at the end of the process Babel will strip them.

To take advantage of static type checking, your IDE needs to be prepared for it. In case of Atom a configuration guide can be found here: Install the Nuclide package for Flow support, making sure it installs all of its support packages by enabling Install Recommended Packages on Startup, and set the path of the flow-bin which were installed previously by yarn.

For more IDE support install the linter-eslint package too, which finds the .eslintrc file, and provides real-time linting. Atom warns, that these two packages are incompatible, but they seem to work well together. For third-party library errors and auto-completion flow-typed is used.

Have fun

Webpack offers handy tools for visualizing the bundle's dependency tree and space usage.

  • Generate the bundle's profile running yarn stats
  • For the dependency tree go to Webpack Analyze, and import stats.json
  • For the space usage go to Webpack Visualizer, and import stats.json