Skip to main content
Every command block below tells you which directory to run it from. Follow top to bottom, nothing else needed.

Prerequisites

1. Clone the repo and install

# any dir
git clone https://github.com/SkepX/charli3-js.git
cd charli3-js/demo-nextjs
npm install
The app imports charli3-js from npm, so there is no SDK build step.

2. Generate the demo wallet and contract address

# in charli3-js/demo-nextjs/
npm run setup
This prints two addresses. Copy the second one (wallet address : addr_test1...) — you will paste it into the faucet next. The seed is saved to demo-nextjs/.wallet.seed (gitignored).
The output lines that start with script address : and wallet address : are printed output, not commands to run.

3. Fund the demo wallet

Go to the Cardano preprod faucet, paste the wallet address from step 2, and send 10 000 tADA. This wallet pays for Round 2 refreshes on the server. Your own Lace wallet is separate.

4. Set the env

Create demo-nextjs/.env.local with your Blockfrost id (and optionally your OpenAI key):
NEXT_PUBLIC_BLOCKFROST_PROJECT_ID=preprod...
OPENAI_API_KEY=sk-...
The Blockfrost id has NEXT_PUBLIC_ in front because Lucid runs in the browser when you sign with Lace. Project ids are scoped and rate-limited so exposing them is fine.

5. Run it

# in charli3-js/demo-nextjs/
npm run dev
Open http://localhost:3000. You should see a live ADA/USD price rendered from chain within a second.

What to click first

  1. Scroll to Run the loop, click Connect Lace, then Deposit 3 tADA.
  2. Click Refresh oracle price. The server pays the fee with the demo seed from step 2.
  3. Click Claim locked tADA. The Aiken validator releases the deposit because the price cleared the threshold.
  4. Scroll to AI agent, drop the sample invoice, and sign the payment with Lace.

Troubleshooting

You’re in demo-nextjs/ but never ran npm install there. Run it, then npm run dev again.
These scripts live in demo-nextjs/package.json, not the repo root. cd demo-nextjs first.
You pasted the example output of step 2 as commands. script address : and wallet address : are printed, not run.
Kupo endpoint hiccup. Retry the page.
Open Lace, Settings, Network, switch to Preprod Testnet, reconnect.
The demo wallet ran out of tADA, or Blockfrost is throttling. Refund at the faucet and try again.
demo-nextjs/artifacts.json is missing. Re-run npm run setup from demo-nextjs/.

Next

Walkthrough

Guided tour of every panel in the UI.

How the SDK works

Round 1 / Round 2, IQR consensus, datum layout.