A command-line interface for the KRNL platform that simplifies deploying and registering smart contracts.
- Simple, guided setup process
- Project initialization with contract templates
- Automated deployment of Token Authority and Main contracts
- Contract verification on Sourcify and Etherscan
- Platform registration with the KRNL registry
- Self-contained with bundled Hardhat - no external dependencies required
npm install -g krnl-cli
# Clone the repository
git clone https://github.com/your-org/krnl-cli.git
cd krnl-cli
# Install dependencies
npm install
# Build the CLI
npm run build
# Create a global link for development
npm link
# Create a new directory for your project
mkdir my-krnl-project
cd my-krnl-project
# Initialize with KRNL CLI
krnl init
# Set up environment variables and wallet
krnl setup
# Deploy Token Authority contract
krnl deploy-ta
# Deploy Main contract
krnl deploy-main
# Register contracts with the KRNL platform
krnl register
# Or run the entire process at once
krnl deploy-all
When you initialize a new project with krnl init
, it creates the following structure:
my-krnl-project/
├── contracts/
│ ├── TokenAuthority.sol
│ ├── KRNL.sol
│ └── Sample.sol
├── hardhat.config.ts
├── package.json
├── .gitignore
├── .env.example
└── README.md
The CLI uses a .env
file for configuration. Run krnl setup
to create and configure this file. Key configuration options include:
-
PRIVATE_KEY_OASIS
: Private key for Oasis Sapphire testnet -
PRIVATE_KEY_SEPOLIA
: Private key for Sepolia testnet -
KERNEL_ID
: Kernel IDs to use for registration -
ETHERSCAN_API_KEY
: API key for contract verification
-
krnl init [directory]
- Initialize a new KRNL project -
krnl setup
- Configure environment variables and create wallets -
krnl deploy-ta
- Deploy Token Authority contract -
krnl deploy-main
- Deploy Main contract -
krnl register
- Register contracts with the KRNL platform -
krnl deploy-all
- Run the entire deployment process
krnl-cli/
├── bin/
│ └── cli.js # CLI entry point
├── src/
│ ├── commands/ # CLI command implementations
│ ├── core/ # Core blockchain logic
│ └── ui/ # UI utilities
├── templates/
│ └── project/ # Project templates
│ └── contracts/ # Smart contract templates
├── package.json
└── tsconfig.json
npm run build
npm test