Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Include information from genesis records #185

Closed
3 tasks done
frol opened this issue Feb 17, 2020 · 1 comment · Fixed by #258
Closed
3 tasks done

Include information from genesis records #185

frol opened this issue Feb 17, 2020 · 1 comment · Fixed by #258

Comments

@frol
Copy link
Collaborator

frol commented Feb 17, 2020

Story

As a user who uses Explorer to get valid information, I want to see the full picture (specifically about accounts) so I can make sure that the network holds the data.

The API is currently only available as an experimental feature (on devnet and betanet): near/nearcore#2109, and there is no near-api-js method yet (so we can work around it with sendJsonRpc).

Implementation Notes

Use sendJsonRpc to query EXPERIMENTAL_genesis_records API, and save accounts to the DB (accounts and access keys tables).

Acceptance Criteria

  • The accounts created in genesis should be counted and included on the Accounts list page
  • The Account details page work fine for the account created in genesis
  • Tested
@frol
Copy link
Collaborator Author

frol commented Mar 25, 2020

@kcole16 I think we should also squeeze this before mainnet as it is quite important, in my opinion, to display complete data on launch.

@frol frol added the Priority 1 label Apr 4, 2020
@frol frol closed this as completed in #258 Apr 22, 2020
frol pushed a commit that referenced this issue Apr 22, 2020
Resolves #185 

## Story

As a user who uses Explorer wants to get valid information, I want to see the full picture (specifically about accounts) so I can make sure that the network holds the data.

## Implementation Notes

backend:

* implemented `saveGenesis` method to insert records into the database. 
* implemented `syncGenesisState` method in the `src/sync.js`
* setup the regular genesis state sync in `src/index.js` (the sync process may fail in the middle and we want to be able to recover)

    NOTE: We repeat the process since there is no reliable way to learn if the sync process was successful (well, in the future, we should at least stop re-syncing after the first successful sync, but currently, it is safer to overdo)
* added `accountIndex` field to make it possible to scroll accounts from genesis. add indexes as transaction table to query 15 accounts.

frontend:

* deleted `getAccountBasic` function since hash and timestamp from genesis will not be null
* fixed `getAccountInfo` to fetch all necessary account information at once
* deleted useless state in `[id].js` since time and hash is already in the props.

## Test Plan

* [x] The accounts created in genesis should be counted and included on the Accounts list page
* [x] The Account details page work fine for the account created in genesis
* [x] Tested

## Migration Plan

Full resync (cheap and dirty)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants