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.

This method runs the latest version without installing it globally on your system.

npx create-krnl-app

Option 2: Global Installation

npm install -g create-krnl-app

Then run:

create-krnl-app

Quick Start

To create a new dApp:

  1. Run the CLI:

    npx create-krnl-app
  2. Follow the interactive prompts:

    • Enter a project name

    • Select a framework (Next.js, React, or Expo)

    • Choose a language (JavaScript or TypeScript)

  3. After the setup completes, navigate to your project directory:

    cd your-project-name
  4. Start the development server:

    npm run dev  # For Next.js and React 
    npm start    # For Expo

CLI Options

create-krnl-app supports several command-line options:

Option
Description

--help, -h

Display help information

--verbose, -v

Enable verbose mode for debugging

--no-analytics

Disable anonymous usage analytics

Example usage:

npx create-krnl-app --verbose

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:

Parameter
Default Value

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

Can I use multiple kernels in one application?

Yes, by creating separate components for each kernel and configuring them with different kernel IDs.

How do I deploy my KRNL application?

Deploy the front-end to any web hosting service (Vercel, Netlify, etc.) and ensure the environment variables are correctly set in your deployment environment.

Last updated

Was this helpful?