What you need
- Node.js 18 or later
- The Keplr browser extension
- Testnet LUME for fees. Request tokens from the faucet.
Build the app
1
Scaffold the project
Create a new Vite project and install the SDK together with the browser build tooling.
2
Configure Vite
The SDK depends on WASM modules and Node.js globals that need polyfilling in the browser.
vite.config.ts
3
Add the chain configuration
This file holds the testnet chain ID, the gas price, and the chain record the app suggests to Keplr.
src/config.ts
4
Connect the Keplr wallet
experimentalSuggestChain registers the Lumera testnet in Keplr the first time a user connects.src/wallet.ts
5
Create the Cascade client
The
getKeplrSigner helper wraps the Keplr signer with the ADR-036 signArbitrary support that Cascade uses to authenticate storage operations. ADR-036 is the Cosmos standard for signing arbitrary off-chain messages.src/cascade.ts
6
Wire up the UI
The page has three controls. A connect button, an upload button with a file picker, and a download button with an action ID field.
src/main.ts
index.html
7
Run the app
http://localhost:5173, connect Keplr, and upload a file. The returned action ID is your permanent reference. Use it to retrieve the file from anywhere, at any time.Key takeaways
- Use
getKeplrSignerorgetLeapSignerfrom the SDK. They wrap the wallet extension signer with the ADR-036signArbitrarysupport that Cascade requires. - The action ID is your permanent reference. Store it in your database, on chain, or wherever your application tracks state.
- Uploads run in two phases. The SDK first registers the action on chain, then transfers the file to a SuperNode.
- Downloads are streamed. Read from the
ReadableStreamso large files never sit fully in memory.
Next steps
Encrypted storage
Encrypt files client-side before uploading them to Cascade.
Research Archive example
Explore a full publishing platform built on Cascade.
Node.js guide
Run the same SDK on a server with a programmatic signer.