Interactive CLI for scaffolding Walrus applications
npm install @blu1606/create-walrus-appInteractive CLI for scaffolding Walrus applications on the Sui blockchain.
``bashUsing npm
npx @blu1606/create-walrus-app
What is Walrus?
Walrus is a decentralized storage network built on the Sui blockchain, designed for storing and retrieving large files efficiently and securely.
Features
- š Interactive CLI - Easy-to-use prompts guide you through project setup
- š¦ Multiple Templates - Choose from various pre-built templates
- ā” Modern Stack - Built with TypeScript, React, and Vite
- šØ Ready to Use - Includes all necessary dependencies and configurations
- š§ Customizable - Easy to extend and modify for your needs
Available Templates
$3
Basic file upload and download functionality.
- Upload any file to Walrus
- Get Blob ID after upload
- Download file by Blob ID
- File size display$3
Manage multiple files with a persistent index.
- Upload multiple files
- Grid view of all files
- Local index (localStorage)
- Delete files from gallery
- File metadata display$3
Full React application template with TypeScript.
- Component-based architecture
- TypeScript support
- Modern React patterns
- Vite for fast development$3
Integration with Mysten Labs SDK.
- Wallet integration
- Transaction handling
- Sui blockchain interactions$3
Minimal starting point for custom implementations.
- Clean slate
- Essential Walrus utilities
- No UI framework dependenciesUsage
$3
`bash
npx @blu1606/create-walrus-app my-walrus-app
`Follow the interactive prompts:
1. Enter your project name
2. Select a template
3. Choose package manager (npm/pnpm/yarn)
4. Wait for dependencies installation
$3
`bash
cd my-walrus-app
npm run dev
`Your app will be running at
http://localhost:5173Project Structure
`
my-walrus-app/
āāā src/
ā āāā components/ # React components
ā āāā utils/ # Utility functions
ā āāā App.tsx # Main app component
ā āāā main.tsx # Entry point
āāā public/ # Static assets
āāā package.json # Dependencies and scripts
āāā tsconfig.json # TypeScript configuration
āāā vite.config.ts # Vite configuration
`Requirements
- Node.js >= 20.0.0
- npm >= 9.0.0 or pnpm >= 9.0.0
Common Scripts
All templates include these scripts:
`bash
Start development server
npm run devBuild for production
npm run buildPreview production build
npm run previewLint code
npm run lint
`Configuration
$3
Each template comes with Walrus utilities pre-configured. You can customize:
- Aggregator URL: Set in your Walrus client configuration
- Publisher URL: Configure for file uploads
- Storage settings: Adjust based on your needs
$3
Create a
.env file in your project root:`env
VITE_WALRUS_AGGREGATOR_URL=https://aggregator.walrus-testnet.walrus.space
VITE_WALRUS_PUBLISHER_URL=https://publisher.walrus-testnet.walrus.space
`API Reference
$3
`typescript
import { uploadToWalrus } from './utils/walrus';const blob = await uploadToWalrus(file);
console.log('Blob ID:', blob.blobId);
`$3
`typescript
import { downloadFromWalrus } from './utils/walrus';const blob = await downloadFromWalrus(blobId);
// Use the blob data
`Troubleshooting
$3
If you encounter installation errors:
`bash
Clear npm cache
npm cache clean --forceTry with different package manager
pnpm create @blu1606/walrus-app
`$3
Ensure you're using the correct Node.js version:
`bash
node --version # Should be >= 20.0.0
``Check out the examples directory for complete working applications.
Contributions are welcome! Please read our Contributing Guide for details.
- Walrus Documentation
- Sui Documentation
- GitHub Repository
- Issue Tracker
MIT Ā© blu1606
- š§ Email: dongthanhquandtq@gmail.com
- š Issues: GitHub Issues
- š¬ Discussions: GitHub Discussions
---
Made with ā¤ļø for the Walrus and Sui community