Skip to content

bloxbean/devkit-hackathon-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yaci DevKit Hackathon Demo

This repository contains examples demonstrating how to use Yaci DevKit with different Cardano SDKs:

  • MeshJS - JavaScript/TypeScript
  • Lucid Evolution - JavaScript/TypeScript
  • Cardano Client Lib (CCL) - Java/Scala/Kotlin

Prerequisites

  • Docker (for Docker-based installation)
  • Node.js (v20.8.0 or higher for npm-based installation)
  • Bun (for running MeshJS and Lucid Evolution examples)
  • JBang (for running CCL examples)

Yaci DevKit Installation

Option 1: Docker Installation (Recommended for local development)

  1. Install Yaci DevKit using curl:

    curl --proto '=https' --tlsv1.2 -LsSf https://devkit.yaci.xyz/install.sh | bash
  2. Start the DevKit:

    devkit start
  3. Create and start a default devnet:

    # Inside the Yaci CLI
    create-node -o --start
  4. Access the web interface at http://localhost:5173

Option 2: NPM Installation (Recommended for CI/CD)

Supported on Linux-x64 & Mac ARM64

npm install -g @bloxbean/yaci-devkit

Start the DevKit:

yaci-devkit up --enable-yaci-store

Verify Installation

The DevKit should be accessible on:

Running the Examples

MeshJS Examples

The MeshJS folder contains examples using Mesh SDK:

  1. Navigate to the meshjs folder:

    cd meshjs
  2. Install dependencies:

    bun install
  3. Run examples:

    # Simple payment transaction
    bun run payment.ts
    
    # Payment splitter with Plutus V3
    bun run payment_splitter_plutusV3.ts

Lucid Evolution Examples

The Lucid Evolution folder contains examples using Lucid Evolution library:

  1. Navigate to the lucid-evo folder:

    cd lucid-evo
  2. Install dependencies:

    bun install
  3. Run examples:

    # Simple payment transaction
    bun run payment.ts
    
    # Plutus V2 example
    bun run plutus_v2.ts
    
    # Plutus V3 example
    bun run plutus_v3.ts

CCL (Cardano Client Lib) Examples

The CCL folder contains Java examples using JBang:

  1. Navigate to the ccl folder:

    cd ccl
  2. Run examples using JBang:

    # Simple transfer example
    jbang SimpleTransfer.java
    
    # Payment splitter example
    jbang PaymentSplitter.java

Project Structure

.
├── meshjs/                          # MeshJS examples
│   ├── payment.ts                   # Simple payment example
│   ├── payment_splitter_plutusV3.ts # Plutus V3 smart contract example
│   └── package.json
├── lucid-evo/                       # Lucid Evolution examples
│   ├── payment.ts                   # Simple payment example
│   ├── plutus_v2.ts                 # Plutus V2 example
│   ├── plutus_v3.ts                 # Plutus V3 example
│   └── package.json
├── ccl/                             # Cardano Client Lib examples
│   ├── SimpleTransfer.java          # Simple transfer example
│   ├── PaymentSplitter.java         # Payment splitter example
│   ├── simple-transfer-plutus.json  # Plutus script for simple transfer
│   └── payment-splitter-plutus.json # Plutus script for payment splitter
└── README.md

DevKit Commands

Useful commands when working with Yaci DevKit:

  • devkit start - Launch containers and start Yaci CLI
  • devkit stop - Stop all containers
  • devkit cli - Run cardano-cli commands
  • devkit ssh - Connect to the container
  • devkit info - Display node information
  • devkit version - Show DevKit version

Yaci CLI Commands

After devkit start command, you should see yaci-cli> prompt. You can use various yaci-cli commands in this prompt:

Common Commands

create-node - Creates a devnet node with configurable parameters

create-node [options]

Example: create-node -o --start

reset - Clears data and logs, then restarts the devnet to initial state

reset

stop - Halts the local devnet without removing data

stop

exit - Terminates the node, services, and CLI session

exit

topup - Funds an address with specified ADA amount

topup [--address String] [--value double]

Example: topup addr_test1qrz... 45000

default-addresses - Displays 20 pre-funded default addresses from test mnemonic

default-addresses

show-faucet-addresses - Lists faucet addresses used for funding operations

show-faucet-addresses

utxos - Retrieves UTXOs for a specified address

utxos [address] [--pretty-print-inline-datum]

tip - Shows node tip; displays all node tips in multi-node mode

tip

info - Displays node information

info

Log Commands

  • logs - Display node logs
  • yaci-store-logs - Display Yaci Store logs
  • ogmios-logs - Display Ogmios logs
  • kupo-logs - Display Kupo logs

For a complete list of all available commands, see the Yaci DevKit Commands Reference.

Customizing Block Time

You can customize the devnet configuration when creating a node:

create-node -o --start --block-time 0.5 --slot-length 0.5 --epoch-length 50

Parameters:

  • --block-time - Time between blocks in seconds
  • --slot-length - Slot duration in seconds
  • --epoch-length - Number of slots per epoch

CI/CD Integration

This repository includes a GitHub Actions workflow that automatically runs all examples with Yaci DevKit. The workflow can be manually triggered from the Actions tab.

See .github/workflows/devkit-ci.yml for the complete CI configuration.

Resources

Troubleshooting

Port conflicts

If you encounter port conflicts, ensure ports 3001, 8080, and 5173 are available.

Docker not running

Make sure Docker is installed and running before executing devkit start.

Node version issues

Ensure you're using Node.js v20.8.0 or higher for npm-based installation.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published