Substrate Connect offers an innovative way to interact with Substrate-based blockchains directly in your browser, eliminating the need for an RPC server. By leveraging the smoldot WASM light client, it ensures a secure and efficient connection to the blockchain network without dependency on specific third parties.
Browser limitations on websockets from HTTPS pages make establishing a robust number of peers challenging, as many nodes must be available with TLS. Substrate Connect addresses this issue through a powerful browser extension, allowing chains to stay synced in the background, thereby significantly enhancing the performance of your applications.
When building an application with Substrate Connect, it automatically detects whether the user has the extension installed and utilizes it. If not, it seamlessly creates the WASM light client in-page for them. Built on Polkadot JS, Substrate Connect ensures that your development experience is as smooth as using a traditional RPC server node.
For detailed API usage, refer to the Substrate Connect API documentation.
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):
- Node.js (node) v20.9.0
- pnpm 9.0.6 (
npm install -g pnpm
) - corepack 0.20.0 (bundled with recent Node.js versions)
-
Clone the Repository:
git clone https://github.com/paritytech/substrate-connect.git
- Navigate to the repository root:
cd substrate-connect
-
Install Dependencies:
corepack pnpm install
-
Run the Extension in Development Mode:
- In terminal A:
cd projects/extension && corepack pnpm dev
- In terminal A:
-
Launch the Extension:
- In terminal B:
cd projects/extension && corepack pnpm start
- This opens a Chrome browser window with the extension pre-loaded. Ensure the extension is running.
- In terminal B:
-
Run the Demo Application:
- In terminal C:
cd projects/demo && corepack pnpm dev
- Navigate to the URL logged in the Chrome browser opened in step 5. You should see the extension activate and the demo app log the latest blocks.
- In terminal C:
To 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
To understand how to use Substrate Connect as a fully functional light client wallet, visit the wallet template directory.
For releasing a new version of the extension, follow the steps outlined in the release doc.
- Substrate Connect Documentation Page
- Download from: