一键导入
host-website
Deploy and update static websites on Swarm via one-off or feed-based publishing, with optional ENS integration and stamp lifecycle notes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Deploy and update static websites on Swarm via one-off or feed-based publishing, with optional ENS integration and stamp lifecycle notes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guide to Swarm ACT encryption and access control: create grantees, upload protected data, grant/revoke access, and troubleshoot not-found/history issues.
Build and publish a Swarm blog with a permanent feed-manifest URL, post management workflow, and optional ENS domain mapping.
Scaffold a Swarm app or add bee-js to an existing project, with core upload/download patterns and node-compatibility guidance.
Answer Swarm conceptual questions from official docs with source links; use for APIs, behavior, configuration, and architecture clarifications.
Create and manage Swarm feeds for stable, updateable URLs using bee-js or swarm-cli, including manifest creation and feed updates.
Show all Swarm skills, check node status, and route developers to setup, storage, website, app, security, messaging, or troubleshooting flows.
| name | host-website |
| description | Deploy and update static websites on Swarm via one-off or feed-based publishing, with optional ENS integration and stamp lifecycle notes. |
| user-invocable | true |
Guide a developer through hosting a static website on Swarm. Ask which method they prefer (swarm-cli or bee-js), then walk them through step by step.
When presenting to the user, use consistent labels before each code block:
filename: — file contents the user should write to diskAdd a --- horizontal rule before each labeled code block to visually separate it from surrounding text.
Silently check node status (curl -s http://localhost:1633/node) and stamp availability (swarm-cli stamp list). If the node is down, offer to walk through /setup-bee-interactive. If no usable stamp exists, route to /stamps.
Then present the prerequisites to the user:
index.html (common output folders: dist/, build/, out/, public/)/setup-bee-interactive — if missing, run that first)npm install @ethersphere/bee-js in your projectAsk the user to confirm they have these before continuing.
Ask: "Will you need to update this website later, or is this a one-time deploy?"
Always recommend Feeds for production websites.
swarm-cli upload ./website \
--stamp <BATCH_ID> \
--index-document index.html \
--error-document 404.html
Access at: http://localhost:1633/bzz/<SWARM_HASH>/
swarm-cli identity create website-publisher --password <SECURE_PASSWORD>
Save the output securely. To export later: swarm-cli identity export website-publisher --password <SECURE_PASSWORD>
swarm-cli feed upload ./website \
--identity website-publisher \
--topic-string website \
--stamp <BATCH_ID> \
--index-document index.html \
--error-document 404.html \
--password <SECURE_PASSWORD>
Save the manifest hash from the "Feed Manifest URL" output (the part after /bzz/). This is the permanent reference — it never changes.
Run the same feed upload command with updated files. Same identity + topic = same manifest URL.
import { Bee } from "@ethersphere/bee-js";
const bee = new Bee("http://localhost:1633");
const batchId = "<BATCH_ID>";
const result = await bee.uploadFilesFromDirectory(batchId, "./website", {
indexDocument: "index.html",
errorDocument: "404.html"
});
console.log("Swarm hash:", result.reference.toHex());
// Access at: http://localhost:1633/bzz/<SWARM_HASH>/
import crypto from "crypto";
import { PrivateKey } from "@ethersphere/bee-js";
const hexKey = "0x" + crypto.randomBytes(32).toString("hex");
const privateKey = new PrivateKey(hexKey);
console.log("Private key:", privateKey.toHex());
console.log("Public address:", privateKey.publicKey().address().toHex());
// Store the private key securely — never commit it to version control
Security: Store this private key securely (e.g., environment variable or encrypted keyfile). Never commit it to version control. Losing this key means losing the ability to update this feed.
import { Bee, Topic, PrivateKey } from "@ethersphere/bee-js";
const bee = new Bee("http://localhost:1633");
const batchId = "<BATCH_ID>";
const privateKey = new PrivateKey("<PUBLISHER_KEY>");
const owner = privateKey.publicKey().address();
const topic = Topic.fromString("website");
const writer = bee.makeFeedWriter(topic, privateKey);
// Upload website files
const upload = await bee.uploadFilesFromDirectory(batchId, "./website", {
indexDocument: "index.html",
errorDocument: "404.html"
});
console.log("Website Swarm Hash:", upload.reference.toHex());
// Point feed to the upload
await writer.uploadReference(batchId, upload.reference);
// Create feed manifest (use this hash for ENS)
const manifestRef = await bee.createFeedManifest(batchId, topic, owner);
console.log("Feed Manifest:", manifestRef.toHex());
// Upload new version
const newUpload = await bee.uploadFilesFromDirectory(batchId, "./website", {
indexDocument: "index.html",
errorDocument: "404.html"
});
// Update feed — manifest hash stays the same
await writer.uploadReference(batchId, newUpload.reference);
After uploading, ask: "Do you want to connect this to an ENS domain?"
If yes:
bzz://<MANIFEST_HASH>Once registered, the site is accessible at:
https://yourname.eth.limo/https://yourname.bzz.link/http://localhost:1633/bzz/yourname.eth/Use the feed manifest hash (not the website hash) so future updates don't require ENS changes.
Some RPC endpoints don't resolve ENS on localhost. Working alternatives:
https://mainnet.infura.io/v3/<your-key>https://eth-mainnet.public.blastapi.ioWhen your stamp expires, your website becomes inaccessible — silently. ENS will still resolve but the content will be gone.
swarm-cli stamp show <stamp-id>swarm-cli stamp topup --stamp <stamp-id> --amount <amount>ENS integration requires:
If you don't have these, use the raw bzz:// link or Beeport instead.
For any conceptual or technical question not covered by the steps above, invoke /docs to find the relevant authoritative source rather than answering from prior knowledge.