Skip to content

feat: Adapt ckb light node - #2590

Merged
Keith-CY merged 6 commits into
nervosnetwork:support-light-clientfrom
yanguoyu:feat-light-client
Mar 24, 2023
Merged

feat: Adapt ckb light node#2590
Keith-CY merged 6 commits into
nervosnetwork:support-light-clientfrom
yanguoyu:feat-light-client

Conversation

@yanguoyu

@yanguoyu yanguoyu commented Feb 20, 2023

Copy link
Copy Markdown
Contributor

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.

Comment thread packages/neuron-ui/src/components/NetworkTypeLabel/index.tsx Outdated
Comment thread packages/neuron-ui/src/components/NetworkSetting/index.tsx Outdated
Comment thread packages/neuron-wallet/src/block-sync-renderer/index.ts Outdated
Comment thread packages/neuron-wallet/src/block-sync-renderer/sync/connector.ts Outdated
@Keith-CY
Keith-CY requested a review from devchenyan March 3, 2023 08:27
Comment thread packages/neuron-wallet/src/block-sync-renderer/sync/indexer-connector.ts Outdated
Comment thread packages/neuron-wallet/src/block-sync-renderer/sync/queue.ts Outdated
Comment thread packages/neuron-wallet/src/block-sync-renderer/sync/queue.ts Outdated
Comment thread packages/neuron-wallet/src/block-sync-renderer/sync/queue.ts Outdated
Comment thread packages/neuron-wallet/src/block-sync-renderer/sync/queue.ts
Comment thread packages/neuron-wallet/src/services/live-cell-service.ts Outdated
Comment thread packages/neuron-wallet/src/services/networks.ts Outdated
Comment thread packages/neuron-wallet/src/services/networks.ts Outdated
Comment thread packages/neuron-wallet/src/block-sync-renderer/sync/light-connector.ts Outdated
Comment thread packages/neuron-wallet/src/database/chain/entities/sync-progress.ts Outdated
Comment thread packages/neuron-wallet/src/services/settings.ts Outdated
Comment thread packages/neuron-wallet/src/types/controller.d.ts Outdated
Comment thread packages/neuron-wallet/src/services/light-runner.ts Outdated
Comment thread packages/neuron-wallet/src/services/light-runner.ts Outdated
1. Rename light_testnet to light_client_testnet
2. Better recognize template type name.
3. Exactly function names and variable names.
Comment thread packages/neuron-wallet/src/services/settings.ts Outdated
Comment thread packages/neuron-wallet/src/services/sync-progress.ts Outdated
Comment thread packages/neuron-wallet/src/services/sync-progress.ts Outdated
Comment thread packages/neuron-wallet/src/services/sync-progress.ts Outdated
Comment thread packages/neuron-wallet/src/block-sync-renderer/sync/light-connector.ts Outdated
Comment thread packages/neuron-wallet/src/block-sync-renderer/sync/light-connector.ts Outdated
Comment thread packages/neuron-wallet/src/block-sync-renderer/sync/light-connector.ts Outdated
Comment thread packages/neuron-wallet/src/block-sync-renderer/sync/light-connector.ts Outdated
Comment thread packages/neuron-wallet/src/services/light-runner.ts
Comment thread packages/neuron-wallet/src/services/light-runner.ts Outdated
Comment thread packages/neuron-wallet/src/services/light-runner.ts Outdated
Comment thread packages/neuron-wallet/src/services/light-runner.ts Outdated
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
Copy Markdown
Contributor

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