Private Block Explorer
Like the RPC layer, the block explorer is split into to two versions with the prividium framework: one public-facing and one internal. The internal block explorer mirrors a standard block explorer for a public chain. All transaction data can be accessed by the chain operators.
The public-facing block explorer uses the the Proxy RPC API so that the configured access rules are applied.
Setting up a block explorer
In a new terminal run:
zkstack explorer init --prividium
You can select the default options in the prompts.
This command creates a database to store explorer data and generates a docker compose file with explorer services
at prividium_chain/configs/explorer-docker-compose.yml
.
Next, you need to start the explorer backend services:
zkstack explorer backend
This command uses the previously created docker compose file to start the services required for the explorer.
Finally, in a new terminal you can run the explorer app:
zkstack explorer run
This command will start the dockerized explorer app using configuration from apps/explorer.config.json
file inside
your ecosystem directory. You can edit this file to configure the app if needed.
You can now navigate to the explorer web-app. By default, the explorer frontend starts on
http://127.0.0.1:3010
, you can configure the port in apps.yaml
file.
Switching to an internal explorer
To switch between the public-facing Prividium block explorer and a standard full-access block explorer for internal use:
- Stop the explorer frontend.
- Stop the explorer backend.
- Run
zkstack explorer init
and selectNo
when prompted to use the Prividium explorer. - Restart the explorer backend and frontend services.
Right now both versions of the explorer can't be run at the same time with zkstack
,
but it's possible to configure this manually.
To switch back to a Prividium block explorer, re-run the steps from "Setting up a block explorer".
Using the Block Explorer
To use the public-facing Prividium block explorer, users must first sign in with their wallet. The block explorer then provides the configured level of access based on their account.
Setup options
When initializing the Prividium explorer, there are four options for configuration:
- The explorer database url
- The explorer database name
- The session max age, set in milliseconds, is the time a logged-in session lasts in the block explorer app. The default is one day.
- The session same site value
sets the configuration for when to send session credentials from the API.
The value can be
none
,strict
orlax
. The default option isstrict
.
Upgrading the Explorer
To upgrade your explorer to the latest version:
- Run
zkstackup
to upgrade your version ofzkstack
. - Stop the explorer frontend.
- Stop the explorer backend.
- Run
zkstack explorer init --prividium
. - Restart the explorer backend and frontend services.