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

feat: Adapt ckb light node #2590

Merged

Conversation

yanguoyu
Copy link
Collaborator

@yanguoyu yanguoyu commented Feb 20, 2023

How to switch to light client

  1. ./script/download-ckb.sh
  2. start Neuron
  3. Click Network, choose Light Testnet

Light node sync way
Create a sync_progress table to save sync progress.

  1. Call set_script to sync scripts by light node
  2. Every 5s to check if there exists a queue or else create some sync queue
  3. In a sync queue there will check wheater exists txs between blockStart and blockEnd, if exists, it will send tx hashes to the queue class, or else update the sync_progress
  4. Update the sync_progress after queue class using the tx hashes.

Something needs to do before ready
1. Add test cases for added code. I will add test cases later.

Something needs to do later

  1. Support change light node data path.

@Keith-CY Keith-CY requested a review from devchenyan March 3, 2023 08:27
1. Rename light_testnet to light_client_testnet
2. Better recognize template type name.
3. Exactly function names and variable names.
1. Fix rename table's field name.
2. Remove unnecessary calculations for scriptHash
3. Better function name to split into two functions.
@Keith-CY
Copy link
Collaborator

CKB light client v0.2.2 has been released and is suggested to be used

Ref: https://github.com/nervosnetwork/ckb-light-client/releases/tag/v0.2.2

@Keith-CY Keith-CY changed the base branch from develop to support-light-client March 24, 2023 03:40
@Keith-CY Keith-CY merged commit 2dca3fc into nervosnetwork:support-light-client Mar 24, 2023
yanguoyu added a commit that referenced this pull request Apr 21, 2023
Keith-CY added a commit that referenced this pull request May 29, 2023
Co-authored-by: 严国宇 <841185308@qq.com>
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

Successfully merging this pull request may close these issues.

2 participants