Quick Start (CLI)


Platform Support (OS)

At the moment, the KRNL CLI is built using a Foundry project as a template.

Platform
Version

macOS

Sequoia (15+)

Linux

Ubuntu 24.04.1, Debian (X)

Windows

WSL2


Prerequisite


Installation and Setup

The KRNL CLI is an application that unifies the setup, deployment, verification, and registration of smart contracts on the KRNL platform into one place.

Installation

# Install the tap and then the cli
brew tap krnl-labs/krnl
brew install krnl-cli

# To verify the installation
krnl --help 

# To upgrade
brew upgrade krnl-cli

Init

This initializes a sample project, containing everything you need to get started with kOS.

krnl init

Setup

krnl setup

When running the setup command, the CLI will ask you for the following information:

  • Etherscan API Key - Used to verify your deployed smart contracts

  • Sepolia RPC URL - Can be configured to point to a local node, otherwise it will default to: https://1rpc.io/sepolia

  • Kernel ID(s) - Choose your desired functionalities from the KRNL Platform "Explore" page.

  • Oasis Sapphire Wallet Private Key - Used for deploying your Token Authority contract

  • Ethereum (Sepolia) Wallet Private Key - Used for deploying your Smart Contract


Deploy, Verify, and Register

krnl deploy-all

This command will execute several functions:

  1. Deploy Token Authority smart contract on Oasis Sapphire network

  2. Verify Token Authority contract on Sourcify

  3. Deploy your main smart contract on Sepolia testnet

  4. Verify your main smart contract on Etherscan, using your Etherscan API Key

  5. Register your deployed smart contracts on the KRNL Registry

After successfully executing this command, the CLI puts you in a stronger position to add new functionalities to your dApp via kOS.


What's Next?

  1. Create a dApp by following our tutorial or by using the KRNL Sandbox.

  2. Explore different kernel examples here.


Frequently Asked Questions

"Forge not found"

This is an error which occurs when your forge installation is not found. This issue can be resolved by running the command krnl setup in your terminal, which will install forge binaries globally in your local system.

Compilation fail due to version mismatch

This error occurs when there is a mismatch between the Solidity compiler version and the version specified in your contract. To resolve this, make sure to use pragma solidity 0.8.24 as the Solidity version in your contract.

Homebrew not found

This is an error which occurs when you don't have homebrew installed locally in your system. Make sure to install homebrew first before installing krnl-cli


Last updated

Was this helpful?