Skip to content
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

[tools/debug-ui] Migrate Chain and Chunks Info page #8350

Closed
Tracked by #8356
robin-near opened this issue Jan 13, 2023 · 2 comments
Closed
Tracked by #8356

[tools/debug-ui] Migrate Chain and Chunks Info page #8350

robin-near opened this issue Jan 13, 2023 · 2 comments

Comments

@robin-near
Copy link
Contributor

robin-near commented Jan 13, 2023

Currently, we have an old Debug UI, and a new Debug UI:

  • The old one is in chain/jsonrpc/res/*.html ; these are static files served from nearcore with the Actix Web framework (search for display_debug_html), on the rpc port :3030 of a running nearcore node. For example, see http://35.204.17.24:3030/debug .
  • The new one is in tools/debug-ui ; this is a React + TypeScript project managed by npm. At the moment, it needs to be separately served and will perform the same debug RPC calls as the old pages to render the content. See tools/debug-ui/README.md for simple instructions on how to bring it up and point it to a node to see its debug info.

We're in the process of migrating from the old debug UI to the new debug UI. The first three pages have already been migrated. This task is about migrating the Chain and Chunks Info page. The following is a suggested approach:

  • Gain a basic understanding of how the debug RPC works for this page: (1) look at chain_n_chunk_info.html for when it makes the $.ajax calls; (2) look at the server side - search for chain_processing_status (the ajax call specific to this page) and trace where the handling logic goes.
  • Familiarize yourself with how to develop on the new debug UI (from tools/debug-ui/README.md).
  • Familiarize yourself with basic React development
  • Attempt the migration. Look at https://github.com/near/nearcore/pull/8586/files as well as existing code for example. Feel free to tweak the page as you see fit.
@ghost
Copy link

ghost commented Apr 7, 2023

ghost pushed a commit that referenced this issue Apr 14, 2023
* Migrate Chain and Chunks Info Page #8350

<h1> Problem </h1>
Need migrate chain and chunks info page to Typescript + React framework.

<h1> What has changed </h1>
- Fixed bug on old page for not displaying floating chunks
- Migrated the page with exactly the same format
- used multiple navigation bars

<h1> Testing </h1>
- Ran linter
- Attached before and after screenshots of UI on github issue and pull request
- Manually viewed pages on UI

```
cd nearcore
make debug
nearup run localnet --binary-path ~/Github/near/nearcore/target/debug/
open http://localhost:3030/debug/pages/chain_n_chunk_info

cd nearcore/tools/debug-ui
npm install
npm start
open http://localhost:3000/localhost:3030/chain_and_chunk_info
open http://localhost:3000/localhost:3030/chain_and_chunk_info/chain_info_summary
open http://localhost:3000/localhost:3030/chain_and_chunk_info/floating_chunks
open http://localhost:3000/localhost:3030/chain_and_chunk_info/blocks
```

* Addressed review 1 comments
- Fixed enum format and printing of enum
- Used and instead of conditional operator with a useless else statement
- Added return type to some functions
- Initialize numShards as constant
- Used templated literals
- String concat or string interpolation
@ghost
Copy link

ghost commented Apr 14, 2023

Merged

@ghost ghost closed this as completed Apr 14, 2023
nikurt pushed a commit that referenced this issue Apr 14, 2023
* Migrate Chain and Chunks Info Page #8350

<h1> Problem </h1>
Need migrate chain and chunks info page to Typescript + React framework.

<h1> What has changed </h1>
- Fixed bug on old page for not displaying floating chunks
- Migrated the page with exactly the same format
- used multiple navigation bars

<h1> Testing </h1>
- Ran linter
- Attached before and after screenshots of UI on github issue and pull request
- Manually viewed pages on UI

```
cd nearcore
make debug
nearup run localnet --binary-path ~/Github/near/nearcore/target/debug/
open http://localhost:3030/debug/pages/chain_n_chunk_info

cd nearcore/tools/debug-ui
npm install
npm start
open http://localhost:3000/localhost:3030/chain_and_chunk_info
open http://localhost:3000/localhost:3030/chain_and_chunk_info/chain_info_summary
open http://localhost:3000/localhost:3030/chain_and_chunk_info/floating_chunks
open http://localhost:3000/localhost:3030/chain_and_chunk_info/blocks
```

* Addressed review 1 comments
- Fixed enum format and printing of enum
- Used and instead of conditional operator with a useless else statement
- Added return type to some functions
- Initialize numShards as constant
- Used templated literals
- String concat or string interpolation
nikurt pushed a commit that referenced this issue Apr 18, 2023
* Migrate Chain and Chunks Info Page #8350

<h1> Problem </h1>
Need migrate chain and chunks info page to Typescript + React framework.

<h1> What has changed </h1>
- Fixed bug on old page for not displaying floating chunks
- Migrated the page with exactly the same format
- used multiple navigation bars

<h1> Testing </h1>
- Ran linter
- Attached before and after screenshots of UI on github issue and pull request
- Manually viewed pages on UI

```
cd nearcore
make debug
nearup run localnet --binary-path ~/Github/near/nearcore/target/debug/
open http://localhost:3030/debug/pages/chain_n_chunk_info

cd nearcore/tools/debug-ui
npm install
npm start
open http://localhost:3000/localhost:3030/chain_and_chunk_info
open http://localhost:3000/localhost:3030/chain_and_chunk_info/chain_info_summary
open http://localhost:3000/localhost:3030/chain_and_chunk_info/floating_chunks
open http://localhost:3000/localhost:3030/chain_and_chunk_info/blocks
```

* Addressed review 1 comments
- Fixed enum format and printing of enum
- Used and instead of conditional operator with a useless else statement
- Added return type to some functions
- Initialize numShards as constant
- Used templated literals
- String concat or string interpolation
nikurt pushed a commit that referenced this issue Apr 28, 2023
* Migrate Chain and Chunks Info Page #8350

<h1> Problem </h1>
Need migrate chain and chunks info page to Typescript + React framework.

<h1> What has changed </h1>
- Fixed bug on old page for not displaying floating chunks
- Migrated the page with exactly the same format
- used multiple navigation bars

<h1> Testing </h1>
- Ran linter
- Attached before and after screenshots of UI on github issue and pull request
- Manually viewed pages on UI

```
cd nearcore
make debug
nearup run localnet --binary-path ~/Github/near/nearcore/target/debug/
open http://localhost:3030/debug/pages/chain_n_chunk_info

cd nearcore/tools/debug-ui
npm install
npm start
open http://localhost:3000/localhost:3030/chain_and_chunk_info
open http://localhost:3000/localhost:3030/chain_and_chunk_info/chain_info_summary
open http://localhost:3000/localhost:3030/chain_and_chunk_info/floating_chunks
open http://localhost:3000/localhost:3030/chain_and_chunk_info/blocks
```

* Addressed review 1 comments
- Fixed enum format and printing of enum
- Used and instead of conditional operator with a useless else statement
- Added return type to some functions
- Initialize numShards as constant
- Used templated literals
- String concat or string interpolation
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant