Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/llms-full.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: llms-full

on:
push:
branches: [master]
paths:
- website/docs/**
- website/static/llms.txt
- scripts/generate-llms-full.js

permissions:
contents: write

jobs:
regenerate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: master

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Generate llms-full
run: node scripts/generate-llms-full.js

- name: Commit llms-full
run: |
if git diff --quiet -- website/static/llms-full.txt; then
echo "llms-full.txt is already up to date"
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add website/static/llms-full.txt
git commit -m "docs: update llms-full"
git push origin master
60 changes: 54 additions & 6 deletions scripts/generate-llms-full.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,41 @@ function parseFrontmatter(content) {

const raw = match[1];
const meta = {};
let currentArrayKey = null;

function cleanValue(value) {
value = value.trim();
if (value.startsWith('"') && value.endsWith('"')) {
return value.slice(1, -1);
}
if (value.startsWith("'") && value.endsWith("'")) {
return value.slice(1, -1);
}
return value;
}

for (const line of raw.split("\n")) {
const arrayItemMatch = line.match(/^\s+-\s+(.*)$/);
if (currentArrayKey && arrayItemMatch) {
meta[currentArrayKey].push(cleanValue(arrayItemMatch[1]));
continue;
}

const m = line.match(/^([a-zA-Z0-9_-]+):\s*(.*)$/);
if (m) {
let value = m[2].trim();
if (value.startsWith('"') && value.endsWith('"')) {
value = value.slice(1, -1);
} else if (value.startsWith("'") && value.endsWith("'")) {
value = value.slice(1, -1);
const key = m[1];
const value = m[2].trim();
if (value === "") {
meta[key] = [];
currentArrayKey = key;
} else {
meta[key] = cleanValue(value);
currentArrayKey = null;
}
meta[m[1]] = value;
continue;
}

currentArrayKey = null;
}
return { frontmatter: match[0], body: content.slice(match[0].length), meta };
}
Expand Down Expand Up @@ -295,6 +319,29 @@ function getDocUrl(filePath, meta) {
return `https://docs.nervos.org/docs/${withoutExt}`;
}

function formatPageMetadata(meta) {
const fields = [
["description", "Description"],
["tags", "Tags"],
["audience", "Audience"],
["related", "Related"],
["difficulty", "Difficulty"],
["last_reviewed", "Last reviewed"],
];
const lines = [];

for (const [key, label] of fields) {
const value = meta[key];
if (Array.isArray(value) && value.length > 0) {
lines.push(`${label}: ${value.join(", ")}`);
} else if (typeof value === "string" && value.length > 0) {
lines.push(`${label}: ${value}`);
}
}

return lines.length > 0 ? `${lines.join("\n")}\n\n` : "";
}

function main() {
const files = walk(DOCS_DIR).sort();

Expand Down Expand Up @@ -328,6 +375,7 @@ function main() {
output += `---\n\n`;
output += `## Source: ${relative}\n`;
output += `URL: ${url}\n\n`;
output += formatPageMetadata(meta);
output += cleaned;
output += "\n\n";
}
Expand Down
17 changes: 17 additions & 0 deletions website/docs/ckb-fundamentals/cell-model.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
---
id: cell-model
title: Cell Model
description: "Understand CKB's generalized UTXO Cell Model, including Live Cells, Dead Cells, capacity, ownership, state rent, and scalability."
tags:
- concept
- cell-model
- utxo
- capacity
- transaction
audience:
- dApp developers
- Script developers
related:
- /docs/getting-started/how-ckb-works
- /docs/tech-explanation/cell
- /docs/tech-explanation/capacity
- /docs/tech-explanation/transaction
difficulty: beginner
last_reviewed: 2026-06-24
---

> Nervos CKB inherits Bitcoin’s architecture and creates the Cell Model, a generalized UTXO model as state storage.
Expand Down
20 changes: 18 additions & 2 deletions website/docs/ckb-fundamentals/nervos-blockchain.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
---
id: nervos-blockchain
title: Nervos Blockchain
description: "Get a beginner overview of Nervos CKB as a layered, proof-of-work blockchain for CKBytes, on-chain state, and CKB-VM programs."
tags:
- concept
- layer-1
- ckb-vm
- consensus
audience:
- dApp developers
- Script developers
related:
- /docs/getting-started/how-ckb-works
- /docs/ckb-fundamentals/cell-model
- /docs/ckb-fundamentals/ckb-vm
- /docs/ckb-fundamentals/consensus
difficulty: beginner
last_reviewed: 2026-06-24
---

## What is the Nervos Blockchain?
Expand Down Expand Up @@ -32,9 +48,9 @@ Further information about CKByte will be presented in the [Cell Model](cell-mode

## Programming on Nervos

Nervos offers smart contract programmability using a growing number of well-known general-purpose programming languages, such as Javascript, Rust, and C.
Nervos offers smart contract programmability using a growing number of well-known general-purpose programming languages, such as JavaScript, Rust, and C.

All programs on Nervos can store data and state on-chainwhich makes creating complex applications and customized tokens a simple and straightforward process.
All programs on Nervos can store data and state on-chain, which makes creating complex applications and customized tokens a simple and straightforward process.

All code runs in CKB-VM. CKB-VM is a high-performance RISC-V virtual machine that provides a secure, consistent and flexible environment for developers. Multiple instances of CKB-VM can execute different smart contracts concurrently, which enables substantial scaling improvements through massive parallelization.

Expand Down
18 changes: 17 additions & 1 deletion website/docs/dapp/create-dob.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
---
id: create-dob
title: Create a DOB
description: "Build a dApp that uses the Spore protocol to turn user-provided content into an immutable on-chain digital object on CKB."
tags:
- dapp
- tutorial
- spore
- cell-data
- ccc
audience:
- dApp developers
related:
- /docs/assets-token-standards/spore-protocol
- /docs/dapp/store-data-on-cell
- /docs/dapp/create-token
- /docs/sdk-and-devtool/ccc
difficulty: intermediate
last_reviewed: 2026-06-24
---

import Tabs from "@theme/Tabs";
Expand Down Expand Up @@ -170,7 +186,7 @@ const renderSpore = async () => {

## Congratulations!

By following this tutorial this far, you have mastered how digital-object works on CKB. Here's a quick recap:
After following this tutorial, you have mastered how digital objects work on CKB. Here's a quick recap:

- How Spore protocol works on CKB
- Create an on-chain digital object with a picture via Spore-SDK
Expand Down
18 changes: 17 additions & 1 deletion website/docs/dapp/create-token.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
---
id: create-token
title: Create a Fungible Token
description: "Issue and query a custom fungible token on CKB using the xUDT standard, Type Scripts, Cell data, and the CCC SDK."
tags:
- dapp
- tutorial
- xudt
- type-script
- ccc
audience:
- dApp developers
related:
- /docs/assets-token-standards/xudt
- /docs/dapp/transfer-ckb
- /docs/dapp/create-dob
- /docs/sdk-and-devtool/ccc
difficulty: intermediate
last_reviewed: 2026-06-24
---

import Tabs from "@theme/Tabs";
Expand Down Expand Up @@ -209,7 +225,7 @@ const txHash = await signer.sendTransaction(tx);

## Congratulations!

By following this tutorial this far, you have mastered how custom tokens work on CKB. Here's a quick recap:
After following this tutorial, you have mastered how custom tokens work on CKB. Here's a quick recap:

- Create a CKB transaction containing a xUDT Cell in the outputs
- The data of the xUDT Cell contains the amount number of the token
Expand Down
17 changes: 17 additions & 0 deletions website/docs/dapp/simple-lock.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
---
id: simple-lock
title: Build a Simple Lock
description: "Build a full-stack CKB dApp with a simple hash Lock Script, Script deployment, frontend integration, and token unlocking flow."
tags:
- dapp
- tutorial
- script
- lock-script
- ckb-js-vm
audience:
- dApp developers
- Script developers
related:
- /docs/script/intro-to-script
- /docs/script/js/js-vm
- /docs/script/rust/rust-example-simple-lock
- /docs/dapp/transfer-ckb
difficulty: advanced
last_reviewed: 2026-06-24
---

import Tabs from "@theme/Tabs";
Expand Down
20 changes: 18 additions & 2 deletions website/docs/dapp/transfer-ckb.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
---
id: transfer-ckb
title: Transfer CKB
description: "Build a simple dApp that generates accounts, checks CKB balances, creates a transfer transaction, pays fees, and broadcasts it."
tags:
- dapp
- tutorial
- ccc
- transaction
- cell-model
audience:
- dApp developers
related:
- /docs/getting-started/quick-start
- /docs/sdk-and-devtool/ccc
- /docs/dapp/write-message
- /docs/ckb-fundamentals/cell-model
difficulty: beginner
last_reviewed: 2026-06-24
---

import Tabs from "@theme/Tabs";
Expand Down Expand Up @@ -73,7 +89,7 @@ export async function capacityOf(address: string): Promise<bigint> {
```

:::tip
In Nervos CKB, Shannon is the smallest currency unit, with 1 CKB = 10^8 Shannons. This unit system is similar to Bitcoin's Satoshis, where 1 Bitcoin = 10^8 Satoshis. In CCC SDK, the value handle are mostly done in the **Shannon unit**.
In Nervos CKB, Shannon is the smallest currency unit, with 1 CKB = 10^8 Shannons. This unit system is similar to Bitcoin's Satoshis, where 1 Bitcoin = 10^8 Satoshis. In the CCC SDK, values are mostly handled in the **Shannon unit**.
:::

Next, we can start to transfer balance. Check out the transfer function in `lib.ts`:
Expand Down Expand Up @@ -148,7 +164,7 @@ You can open the console on the browser to see the full transaction to confirm t

## Congratulations!

By following this tutorial this far, you have mastered how balance transfers work on CKB. Here's a quick recap:
After following this tutorial, you have mastered how balance transfers work on CKB. Here's a quick recap:

- The capacity of a Cell indicates both the CKB balance and the amount of data that can be stored in the Cell simultaneously.
- Transferring CKB balance involves transferring some Cells from the sender to the receiver.
Expand Down
26 changes: 21 additions & 5 deletions website/docs/dapp/write-message.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
---
id: store-data-on-cell
title: Store Data on Cell
description: "Build a dApp that writes a text message into CKB Cell data, then reads the Live Cell back and decodes the stored value."
tags:
- dapp
- tutorial
- cell-data
- cell-model
- ccc
audience:
- dApp developers
related:
- /docs/dapp/transfer-ckb
- /docs/ckb-fundamentals/cell-model
- /docs/tech-explanation/outputs-data
- /docs/sdk-and-devtool/ccc
difficulty: beginner
last_reviewed: 2026-06-24
---

import Tabs from "@theme/Tabs";
Expand All @@ -19,7 +35,7 @@ import ExampleLink from "@components/ExampleLink";

In this tutorial, you will learn how to tuck a nifty message - "**Hello CKB!**" - into a <Tooltip>Cell</Tooltip> on the CKB blockchain. Imagine it as sending a message in a bottle, but the ocean is digital, and the bottle is a super secure, tamper-proof CKB Cell!

As you have learned from the first tutorial [Transfer CKB](/docs/dapp/transfer-ckb), the Cell can store any type of data in the data field of Cell structure. Here we will put a text message encoding in hex string format and store it in the data field. Once your words are encoded and inscribed into the blockchain, we'll then get the hex string from the same Cell back and then decode them to the original text message. the method of encoding and decoding is totally up to your favorite, we use the `TextDecoder` for simplicity through the tutorial.
As you learned from the first tutorial, [Transfer CKB](/docs/dapp/transfer-ckb), a Cell can store any type of data in the data field of the Cell structure. Here, we will encode a text message as a hex string and store it in the data field. Once your words are encoded and inscribed into the blockchain, we'll get the hex string back from the same Cell and decode it to the original text message. The encoding and decoding method is up to you; we use `TextDecoder` for simplicity throughout the tutorial.

## Setup Devnet & Run Example

Expand All @@ -40,11 +56,11 @@ You can also read the full code online or download it <ExampleLink path="dApp/st

## Behind the Scene

Open the `lib.ts` file in your project, it lists all the important functions that do the most of work for the project.
Open the `lib.ts` file in your project. It lists the important functions that do most of the work for the project.

### Encode & Decode Message

Since Cell's data field can store any type of data, we need to design our encoding and decoding method for the message we want to read and write on-chain.
Since a Cell's data field can store any type of data, we need to design an encoding and decoding method for the message we want to read and write on-chain.

```ts
export function utf8ToHex(utf8String: string): string {
Expand Down Expand Up @@ -99,7 +115,7 @@ const tx = ccc.Transaction.from({

Here we build the output Cell to store the message data by putting the hex format of the text message into the data field of the output Cell.

Next, we ask CCC to complete the transaction for us with transaction fee:
Next, we ask CCC to complete the transaction for us with a transaction fee:

```ts
// Complete missing parts for transaction
Expand Down Expand Up @@ -145,7 +161,7 @@ export async function readOnChainMessage(txHash: string, index = "0x0") {

## Congratulations!

By following this tutorial this far, you have mastered how storing data on Cells works on CKB. Here's a quick recap:
After following this tutorial, you have mastered how storing data on Cells works on CKB. Here's a quick recap:

- We can store arbitrary data in the `data` field of Cell.
- We need a way to encode and decode our data for understanding and using our raw on-chain data later.
Expand Down
Loading
Loading