Substrate Connect provides a groundbreaking method to engage with Substrate-based blockchains directly in your browser, eliminating the need for an RPC server. By utilizing the smoldot WASM light client, it ensures a secure and efficient connection to the blockchain network without reliance on specific third parties.
The aim of this repository is to offer NPM packages that can be used to:
@substrate/connect, leveraging the excellent Smoldot WASM light client.@substrate/smoldot-discovery. Substrate Connect will automatically leverage these where possible.@substrate/light-client-extension-helpers.We also provide example projects using the above packages, including:
@substrate/connect to obtain information about chains on the Polkadot network.Embedding a light client in browser extensions offers several advantages:
For detailed API usage, refer to the Substrate Connect API documentation.
The core implementations of @subtrate/connect and @substrate/discovery, and some auxiliary packages.
Showcase full implementations of @substrate/connect and @substrate/discovery for a Wallet, Extension or Generic usage.
dApp and Extensions example implementations of @substrate/connect and @substrate/discovery.
This repository utilizes pnpm workspaces and corepack, ensuring the correct version of pnpm is used. For contributions, please review our contributing guidelines to understand our workflow and how to smoothly integrate your contributions to the project.
Follow these steps to install everything and launch a demo if you're hacking on this repository:
Install Prerequisites (tested with the following versions):
npm install -g pnpm)Clone the Repository:
git clone https://github.com/paritytech/substrate-connect.gitcd substrate-connectInstall Dependencies:
corepack pnpm installRun the Extension in Development Mode:
cd projects/extension && corepack pnpm devLaunch the Extension:
cd projects/extension && corepack pnpm startRun the Demo Application:
cd projects/demo && corepack pnpm devTo clean up all build artifacts in workspaces in the repository:
corepack pnpm clean
To clean up all build artifacts and dependencies in workspaces in the repository:
corepack pnpm deep-clean
For releasing a new version of the extension, follow the steps outlined in the release doc.