I can find only javascript interfaces and documentation to interact with it, but nothing regarding rust? Feels a bit weird to use js library for rust application in rust application. Neither subxt seems to have possibility of using light client either.
1 Answer
If you look at the basic example you can see how to initialize a Smoldot client. Provide the chainspec of the chain you want to sync with and make JSON-RPC requests.
But I agree, a native rust interface would be really nice!
-
1Agreed, but talking with Tomaka he said that there's lots of fun and games that smoldot does to make it work well in the browser and that for now it's a much better idea to do rust to js to smoldot (you will have a lot less pain). For desktop you can use smoldot as a crate - that has worked ok for me: github.com/gilescope/polkapipe/blob/main/src/smoldot_std.rs– SquirrelFeb 14 at 9:40