vega-frontend-monorepo/apps/explorer
Sam Keen e0bcfe7bbe
Feat/231-explorer-infinite-loading-blocks (#306)
* Making a start with react-window-infinite-loader for the blocks infinite scrolling

* WIP block explorer infinte scroll

* WIP pairing

* pairing tidying

* Applied refetch url params more cleanly, moved useFetch to react-helpers lib

* Add notice of new blocks created since page load, some cleanup of blocks-infinite-list.tsx component

* Attempting a refresh of the 'new blocks' value in blocks-refetch.tsx

* Correctly updating state based on previous value

* Update libs/react-helpers/src/hooks/use-fetch.ts

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>

* Update libs/react-helpers/src/hooks/use-fetch.ts

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>

* Update apps/explorer/src/app/components/blocks/blocks-refetch.tsx

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>

* Cleanup from convos and PR

* Prettier formatting

* struggling with websocket tests

* struggling with websocket tests

* Progress on websocket tests for blocks-refetch.tsx

* Tests for blocks-refetch

* Tests for blocks-infinite-list

* Scroll test for blocks-infinite-list

* Defined NOOP in blocks-infinite-list.tsx

* Separate web sockets for each test

* Separate web sockets for each test

* Tweaked e2e tests to account for blocks taking longer to load

* fix tests

* Removed nx knowledge of empty simple-trading-app-e2e for now

* mock at use fetch level instead of at fetch level

* fix edge cases and add further tests

* fix failing e2e tests

* rename test

* Update apps/explorer-e2e/src/support/pages/blocks-page.ts

* Update apps/explorer-e2e/src/support/pages/blocks-page.ts

* rename

* test: use explicit wait for rather than times

* style: remove console

* test: correct env file

* Revert "test: correct env file"

This reverts commit d01d3cfa5e.

* think env var is incorrect

* correct env file

* fix flakiness

* add minor wait for test flakiness

* longer timeout

Co-authored-by: Dexter <dexter.edwards93@gmail.com>
Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
2022-05-13 12:03:08 +01:00
..
src Feat/231-explorer-infinite-loading-blocks (#306) 2022-05-13 12:03:08 +01:00
.babelrc migrate stuff into new NX 2022-02-23 08:53:57 +00:00
.browserslistrc migrate stuff into new NX 2022-02-23 08:53:57 +00:00
.env Feat/231-explorer-infinite-loading-blocks (#306) 2022-05-13 12:03:08 +01:00
.env.capsule Task/Env file for connecting to local capsule (#179) 2022-03-31 10:15:47 -07:00
.env.devent Chore/sentry (#163) 2022-03-29 18:29:29 +01:00
.env.mainnet Chore/sentry (#163) 2022-03-29 18:29:29 +01:00
.env.stagnet1 Chore/sentry (#163) 2022-03-29 18:29:29 +01:00
.env.stagnet2 Chore/sentry (#163) 2022-03-29 18:29:29 +01:00
.env.testnet Chore/sentry (#163) 2022-03-29 18:29:29 +01:00
.eslintrc.json colocate querys with libs 2022-03-29 15:52:51 -07:00
jest.config.js Search implementation (#97) 2022-03-23 09:57:51 +00:00
netlify.toml remove old explorer logic 2022-02-23 08:53:57 +00:00
postcss.config.js add basic tailwind setup 2022-03-04 17:11:56 +00:00
project.json [#168] Use static resources from static.vega.xyz (#205) 2022-04-06 11:36:36 +01:00
README.md Chore/more docs (#331) 2022-05-03 16:32:31 +01:00
tailwind.config.js Added custom module for classes that aren't in Tailwind - allows us to use contextual alternates for Alpha Lyrae 2022-03-30 16:56:48 +01:00
tsconfig.app.json migrate stuff into new NX 2022-02-23 08:53:57 +00:00
tsconfig.json Feat/231-explorer-infinite-loading-blocks (#306) 2022-05-13 12:03:08 +01:00
tsconfig.spec.json Search implementation (#97) 2022-03-23 09:57:51 +00:00
webpack.config.js Chore/sentry (#163) 2022-03-29 18:29:29 +01:00

Explorer

Features

  • Transactions - Showing all transactions and decoded individual transactions
  • Search - Search for block number or transaction hash
  • Blocks - A list of the blocks on our chain and the transactions within each block
  • Assets - List of all assets on the Vega chain
  • Genesis - The initial Genesis configuration the network was started with
  • Governance - Current and past governance proposals
  • Markets - The markets currently open and expired on the Vega network
  • Network Parameters - The current network parameters
  • Parties - Searching for a specific party and the details for that party
  • Validators - The validator information in Vega and Tendermint

Development

First copy the configuration of the application you are starting:

cp .env.[environment] .env.local

Starting the app:

yarn nx serve explorer

Configuration

Example configurations are provided here:

There are a few different configuration options offered for this app:

Flag Purpose
NX_CHAIN_EXPLORER_URL The URL of the chain explorer service for decoding transactions
NX_TENDERMINT_URL The Tendermint REST URL for the Vega consesus engine
NX_TENDERMINT_WEBSOCKET_URL The Tendermint Websocket URL for the Vega consensus engine
NX_VEGA_URL The GraphQl query endpoint of a Vega data node
NX_VEGA_ENV The name of the currently connected vega environment
NX_VEGA_REST The REST URL for the Vega Data Node
NX_EXPLORER_ASSETS Enable the assets page for the explorer
NX_EXPLORER_GENESIS Enable the genesis page for the explorer
NX_EXPLORER_GOVERNANCE Enable the governance page for the explorer
NX_EXPLORER_MARKETS Enable the markets page for the explorer
NX_EXPLORER_NETWORK_PARAMETERS Enable the network parameters page for the explorer
NX_EXPLORER_PARTIES Enable the parties page for the explorer
NX_EXPLORER_VALIDATORS Enable the validators page for the explorer

Testing

To run the minimal set of unit tests, run the following:

yarn nx test explorer

To run the UI automation tests with a mocked API, run:

yarn nx run explorer-e2e:e2e