smoldot-light

raw JSON →
0.1.0 verified Mon Apr 27 auth: no python

Python bindings for the smoldot_light Rust crate, providing a lightweight WebAssembly-based Substrate/Polkadot light client. Current version 0.1.0, initial release.

pip install smoldot-light
error ModuleNotFoundError: No module named 'smoldot_light'
cause Package name on PyPI is 'smoldot-light' (hyphen), but module name is 'smoldot_light' (underscore). Installing with hypen works but import uses underscore.
fix
Run: pip install smoldot-light ; then import: import smoldot_light
error AttributeError: module 'smoldot_light' has no attribute 'SmoldotLight'
cause Typo in class name or incorrect import. The class is 'SmoldotLight' (capital S, capital L).
fix
Use: from smoldot_light import SmoldotLight
error OSError: [Errno 38] Function not implemented
cause Underlying Rust native library requires a Linux x86_64 or macOS environment. Might fail on unsupported platforms or containers without proper shared libraries.
fix
Ensure you are on a supported platform (Linux x86_64, macOS). For Docker, use an image with glibc 2.28+.
gotcha The library is in early alpha (v0.1.0). API may change without notice. Not production-ready.
fix Pin to exact version and expect breaking changes.
gotcha SmoldotLight is not thread-safe. Concurrent calls may cause undefined behavior.
fix Use locks or run in a single-threaded context.
deprecated No deprecations yet—library is at initial release.
fix N/A
breaking Import path is `smoldot_light`, not `smoldot_light.client` or other. Incorrect imports will fail with ModuleNotFoundError.
fix Use 'from smoldot_light import SmoldotLight'.

Create a light client instance and add a chain.

from smoldot_light import SmoldotLight

client = SmoldotLight()
# Example: connect to a Polkadot relay chain via a light client
client.add_chain('polkadot')
print(client.chains)