-
Notifications
You must be signed in to change notification settings - Fork 79
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
Is it possible to provide chainspec changes togehter with the chainspec? #1433
Comments
Hi Pavel, As you can see in the code you posted, the SC extension is using smoldot API instead of Substrate Connect.
|
thanks for help! Pre-requiesites The goal The solution
But I'm wondering, if I'm using the ScProvider is it possible to pass the |
Its not possible to use Substrate connect for that purpose. You should replicate the implementation that extension has, and use the smoldot implementation |
Isn't it possible to modify SC in order to support this feature? |
Substrate connect was created in order to allow easy integration of dApps with smoldot light client, as a polkadot JS wrapper in the browser. We could though add this as a new feature in Substrate-connect as it could help many projects (including yours). What do you think @josepot |
Hey @pgolovkin ! I think that this is a very reasonable feature request. At a first glance it seems like this will require some changes on both APIs: substrate-connect and the SCProvider on polkadotjs, but it's definitely doable. Let me think about the best way to enable this feature and I will get back to you ASAP. |
The reason why this isn't possible is that if you connect to Polkadot/Kusama/Westend/Rococo the substrate-connect extension is supposed to automatically provide the database. And if you connect to a parachain, then providing a database is useless and doesn't speed up syncing at all. The only situation where providing a database would be useful is: if the user doesn't have the extension installed, or if they connect to a relay chain other than Polkadot/Kusama/Westend/Rococo. On the other hand, allowing the web page to store the database was deemed a bit dangerous. It makes it very easy for a malicious script that was somehow injected into the page to modify this database. And if the database is modified, the user would be redirected to the wrong chain, which is basically a phishing attack but with no way of detecting it. And this phishing attack would last forever until the user manually cleans their browser local storage. |
In the context of something like a Wallet built with Electron (just to give an example), it could be very useful to provide the |
I agree with you. And you're right, I'm using Electron that is really useful for building cross-platform desktop application. Using the Electron you're actually running a browser with a single tab and you can't make run you application with the SC browser extension. |
When I use smoldot I'm able to add changes from substate-connect extension to the database. Here is the example
substrate-connect/projects/extension/src/background/index.ts
Line 204 in 3911d97
However I'd like to make the same using the substrate-connect. And I see that I'm able only to run the SCProvider with predefined chainspec without latest addition from the external datasource like database or local storage.
The text was updated successfully, but these errors were encountered: