dagsvisualizer

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2023 License: Apache-2.0, BSD-2-Clause Imports: 33 Imported by: 0

README

GoShimmer DAGs visualizer

This project was bootstrapped with Create React App.

DAGs visualizer structure

Front-end

DAGs visualizer is a React App that implemented in TypeScript. Here are the main directories in /src:

  • components: contains React components.
  • stores: contains stores that will be injected to components via mobx. Stores handle data from the back-end, and each DAG manages its own store.
  • models: contains data structures of different types of websocket blocks.
  • graph: contains the interface and implementations of visualization, currently there are VivaGraphJS and Cytoscape.js.
  • styles: contains files related to styling.
  • utils: contains utility functions.
Back-end

The .go files forms a plugin that register several events to collect data from each DAG and a back-end server for the webpage.

DAGs visualizer in dev mode

Dev mode has only been tested on Linux.

Docker

Run the yarn development server in a container and add it to the docker-network.

  1. Make sure to set dagsvisualizer.dev to true, to enable GoShimmer to serve assets.
  2. Make sure to set dagsvisualizer.devBindAddress to dagsvisualizer-dev-docker:3000.
  3. Run Goshimmer docker-network.
  4. Go to goshimmer root directory and run script scripts/dags_visualizer_dev_docker.sh. It will install all needed npm modules and create a container with a running development server instance.
  5. Using default port config, you should now be able to access the DAGs visualizer under http://127.0.0.1:8061

To see the changes, you need to manually reload the page.

Pack your changes

We are using pkger to wrap all built frontend files into Go files.

  1. Install pkger if not already done.
  2. Build DAGs visualizezr by running yarn build within the frontend directory.
  3. Run pkger.
  4. pkged.go under root directory of goShimmer should have been modified.
  5. Done. Now you can build goShimmer and your DAGs visualizer changes will be included within the binary.

Documentation

Index

Constants

View Source
const (
	// BlkTypeMeshVertex is the type of the Mesh DAG vertex.
	BlkTypeMeshVertex byte = iota
	// BlkTypeMeshBooked is the type of the Mesh DAG confirmed block.
	BlkTypeMeshBooked
	// BlkTypeMeshConfirmed is the type of the Mesh DAG confirmed block.
	BlkTypeMeshConfirmed
	// BlkTypeMeshTxConfirmationState is the type of the Mesh DAG transaction ConfirmationState.
	BlkTypeMeshTxConfirmationState
	// BlkTypeUTXOVertex is the type of the UTXO DAG vertex.
	BlkTypeUTXOVertex
	// BlkTypeUTXOBooked is the type of the booked transaction.
	BlkTypeUTXOBooked
	// BlkTypeUTXOConfirmationStateChanged is the type of the UTXO DAG vertex confirmation state block.
	BlkTypeUTXOConfirmationStateChanged
	// BlkTypeConflictVertex is the type of the conflict DAG vertex.
	BlkTypeConflictVertex
	// BlkTypeConflictParentsUpdate is the type of the conflict DAG vertex parents updated block.
	BlkTypeConflictParentsUpdate
	// BlkTypeConflictConfirmationStateChanged is the type of the conflict DAG vertex confirmed block.
	BlkTypeConflictConfirmationStateChanged
	// BlkTypeConflictWeightChanged is the type of the conflict DAG vertex weight changed block.
	BlkTypeConflictWeightChanged
)
View Source
const PluginName = "DAGsVisualizer"

PluginName is the name of the dags visualizer plugin.

Variables

View Source
var ErrForbidden = errors.New("forbidden")

ErrForbidden defines the forbidden error.

View Source
var ErrInternalError = errors.New("internal error")

ErrInternalError defines the internal error.

View Source
var ErrInvalidParameter = errors.New("invalid parameter")

ErrInvalidParameter defines the invalid parameter error.

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound defines the not found error.

View Source
var Parameters = &ParametersDefinition{}

Parameters contains the configuration parameters of the dags visualizer plugin.

View Source
var (

	// Plugin is the plugin instance of the dashboard plugin.
	Plugin *node.Plugin
)

Functions

This section is empty.

Types

type ParametersDefinition

type ParametersDefinition struct {
	// BindAddress defines the config flag of the dags visualizer binding address.
	BindAddress string `default:"0.0.0.0:8061" usage:"the bind address of the dags visualizer"`

	// Dev defines the config flag of the  dags visualizer dev mode.
	Dev bool `default:"false" usage:"whether the dags visualizer runs in dev mode"`

	// DevBindAddress defines the config flag of the dags visualizer binding address in development mode.
	DevBindAddress string `default:"0.0.0.0:3000" usage:"the bind address of the dags visualizer in develop mode"`
}

ParametersDefinition contains the definition of configuration parameters used by the dags visualizer plugin.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL