This repository contains the source code for the official Counterparty website (counterparty.io). Counterparty is a peer-to-peer financial platform and distributed, open-source Internet protocol built on the Bitcoin blockchain.
- Astro: Static site generator
- TinaCMS: Git-backed headless CMS for Markdown content
- Tailwind CSS: Styling
- TypeScript & React: Interactive components
/
├── public/
│ ├── images/ # Logos and assets (explorers, featured-collections, marketplaces, wallets, news)
│ └── uploads/ # Blog/news media uploads
├── src/
│ ├── components/
│ │ ├── home/ # Homepage sections (Header, WhatIsCounterparty, Wallets, Explorers, Collections, Marketplaces, LatestNews, Contribute)
│ │ ├── BlockCountdown.tsx
│ │ ├── CommonStyles.astro
│ │ ├── Footer.astro
│ │ └── Navbar.astro
│ ├── content/
│ │ ├── collections/ # TinaCMS collection schemas (*Collection.ts)
│ │ ├── explorers/ # Individual explorer entries (*.md)
│ │ ├── featured-collections/ # Featured collections list (featured-collections.md)
│ │ ├── header/ # Hero header content
│ │ ├── home/ # Homepage copy (WhatIsCounterparty, Contribute)
│ │ ├── marketplaces/ # Marketplaces list (marketplaces.md)
│ │ ├── news/ # News and development update posts (*.md)
│ │ ├── pages/ # Ordering lists for explorers and wallets
│ │ └── wallets/ # Individual wallet entries (*.md)
│ ├── layouts/
│ └── pages/ # Astro routes (index.astro, news/)
├── tina/
│ └── config.ts # TinaCMS configuration and schema registration
└── package.json
-
Clone the repository:
git clone https://github.com/CounterpartyXCP/Website.git cd Website -
Install dependencies:
npm install
-
Start the local development server (starts both TinaCMS and Astro):
npm run dev
| Command | Action |
|---|---|
npm run dev |
Starts tinacms dev and astro dev (localhost:4321) |
npm run tina |
Starts local TinaCMS GraphQL server (localhost:4001) |
npm run astro build |
Builds production site to ./dist/ (requires Tina running) |
npm run preview |
Previews the production build locally |
npm run astro ... |
Runs Astro CLI commands (astro add, astro check, etc.) |
All site content lives in src/content/ as Markdown with YAML frontmatter and is validated/queried through TinaCMS schemas in src/content/collections/ (registered in tina/config.ts). Adding a frontmatter field to a Markdown file without updating its Tina schema will cause the field to be stripped at render time.
There are three content patterns used in this repository:
Used by Wallets and Explorers. Each item is a separate Markdown file, and display order is controlled by a page list:
- Entry Markdown file:
src/content/<type>/<slug>.md - Ordering list:
src/content/pages/<type>/<type>.md(walletList/explorerList) - Tina schema:
src/content/collections/<type>Collection.ts - Astro component:
src/components/home/<Type>.astro - Images:
public/images/<type>/
To add a new wallet or explorer:
- Create
src/content/<type>/<slug>.mdwith frontmatter matching the collection schema. - Add
<slug>.mdto the list insrc/content/pages/<type>/<type>.md. - Place its logo in
public/images/<type>/.
Used by Collections and Marketplaces. All entries are stored directly as a YAML array inside a single Markdown file (order in the YAML array determines display order):
- Collections:
- Content file:
src/content/featured-collections/featured-collections.md(featuredCollectionList) - Tina schema:
src/content/collections/featuredCollectionsCollection.ts - Astro component:
src/components/home/Collections.astro - Images:
public/images/featured-collections/
- Content file:
- Marketplaces:
- Content file:
src/content/marketplaces/marketplaces.md(marketplaceList) - Tina schema:
src/content/collections/marketplacesCollection.ts - Astro component:
src/components/home/Marketplaces.astro - Images:
public/images/marketplaces/
- Content file:
- Content files:
src/content/news/<slug>.md - Tina schema:
src/content/collections/newsCollection.ts - Routes:
src/pages/news/[...page].astroandsrc/pages/news/[slug].astro
astro build queries the local TinaCMS GraphQL server (localhost:4001), so tinacms dev must be running in the background during the build:
TINA_PUBLIC_IS_LOCAL=true npx tinacms dev &
sleep 5
npx astro build
pkill -f "tinacms dev"
rm -rf public/admin/index.html dist/adminThere is no separate test suite — npx astro build validates the Tina schemas and content. Note that tinacms dev generates public/admin/index.html pointing to localhost:4001, so always remove public/admin/index.html and dist/admin before syncing ./dist to production.
- GCP Project:
coral-falcon-658184(Counterparty) - Storage Bucket:
gs://counterparty-website-coral-falcon-658184(multi-regionUS,roles/storage.legacyObjectReaderpublic object read with XML directory listing disabled, websiteindex.html/404.html, object versioning enabled) - Frontend Load Balancer: Global external Application Load Balancer (
35.186.209.185) backed by Cloud CDN (counterparty-websitebackend bucket) and Google-managed Certificate Manager TLS (counterparty-website)- Redirects
http://->https://www.counterparty.io(301) andhttps://counterparty.io/*->https://www.counterparty.io/*(301) - Serves
https://counterparty.io/protocol_changes.jsonandhttps://www.counterparty.io/protocol_changes.json(200 OK) via Internet NEG (counterparty-github-raw) fromraw.githubusercontent.com/CounterpartyXCP/counterparty-core/refs/heads/master/counterparty-core/counterpartycore/protocol_changes.json
- Redirects
- Terraform IaC: Managed in
UnspendableLabs/Infrastructureunderterraform/counterparty-platform/website-storage.tfandterraform/counterparty-platform/website-frontend.tf
After merging changes to master on GitHub, build the static site and sync ./dist to the GCS bucket:
TINA_PUBLIC_IS_LOCAL=true npx tinacms dev &
TINA_PID=$!
sleep 5
npx astro build
kill $TINA_PID
rm -rf public/admin/index.html dist/admin
gcloud storage rsync ./dist gs://counterparty-website-coral-falcon-658184 \
--recursive \
--delete-unmatched-destination-objects \
--project=coral-falcon-658184 \
[email protected]
gcloud compute url-maps invalidate-cdn-cache counterparty-website \
--path="/*" \
--project=coral-falcon-658184 \
[email protected] \
--asyncThe documentation site at docs.counterparty.io is maintained in a separate repository (CounterpartyXCP/Documentation) and hosted on GitHub Pages from its gh-pages branch. To publish documentation updates from a local clone of Documentation:
cd Documentation
git pull origin master
USE_SSH=true npm run deploy- Fork the repository and create a branch (
git checkout -b feature/your-feature-name). - Make your changes and verify the build succeeds with
tinacms dev+npx astro build. - Commit, push to your fork, and open a Pull Request against
master.
This work is licensed under CC BY 4.0.