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

Add light clients as an alternative to ApiPromise #40

Open
DoubleOTheven opened this issue Apr 6, 2023 · 3 comments
Open

Add light clients as an alternative to ApiPromise #40

DoubleOTheven opened this issue Apr 6, 2023 · 3 comments

Comments

@DoubleOTheven
Copy link
Contributor

DoubleOTheven commented Apr 6, 2023

Feature Request

Add light clients as an alternative to calling third party RPC nodes. Read more here

Suggestion

Implement this. The client takes about 10 seconds to initialize, so we should allow a user to opt in to this as @wottpal suggested. RPC nodes should be default.

Motivation

Decentralization. Cut out the middle man.

Use Cases

@wottpal
Copy link

wottpal commented Apr 10, 2023

Love the motivation behind this, but wouldn't the UX suffer if the "default" is waiting for a Light Client to initialize ~10 seconds? 🤔 IMO, this should be more of a user-initiated switch or should be set by the developers proactively for very sensitive interactions.

@DoubleOTheven
Copy link
Contributor Author

This is good feedback @wottpal. I think you are right. I will update the issue

@DoubleOTheven DoubleOTheven changed the title Add light clients as default Add light clients as an alternative to ApiPromise Apr 12, 2023
@DoubleOTheven
Copy link
Contributor Author

DoubleOTheven commented May 19, 2023

There is a grant from ink!ubator supporting this issue.

Trusted vs Light Client

I think we want to allow either ApiPromise or Light Clients on a per chain basis. Then we could expose these to a developer:

  • setLightClient('astar') - this would set only the client for astar to a light client, but other chain connections remain untouched. Takes a ChainId as an argument.
  • setLightClients() - this would change all clients to light clients.
  • setTrustedApi('aleph') - this would change the client to an apiPromise for only the Aleph Zero connection. Takes ChainId as an argument.
  • setTrustedApi() - this would change all clients to apiPromise instances

You can imagine a UI where the user can choose how they want to connect on a per chain basis or globally.

@nicolad nicolad mentioned this issue Jun 1, 2023
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants