-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Block Explorer to Demos #1428
Conversation
The explorer API that is available in the hotshot query servicer is available to archival nodes that are backed by postgres sql. In order to make the explorer API available to consume, it needs to be exposed as a module. Adds the explorer API so that it is available for all `storage-sql` featured nodes.
With the `explorer api` being available to to `sequencer`s backed by sql storage, we have the ability to run the `block-explorer` as a docker container. This adds the `block-explorer` to the `process-compose` and `docker-compose` files for use in the demo commands.
The specific port that the `Block Explorer` is being served on should be listed within the `.env` file in order to ensure that there is not a potential for port reuse. In addition this environment variable should be referenced in `docker-compose.yaml` and `process-compose.yaml` where necessary.
The behaviors, features, and modules available within the `sequencer` binary are enabled via a command specified within the command line arguments. Since the explorer is another such module, it too should be configured to be enabled or disabled based on the same configuration pattern. This adds the explorer configuration option for optionally enabling the explorer module. It also links the dependencies of the module in order to ensure that is is enabled correctly.
Since this is the `main` branch of the project, and not a `release` branch, we should refer to the `main` branch of our corresponding docker images.
The http options currently aren't getting passed any explorer options when configured. This is due to missing a configuration call in `init_with_storage` when adding the explorer options.
The `--platform` flag being `linux/amd64` really limits the ability to pull and run the demo on certain machines. It was here due to the `arm64` build timing out. However, this has since been resolved, and this platform flag can now be removed.
The `ExplorerHeader` trait no longer has the `namespace_ids_for_offset` method. Add `ExplorerTransaction` trait implementation The new `ExplorerTransaction` trait implementation allows for the retrieval of a `NamespaceId` from a given `Transaction`.
Add TODO mark for stub implementation to comment Add Tracked issue reference to comment The `reward_balance` method for the `ExplorerHeader` implementation has a stub implementation as the Block Reward is not currently supported within the sequencer. In order to document this effectively, a comment has been added to track it as such, along with a TODO that explains what change will need to happen, and an issue for added visibility / lookup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I also tried it locally and it works great for me
Looks cool. I did notice that some fields are getting updated in the UI while others are not. "Time" increments while "Latest Block" requires a page reload. Also since "Time" after 1min only has 1min precision, it doesn't look like it is incrementing so there's not much to signal to us that things are happening. |
Yeah, the specification for the Block Explorer didn't contain any intention of it automatically refreshing or anything, so it doesn't. The time since last block is just updating so that its referenced timestamp isn't continually out-of-date. |
Closes #1276
This PR:
Adds the
Explorer API
toSequencer
nodes that are backed bySQL Storage
.This is necessary in order for the
block-explorer
to be added to the project when running the demo.Add
Block Explorer
toprocess-compose
anddocker-compose
This adds the
block-explorer
as adocker
deployable to theprocess-compose
anddocker-compose
files so that theBlock Explorer
can be accessed for demo purposes.This PR does not:
Build the
Docker
image for theBlock Explorer
, as that is already done in theblock-explorer
repo:https://github.com/EspressoSystems/espresso-block-explorer
Populate statistics or summary data for
Rollup
information. This is due to this information not being stored in a way that is easily queryable. It is a next implementation detail for theExplorer API
in theHotShot Query Service
.Key places to review:
sequencer/src/state.rs:893
This implements conversion between
FeeAmount
toMonetaryValue
. At the momentMonetaryValue
is backed by ani128
whereasFeeAmount
is backed by aU256
. It is very possible for truncation / overflow here. It is desired to updateMonetaryValue
to allow for a larger precision in the future, but at the moment nothing gets large enough for this to matter yet.How to test this PR:
Once up and everything's settled, you should be able to navigate to http://localhost:3000/ in order to check that the
Block Explorer
is reflecting the current state ofSequencer 1
.Things tested
I have manually tested the landing explorer page, search functionality, and the links between the different pages.