Concordium / concordium-node-dashboard

Local node dashboard to display the state of the node.
Apache License 2.0
0 stars 0 forks source link

Concordium Node dashboard

Contributor Covenant

A dashboard shipped with the concordium-node for inspecting the current state of the node.

Installation

Install NodeJS and NPM.

Install dependencies using the following from the project root:

npm install

Build the GRPC TypeScript client

Either you install the dependencies manually or you can use a docker image.

Manual install

Install the protoc tool for generating protobuf files:

Install the code generator plugin for GRPC-web to PATH, see instructions on GRPC-web.

Fetch the GRPC proto files for the Concordium-node:

git submodules update --init

Build the GRPC-client for TypeScript:

./build_grpc-web-client.sh

If this succeeds: a directory grpc-api-client should be in your project root.

Docker image

With docker and docker-compose installed run:

docker-compose up build-grpc

Development

Since a browser cannot use the GRPC protocol directly, a proxy must be in front, start an envoy proxy which assumes the Node GRPC api is running on localhost:10000:

docker-compose up grpc-proxy

To watch files and automate the build run:

npm run dev

CAVEATS

Using a node on stagenet

If you want to use a node at a different address, update the envoy config to this address.

Before commiting:

Building

Run the following command, which will create a dist directory containing the build:

npm run build

Releasing

As this is shipped as part of the concordium-node container, the image for the concordium-node contains the runtime dependencies (nginx and envoy), but uses the image 192549843005.dkr.ecr.eu-west-1.amazonaws.com/concordium/node-dashboard for the configuration and static files for the node dashboard.

To build the image run the following in the project root:

docker build . --tag 192549843005.dkr.ecr.eu-west-1.amazonaws.com/concordium/node-dashboard:<some-version>

Make sure to replace <some-version>. This will build the static files and copy the configuration files of envoy and nginx to the image.

Then to push the image, you need the aws-cli and to login before running:

docker push 192549843005.dkr.ecr.eu-west-1.amazonaws.com/concordium/node-dashboard:<some-version>

To use in staging and/or testnet, update the version found in the dockerfiles found in concordium node repository.

Note: The NGINX only exposes the needed calls for the GRPC-web proxy and puts a rate-limit on the requests to support up to two views of the node dashboard per IP.