create-eclipse-app
v1.0.0
Published
A comprehensive starter kit for building dApps on Eclipse - the fastest SVM Layer 2
Downloads
12
Maintainers
Readme
Create Eclipse dApp
A comprehensive starter kit for building decentralized applications on Eclipse - the fastest SVM Layer 2 blockchain.
Quick Start
```bash npx create-eclipse-dapp my-eclipse-app cd my-eclipse-app npm install npm run dev ```
What's Included
This starter kit provides everything you need to build on Eclipse:
Core Infrastructure
- Eclipse Integration: Pre-configured for Eclipse testnet and mainnet
- Wallet Support: Phantom, Solflare, Backpack, and more Solana-compatible wallets
- Network Switching: Easy toggle between Eclipse networks
- RPC Configuration: Optimized Eclipse RPC endpoints
Developer Tools
- Transaction Builder: Send ETH, sign messages, and interact with programs
- Token Operations: Create, mint, and transfer SPL tokens
- NFT Toolkit: Complete NFT creation and management
- Program Inspector: Query and debug Eclipse blockchain state
- Test Suite: Verify Eclipse connectivity and functionality
- Code Generator: Copy-paste examples for common operations
Modern Stack
- React 18 with TypeScript
- Vite for fast development
- Tailwind CSS for styling
- Solana Web3.js for Eclipse interaction
- IPFS Integration via Pinata for metadata storage
Project Structure
``` src/ ├── components/ # React components │ ├── Dashboard.tsx # Main developer dashboard │ ├── TransactionPanel.tsx │ ├── TokenOperations.tsx │ ├── NFTOperations.tsx │ ├── ProgramInteraction.tsx │ └── TestSuite.tsx ├── contexts/ # React contexts │ ├── WalletContextProvider.tsx │ └── NetworkContext.tsx ├── config/ # Configuration │ └── eclipse.ts # Eclipse network settings ├── utils/ # Utilities │ ├── transactions.ts │ └── pinata.ts └── App.tsx # Main app ```
Development Features
Network Configuration
- Eclipse Testnet (default for development)
- Eclipse Mainnet (for production)
- Custom RPC endpoint support
- Automatic network detection
Wallet Integration
- Multiple wallet support
- Connection state management
- Transaction signing
- Message signing
Developer Dashboard
- Faucet: Get test ETH on Eclipse testnet
- Transactions: Send ETH and sign messages
- Tokens: Create and manage SPL tokens
- NFTs: Mint and transfer NFTs with IPFS metadata
- Programs: Inspect and interact with Eclipse programs
- Code: Copy-paste examples for common operations
- Test: Verify Eclipse connectivity and performance
Configuration
Environment Variables
Create a .env file:
```env
Eclipse Network (testnet or mainnet)
VITE_ECLIPSE_NETWORK=testnet
Optional: Custom RPC endpoints
VITE_ECLIPSE_RPC_URL=https://testnet.dev2.eclipsenetwork.xyz
Optional: Pinata for IPFS (NFT metadata)
VITE_PINATA_API_KEY=your_pinata_api_key VITE_PINATA_SECRET_KEY=your_pinata_secret_key VITE_PINATA_JWT=your_pinata_jwt ```
Eclipse Networks
```typescript export const ECLIPSE_NETWORKS = { testnet: { name: 'Eclipse Testnet', rpc: 'https://testnet.dev2.eclipsenetwork.xyz', explorer: 'https://eclipsescan.xyz', faucetAvailable: true, }, mainnet: { name: 'Eclipse Mainnet', rpc: 'https://mainnetbeta-rpc.eclipse.xyz', explorer: 'https://eclipsescan.xyz', faucetAvailable: false, }, } ```
Usage Examples
Basic Wallet Connection
```typescript import { useWallet, useConnection } from '@solana/wallet-adapter-react'
function MyComponent() { const { publicKey, connected } = useWallet() const { connection } = useConnection()
// Your Eclipse dApp logic here } ```
Send ETH Transaction
```typescript import { transferSOL } from './utils/transactions'
const signature = await transferSOL( connection, wallet, recipientAddress, 0.1 // Amount in ETH ) ```
Create SPL Token
```typescript import { createMint } from '@solana/spl-token'
const mint = await createMint( connection, wallet, wallet.publicKey, // mint authority wallet.publicKey, // freeze authority 9 // decimals ) ```
Eclipse-Specific Features
Native ETH
- Eclipse uses ETH as the native gas token (not SOL)
- All transaction fees are paid in ETH
- Faucet provides test ETH on testnet
SVM Compatibility
- Run existing Solana programs without modification
- Use familiar Solana tooling and libraries
- Leverage the Solana ecosystem
Layer 2 Benefits
- Faster transaction finality
- Lower transaction costs
- Ethereum security guarantees
Deployment
Vercel (Recommended)
```bash npm run build vercel --prod ```
Netlify
```bash npm run build
Deploy dist/ folder to Netlify
```
Traditional Hosting
```bash npm run build
Deploy dist/ folder to your hosting provider
```
Contributing
This is a community-driven project. Contributions are welcome!
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
License
MIT License - see LICENSE for details.
Resources
- Eclipse: eclipse.xyz
- Documentation: docs.eclipse.xyz
- Explorer: eclipsescan.xyz
- Discord: Eclipse Labs Discord
Start building on Eclipse today!
