# 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.
- Make sure to set
dagsvisualizer.dev
to true, to enable GoShimmer to serve assets. - Make sure to set
dagsvisualizer.devBindAddress
todagsvisualizer-dev-docker:3000
. - Run Goshimmer docker-network.
- 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. - 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.
- Install
pkger
if not already done. - Build DAGs visualizezr by running
yarn build
within thefrontend
directory. - Run
pkger
. pkged.go
under root directory of goShimmer should have been modified.- Done. Now you can build goShimmer and your DAGs visualizer changes will be included within the binary.
# Constants
BlkTypeConflictConfirmationStateChanged is the type of the conflict DAG vertex confirmed block.
BlkTypeConflictParentsUpdate is the type of the conflict DAG vertex parents updated block.
BlkTypeConflictVertex is the type of the conflict DAG vertex.
BlkTypeConflictWeightChanged is the type of the conflict DAG vertex weight changed block.
BlkTypeTangleBooked is the type of the Tangle DAG confirmed block.
BlkTypeTangleConfirmed is the type of the Tangle DAG confirmed block.
BlkTypeTangleTxConfirmationState is the type of the Tangle DAG transaction ConfirmationState.
BlkTypeTangleVertex is the type of the Tangle DAG vertex.
BlkTypeUTXOBooked is the type of the booked transaction.
BlkTypeUTXOConfirmationStateChanged is the type of the UTXO DAG vertex confirmation state block.
BlkTypeUTXOVertex is the type of the UTXO DAG vertex.
PluginName is the name of the dags visualizer plugin.
# Variables
ErrForbidden defines the forbidden error.
ErrInternalError defines the internal error.
ErrInvalidParameter defines the invalid parameter error.
ErrNotFound defines the not found error.
Parameters contains the configuration parameters of the dags visualizer plugin.
Plugin is the plugin instance of the dashboard plugin.
# Structs
ParametersDefinition contains the definition of configuration parameters used by the dags visualizer plugin.