npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

create-kalp-dapp

v1.0.2

Published

Create Kalp DLT dApps with no build configuration

Downloads

243

Readme

create-kalp-dapp

Kalp DLT

Platform License NPM Version

A full-stack starter template featuring Next.js & Go, designed for building dApps and developing smart contracts on the Kalp DLT blockchain. This starter kit provides a simple greeting dApp to demonstrate interaction with a Kalp DLT smart contract.

🚀 Quick Start

npx create-kalp-dapp <your-dapp-name>

# cd into the directory
cd <your-dapp-name>

📦 Installation

Open your terminal and run:

npx create-kalp-dapp <your-dapp-name>
cd <your-dapp-name>

🏗 Project Structure

After creation, your project should look like this:

<your-dapp-name>/
├── backend/
│   ├── vendor/
│   ├── go.mod
│   ├── go.sum
│   ├── main.go
│   └── krc.go
├── frontend/
│   ├── src/
│   │   ├── app/
│   │   ├── hooks/
│   │   └── utils/
│   ├── .env.local.example
│   ├── next.config.mjs
│   ├── package.json
│   └── tailwind.config.ts
└── README.md

📜 Smart Contract Development

Setting up the Smart Contract Project

  1. Navigate to the smart contract directory:

    cd backend
  2. Install dependencies:

    go mod tidy

Smart Contract Code

The main smart contract file is krc.go. It includes a simple greeting contract with Init, SetGreeting, and GetGreeting functions.

Compiling and Deploying the Smart Contract

  1. Sign Up and Log In to Kalp Studio Platform

  2. Go to Kalp Instant Deployer

  3. Click on "Create New" Smart Contract

  4. Enter the details:

    • Name: Enter a name for your smart contract
    • Category: Choose a category
    • Description: Add a description (optional)

    image

  5. Upload your backend.zip file (zip the contents of the backend folder)

    image

  6. Deploy your contract

After deployment, Kalp Studio will provide you with API endpoints for each function of your smart contract.

image

Generating API Key

In Kalp Studio, navigate to the API key generation section and generate a new API key to authenticate your API requests.

💻 Frontend Development

Setting up the Frontend

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    • Copy .env.local.example to .env.local
    • Update NEXT_PUBLIC_API_KEY and NEXT_PUBLIC_CONTRACT_ID with your Kalp Studio API key and deployed contract ID

Running the Frontend

Start the development server:

npm run dev

Visit http://localhost:3000 to see your dApp in action.

image

🔧 Interacting with the Smart Contract

The frontend includes a simple interface to interact with your greeting smart contract:

  • View the current greeting
  • Set a new greeting

All interactions are handled through the Kalp DLT API, using the endpoints provided by Kalp Studio.

🔑 API Integration

The useKalpApi hook in src/hooks/useKalpApi.tsx handles all API calls to your smart contract. Make sure to update the contract ID and API key in your .env.local file for proper functionality.

➡️ Contributing

We welcome contributions! Please see our CONTRIBUTING.md file for details on how to get started.

⚖️ License

create-kalp-dapp is licensed under the MIT License.

⭐️ If you find this project helpful, please give it a star on GitHub!