create-krnl-app
Introduction
create-krnl-app
is a CLI tool designed to help developers quickly bootstrap decentralized applications.
This guide provides comprehensive instructions on using the tool, understanding the generated project structure, and customizing your dApp to utilize kOS for production.
Installation
There are two ways to use create-krnl-app
.
Option 1: Use with npx (recommended)
This method runs the latest version without installing it globally on your system.
Option 2: Global Installation
Then run:
Quick Start
To create a new dApp:
Run the CLI:
Follow the interactive prompts:
Enter a project name
Select a framework (Next.js, React, or Expo)
Choose a language (JavaScript or TypeScript)
After the setup completes, navigate to your project directory:
Start the development server:
CLI Options
create-krnl-app
supports several command-line options:
--help
, -h
Display help information
--verbose
, -v
Enable verbose mode for debugging
--no-analytics
Disable anonymous usage analytics
Example usage:
Framework Options
Next.js (App Router)
Description: A React framework with file-based routing and server-side rendering
Best for: Web applications requiring SEO optimization, server components, and complex routing
Available in: JavaScript and TypeScript
React (Vite)
Description: A lightweight React setup using Vite as the build tool
Best for: Single-page applications (SPAs) with client-side rendering
Available in: JavaScript and TypeScript
Expo (React Native)
Description: A React Native framework for cross-platform mobile app development
Best for: Mobile applications (iOS and Android)
Available in: TypeScript only
Project Configurations
The CLI automatically configures your project with default kOS settings:
Kernel ID
337
Entry ID
0x0a5b7ef4a015c5b577a5cb55828471b45271bdbdcd88b214057967c5f032d60e
Access Token
0x304402205c0879ef6b9859573cfad58dbe0a5c60ca8505159cafbb2b32c68f0f584be9ab02205b62115c0aa8cb0cf9a49fa6b5a793ab74afc69590b03387367b038cbc4bd98b
Contract Address
0x870Ef2B0e4e31E4bC6F0191B88f336d1e872D194
RPC URL
https://v0-0-1-rpc.node.lat
These settings are stored in the .env
file and are used by the KRNL SDK to connect to the appropriate KRNL node and contract.
FAQ
Last updated
Was this helpful?