create-rootstock-app
v1.0.2
Published
Create Rootstock dApps with one command - includes Next.js frontend and Hardhat smart contracts
Maintainers
Readme
create-rootstock-app
The fastest way to create Rootstock dApps
Create Rootstock dApps with one command. Includes smart contracts, frontend, and everything you need to build on Bitcoin's smart contract platform.
⚡ Quick Start
npx create-rootstock-app my-dapp
cd my-dappThat's it! Your Rootstock dApp is ready with:
- 📜 Smart contracts (Hardhat + Solidity)
- 🎨 Frontend (Next.js + TypeScript + Tailwind)
- 🔗 Web3 integration (wagmi + viem)
- ⚙️ Rootstock configuration (testnet & mainnet ready)
🏗️ What's Included
my-dapp/
├── contracts/ # Smart contract development
│ ├── contracts/Counter.sol
│ ├── scripts/deploy.js
│ ├── test/Counter.test.js
│ └── hardhat.config.js
├── frontend/ # Next.js frontend
│ ├── src/components/
│ ├── src/hooks/
│ ├── src/lib/
│ └── tailwind.config.ts
└── README.md🚀 Deploy Your First Contract
# Navigate to contracts directory
cd my-dapp/contracts
# Set up environment
cp .env.example .env
# Add your private key to .env
# Deploy to Rootstock testnet
npm run deploy:testnet
# Or use the direct command
npx hardhat run scripts/deploy.js --network rootstockTestnet🎯 Key Features
- ⚡ Zero Config: Works out of the box
- 🔧 Rootstock Optimized: Pre-configured for Rootstock networks
- 🎨 Modern Stack: Next.js 14, TypeScript, Tailwind CSS
- 🔗 Web3 Ready: wagmi v2 for seamless wallet integration
- 📱 Responsive: Mobile-first UI with dark/light themes
- 🧪 Testing: Comprehensive test suites included
- 📚 TypeScript: Full type safety with generated contract types
🌐 Supported Networks
| Network | Chain ID | RPC | Explorer |
|---------|----------|-----|----------|
| Rootstock Testnet | 31 | https://public-node.testnet.rsk.co | explorer.testnet.rsk.co |
| Rootstock Mainnet | 30 | https://public-node.rsk.co | explorer.rsk.co |
📚 Available Commands
Smart Contracts (contracts/ directory)
npm run compile # Compile contracts
npm test # Run tests
npm run deploy:testnet # Deploy to testnet
npm run deploy:mainnet # Deploy to mainnet
npm run verify:testnet # Verify contract on testnet
npm run verify:mainnet # Verify contract on mainnetFrontend (frontend/ directory)
npm run dev # Start development server
npm run build # Build for production
npm start # Start production server
npm run lint # Run ESLint🛠️ CLI Options
npx create-rootstock-app [project-name] [options]
Options:
--help, -h Show help
--version, -v Show version🔧 Troubleshooting
Common Issues
❌ "Network rskTestnet doesn't exist"
- Use:
npm run deploy:testnet - Or:
npx hardhat run scripts/deploy.js --network rootstockTestnet
❌ "You are not inside a Hardhat project"
- Make sure you're in the
contracts/directory:cd contracts
❌ "Account has no RBTC for gas fees"
- Get testnet RBTC: https://faucet.rsk.co/
📖 Learn More
🤝 Contributing
We welcome contributions! Please feel free to submit issues and pull requests.
📄 License
MIT © Tanishq Gupta
Built with ❤️ for the Rootstock ecosystem
