core: Deploy the network explorer alongside all server nodes
Closed this issue · 0 comments
The network explorer is an app we created that provides a browsable web interface that allows users to view all of the actions and sessions on a running Canvas node. It consists of a frontend React app developed using Vite which makes requests to the Canvas Core API.
Right now, if you want to deploy the network explorer the only way to do it is to copy the entire network explorer app and then modify the config in src/server.ts
to use the contract and libp2p config that you are interested in, see https://github.com/canvasxyz/canvas/tree/main/examples/chat-explorer and https://github.com/canvasxyz/canvas/tree/main/examples/common-explorer which are almost identical packages.
Instead of doing this, we want to just serve the network explorer static bundle alongside the canvas node whenever we run the Canvas CLI with canvas run
. This could be done by modifying the Express code here: https://github.com/canvasxyz/canvas/blob/main/packages/cli/src/commands/run.ts#L224. The location of the network explorer bundle could be hard-coded in run.ts
or given as an environment variable or command argument.
We also need to consider how the deployment code would change so that we build the network explorer bundle and then "link" it to Canvas CLI. For example, changing the build command in Railway or adding another step in our Dockerfiles.