weavedb
БесплатноБез исполняемых скриптовНе проверенDecentralized database protocol with zero-knowledge proofs and permanent storage on Arweave
Об этом скилле
WeaveDB Skill
Comprehensive assistance with WeaveDB - a decentralized database protocol built on Arweave with zero-knowledge proofs, permanent storage, and configuration-driven design.
When to Use This Skill
This skill should be triggered when:
- Building decentralized applications with permanent data storage
- Implementing WeaveDB databases with schema validation
- Creating social dapps or data-driven applications
- Setting up WeaveDB local nodes or deployments
- Working with WeaveDB authentication and authorization rules
- Integrating WeaveDB with Next.js or React frontends
- Debugging WeaveDB queries or configuration issues
- Learning WeaveDB best practices and patterns
Quick Reference
Common Patterns
1. Project Initialization
npx wdb-cli create mydb && cd mydb
2. Basic Database Setup
import { DB } from "wdb-sdk"
import { mem } from "wdb-core"
const { q } = mem()
const db = new DB({ jwk: acc[0].jwk, hb: null, mem: q })
// Initialize database
const id = await db.init({ id: "mydb" })
// Create collection with schema
await db.mkdir({
name: "users",
schema: { type: "object", required: ["name", "age"] },
auth: [["set:user,del:user", "allow()"]],
})
3. CRUD Operations
// Create
await db.set("set:user", { name: "Bob", age: 20 }, "users", "Bob")
// Read (single document)
const user = await db.get("users", "Bob")
// Read (all documents, sorted)
const users = await db.get("users", ["age", "desc"])
// Read (with limit)
const topUsers = await db.get("users", ["age", "asc"], 2)
// Read (with query)
const thirtyYearOlds = await db.get("users", ["age", "==", 30])
// Delete
await db.set("del:user", "users", "Bob")
4. Local Node Deployment
# Clone HyperBEAM
git clone -b weavedb https://github.com/weavedb/HyperBEAM.git
cd HyperBEAM
# Start node
yarn start
# Deploy database (in separate terminal)
cd mydb
yarn deploy --wallet .wallet.json
Example Code Patterns
Example 1 - In-Memory Testing (javascript):
import assert from "assert"
import { describe, it } from "node:test"
import { acc } from "wao/test"
import { DB } from "wdb-sdk"
import { mem } from "wdb-core"
describe("Basic API", () => {
it("should query DB", async () => {
const { q } = mem()
const db = new DB({ jwk: acc[0].jwk, hb: null, mem: q })
const id = await db.init({ id: "mydb" })
await db.mkdir({
name: "users",
schema: { type: "object", required: ["name", "age"] },
auth: [["set:user,del:user", "allow()"]],
})
await db.set("set:user", { name: "Bob", age: 20 }, "users", "Bob")
const user = await db.get("users", "Bob")
assert.deepEqual(user, { name: "Bob", age: 20 })
})
})
Example 2 - Schema Definition (javascript):
// /db/schema.js
export default {
notes: {
type: "object",
required: ["id", "actor", "content", "published", "likes"],
properties: {
id: { type: "string" },
actor: { type: "string", pattern: "^[a-zA-Z0-9_-]{43}$" },
content: { type: "string", minLength: 1, maxLength: 140 },
published: { type: "integer" },
likes: { type: "integer" },
},
additionalProperties: false,
},
}
Example 3 - Authentication Rules (javascript):
// /db/auth.js
export default {
notes: [
[
"add:note",
[
["fields()", ["*content"]],
["mod()", { id: "$doc", actor: "$signer", published: "$ts", likes: 0 }],
["allow()"],
],
],
],
}
Example 4 - Database Triggers (javascript):
// /db/triggers.js
export default {
likes: [
{
key: "inc_likes",
on: "create",
fn: [
["update()", [{ likes: { _$: ["inc"] } }, "notes", "$after.object"]],
],
},
],
}
Example 5 - Frontend Integration (Next.js) (javascript):
import { useRef, useEffect, useState } from "react"
import { DB } from "wdb-sdk"
export default function Home() {
const [notes, setNotes] = useState([])
const db = useRef()
const getNotes = async () => {
const _notes = await db.current.cget("notes", ["published", "desc"], 10)
setNotes(_notes)
}
const handlePost = async (content) => {
if (window.arweaveWallet) {
await window.arweaveWallet.connect(["ACCESS_ADDRESS", "SIGN_TRANSACTION"])
}
const res = await db.current.set("add:note", { content }, "notes")
if (res.success) {
await getNotes()
}
}
useEffect(() => {
void (async () => {
db.current = new DB({
id: process.env.NEXT_PUBLIC_DB_ID,
url: process.env.NEXT_PUBLIC_RU_URL,
})
await getNotes()
})()
}, [])
return (
// UI components...
)
}
Example 6 - Package Installation (bash):
# For Node.js projects
yarn add wdb-sdk
# Or with npm
npm install wdb-sdk
# For testing utilities
yarn add arjson wao
Reference Files
This skill include
Установить weavedb в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл weavedb?
Decentralized database protocol with zero-knowledge proofs and permanent storage on Arweave
Как установить скилл weavedb?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл weavedb запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic