A minimal demo showing a static website deployed with the Filecoin Pin Upload Action and an ENS update that points the ENS name to the latest IPFS CID after each push to main.
site/static content- Two GitHub workflows:
Build Site(PRs + pushes tomain)Upload to Filecoin + ENS(runs after successful build)
scripts/update-ens.mjsto update ENScontenthashvia ethers + content-hash- Upload action reference:
filecoin-project/filecoin-pin/[email protected](or pin to commit)
- Upload action reference:
- Add repository secrets/vars:
FILECOIN_WALLET_KEY(secret)ETHEREUM_RPC_URL(secret)ENS_PRIVATE_KEY(secret)ENS_NAME(variable or secret)- Optional
ENS_REGISTRY_ADDRESS(variable) if not using mainnet registry
- Open a PR to see the build succeed (dry-run upload).
- Merge to
mainto upload to Filecoin and update ENS.
See AGENTS.md for detailed goals, plan, and notes.
This repo is set up to let you test ENS updates on the Holesky Ethereum testnet while uploading site content to the Filecoin Calibration network.
- ENS on Holesky
- You control an ENS name on Holesky: set
ENS_NAMEto that name. - You know the Holesky ENS registry address: set
ENS_REGISTRY_ADDRESSto that address. - Your name has a resolver set that supports
setContenthash(bytes32,bytes)(Public Resolver or equivalent on Holesky).
- You control an ENS name on Holesky: set
- Holesky account and RPC
ETHEREUM_RPC_URL: Holesky RPC endpointENS_PRIVATE_KEY: private key controlling the ENS name; funded with Holesky ETH
- Filecoin Calibration
FILECOIN_WALLET_KEY: funded with USDFC to satisfyminStorageDayswithinfilecoinPayBalanceLimit
Set these in repository Settings → Secrets and variables:
- Secrets:
FILECOIN_WALLET_KEY,ETHEREUM_RPC_URL,ENS_PRIVATE_KEY - Vars or Secrets:
ENS_NAME - Vars (optional but recommended on Holesky):
ENS_REGISTRY_ADDRESS
Open a PR that changes something in site/ (for example, edit site/index.html). CI will:
- Build the site and publish the
site-distartifact. - Trigger the “Upload to Filecoin + ENS” workflow via
workflow_run. - Run the Filecoin upload in
dryRun: true(because the originating event ispull_request). - Compute and surface
ipfsRootCidbut skip the ENS update.
Where to find the CID on the PR run:
- In the job’s step logs for “Upload to Filecoin” (
ipfsRootCid: ...). - In the job summary appended by the action (if available).
- In the artifact
filecoin-pin-artifacts/context.json(download from the run artifacts) underipfsRootCid.
This avoids the chicken‑and‑egg problem: you don’t need a CID ahead of time—the PR run computes it without spending or updating ENS.
After the PR run, use the ipfsRootCid from Step 1 to verify your Holesky ENS setup locally:
cd filecoin-pin-ens-demo
npm install
# Use the ipfsRootCid from the PR run
ENS_NAME=yourname.holesky.eth \
IPFS_CID=<ipfsRootCid_from_PR> \
ETHEREUM_RPC_URL=https://holesky.example.org \
ENS_PRIVATE_KEY=0xabc... \
ENS_REGISTRY_ADDRESS=0xYourHoleskyRegistryAddress \
npm run update:ensExpected:
- If the contenthash differs, a transaction is submitted and confirmed.
- If it matches, the script exits with a no-op message.
- If it errors with “No resolver set”, set a resolver for your name that supports
contenthashand retry.
Merge the PR or push to main. CI will:
- Build the site and publish the artifact.
- Run the upload with
dryRun: false(originating event ispush). - Upload to Filecoin Calibration and output the new
ipfsRootCid. - Run
scripts/update-ens.mjsto set your Holesky ENS name’scontenthashto the new IPFS CID.
- ENS: Re-run the local script with the same
IPFS_CIDto see a no-op, or readcontenthashfrom your resolver directly with ethers. - Filecoin: Use workflow logs and the action summary to confirm the
ipfsRootCid; optional: view via any IPFS gateway.
- Resolver not set or wrong resolver
- Set a Holesky resolver for your name that implements
setContenthash. Use your Holesky ENS UI or a script.
- Set a Holesky resolver for your name that implements
- Insufficient gas on Holesky
- Fund the
ENS_PRIVATE_KEYaccount with Holesky ETH.
- Fund the
- Filecoin payment limits
- Ensure the wallet has sufficient USDFC on Calibration. For testing, consider reducing
minStorageDaysand/or increasingfilecoinPayBalanceLimit(in the trusted workflow) within safe limits.
- Ensure the wallet has sufficient USDFC on Calibration. For testing, consider reducing
- Wrong registry
- Holesky is not part of the official ENS mainnet deploys; set the exact Holesky registry address you used in
ENS_REGISTRY_ADDRESS.
- Holesky is not part of the official ENS mainnet deploys; set the exact Holesky registry address you used in
- PRs are dry-run by design to avoid spend and DNS mutations.
- Pushes to
mainperform real uploads and ENS updates. - Record your Holesky registry and resolver addresses in
AGENTS.mdto ensure future work can resume without context loss.
Forked repositories often don’t run workflows automatically until Actions are enabled. This repo includes manual triggers to let you run everything in a fork.
Prerequisites in your fork
- Enable Actions: Settings → Actions → General → Allow all actions and reusable workflows. In the Actions tab, approve the banner if shown.
- Ensure workflows exist on your default branch:
.github/workflows/build-site.ymland.github/workflows/upload-to-filecoin-and-update-ens.yml. - Add required secrets/vars in the fork:
FILECOIN_WALLET_KEY,ETHEREUM_RPC_URL,ENS_PRIVATE_KEY,ENS_NAME, and (for Holesky)ENS_REGISTRY_ADDRESS.
Run manually
-
Build Site
- Actions → “Build Site” → Run workflow (choose branch).
- This creates the
site-distartifact.
-
Upload to Filecoin + ENS
- Actions → “Upload to Filecoin + ENS” → Run workflow.
- Inputs:
build_run_id(optional): ID of a prior Build Site run to pull thesite-distartifact from. Leave blank to buildsite/inline.dry_run(boolean): default true; set false to perform a real upload to Calibration.update_ens(boolean): default false; set true to update ENS after upload (requires ENS secrets/vars).
Finding a run ID (optional)
- Open the desired “Build Site” run and copy the Run ID from the page URL (or use the UI’s Run ID display). Paste it into
build_run_idwhen manually running the upload workflow.
Notes
- Manual runs without
build_run_idwill copysite/todist/inline. The secure pattern still uses the two‑workflow chain viaworkflow_runwhen not running manually. - To test the default chain in a fork, open a PR from a branch in the same fork targeting its
main. If it still doesn’t auto-run, use the manual triggers above.