From 58313724fa56b5c659dd42aba304a332fb1d725d Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Thu, 7 Nov 2024 23:37:15 +0800 Subject: [PATCH 1/6] Update docs --- blog/authors.yml | 1 + blog/tags.yml | 2 +- docs/basics/_category_.json | 3 +- docs/extras/_category_.json | 5 +- docs/intro.md | 2 +- docusaurus.config.js | 26 ++++++++-- src/css/custom.css | 98 ++++++++++++++++++++++++++++++------- src/pages/index.js | 4 +- static/img/subcoin-logo.svg | 1 + 9 files changed, 115 insertions(+), 27 deletions(-) create mode 100644 static/img/subcoin-logo.svg diff --git a/blog/authors.yml b/blog/authors.yml index 8837ae8..c82ea72 100644 --- a/blog/authors.yml +++ b/blog/authors.yml @@ -3,5 +3,6 @@ liuchengxu: url: https://github.com/liuchengxu image_url: https://github.com/liuchengxu.png page: true + title: Subcoin Builder socials: github: liuchengxu diff --git a/blog/tags.yml b/blog/tags.yml index 49357a6..59dfa16 100644 --- a/blog/tags.yml +++ b/blog/tags.yml @@ -18,7 +18,7 @@ hola: permalink: /hola description: Hola tag description -sync: +syncing: label: Syncing permalink: /syncing description: Bitcoin syncing diff --git a/docs/basics/_category_.json b/docs/basics/_category_.json index 0a78c8c..ebe0240 100644 --- a/docs/basics/_category_.json +++ b/docs/basics/_category_.json @@ -1,8 +1,9 @@ { - "label": "Getting Started", + "label": "๐Ÿš€ Getting Started", "position": 2, "link": { "type": "generated-index", + "slug": "getting-started", "description": "Subcoin basics" } } diff --git a/docs/extras/_category_.json b/docs/extras/_category_.json index 018bcb0..22823e0 100644 --- a/docs/extras/_category_.json +++ b/docs/extras/_category_.json @@ -1,7 +1,8 @@ { - "label": "Extras", + "label": "โœจ Extras", "position": 3, "link": { - "type": "generated-index" + "type": "generated-index", + "slug": "extras", } } diff --git a/docs/intro.md b/docs/intro.md index b89371c..6d8be74 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -2,7 +2,7 @@ sidebar_position: 1 --- -# Introduction +# ๐Ÿ“˜ Introduction Welcome to **Subcoin**, an innovative project aimed at introducing decentralized fast sync for the Bitcoin network. By leveraging the power of [Polkadot-SDK (formerly Substrate)](https://github.com/paritytech/polkadot-sdk), Subcoin delivers a more efficient Bitcoin chain syncing process. diff --git a/docusaurus.config.js b/docusaurus.config.js index 9169cf4..47977cf 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -35,6 +35,19 @@ const config = { locales: ['en'], }, + stylesheets: [ + { + href: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css', + type: 'text/css', + }, + { + href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css', + type: 'text/css', + integrity: 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM', + crossorigin: 'anonymous', + }, + ], + presets: [ [ 'classic', @@ -79,8 +92,8 @@ const config = { navbar: { title: 'Subcoin', logo: { - alt: 'My Site Logo', - src: 'img/logo.svg', + alt: 'Subcoin Logo', + src: 'img/subcoin-logo.svg', }, items: [ {to: '/blog', label: 'Blog', position: 'left'}, @@ -97,8 +110,15 @@ const config = { }, { href: 'https://github.com/subcoin-project/subcoin', - label: 'GitHub', position: 'right', + className: 'header-github-link', + 'aria-label': 'GitHub repository', + }, + { + href: 'https://x.com/subcoin_project', + position: 'right', + className: 'header-twitter-link', + 'aria-label': 'Twitter profile', }, ], }, diff --git a/src/css/custom.css b/src/css/custom.css index 2bc6a4c..ebead67 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -4,27 +4,91 @@ * work well for content-centric websites. */ -/* You can override the default Infima variables here. */ +/* Colors are generated from https://aicolors.co/ and adjusted by ChatGPT. */ :root { - --ifm-color-primary: #2e8555; - --ifm-color-primary-dark: #29784c; - --ifm-color-primary-darker: #277148; - --ifm-color-primary-darkest: #205d3b; - --ifm-color-primary-light: #33925d; - --ifm-color-primary-lighter: #359962; - --ifm-color-primary-lightest: #3cad6e; + /* Primary Colors */ + --ifm-color-primary: #2C3E50; /* primary-100 */ + --ifm-color-primary-dark: #57687c; /* primary-200 */ + --ifm-color-primary-darker: #b4c7dd; /* primary-300 */ + --ifm-color-primary-light: #F7CAC9; /* accent-100 */ + --ifm-color-primary-lighter: #926b6a; /* accent-200 */ + + /* Link Colors */ + --ifm-link-color: #1E6091; /* Distinct blue link color */ + --ifm-link-hover-color: #144c73; /* Darker shade for hover */ + + /* Text Colors */ + --ifm-color-content: #333333; /* text-100 */ + --ifm-color-content-secondary: #5c5c5c; /* text-200 */ + + /* Background Colors */ + --ifm-background-color: #F2F2F2; /* bg-100 */ + --ifm-background-secondary-color: #e8e8e8; /* bg-200 */ + --ifm-background-alt: #bfbfbf; /* bg-300 */ + + /* Code Font Size and Highlighting */ --ifm-code-font-size: 95%; --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); } -/* For readability concerns, you should choose a lighter palette in dark mode. */ +/* Dark mode adjustments */ [data-theme='dark'] { - --ifm-color-primary: #25c2a0; - --ifm-color-primary-dark: #21af90; - --ifm-color-primary-darker: #1fa588; - --ifm-color-primary-darkest: #1a8870; - --ifm-color-primary-light: #29d5b0; - --ifm-color-primary-lighter: #32d8b4; - --ifm-color-primary-lightest: #4fddbf; - --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); + /* Primary Colors */ + --ifm-color-primary: #926b6a; /* accent-200 */ + --ifm-color-primary-dark: #2C3E50; /* primary-100 */ + --ifm-color-primary-darker: #57687c; /* primary-200 */ + --ifm-color-primary-light: #F7CAC9; /* accent-100 */ + --ifm-color-primary-lighter: #b4c7dd; /* primary-300 */ + + /* Link Colors */ + --ifm-link-color: #6cb2eb; /* Light blue for dark mode */ + --ifm-link-hover-color: #4a93c9; /* Slightly darker for hover */ + + /* Text Colors */ + --ifm-color-content: #F2F2F2; /* lightened text-100 for dark mode */ + --ifm-color-content-secondary: #e8e8e8; /* bg-200 */ + + /* Background Colors */ + --ifm-background-color: #333333; /* darkened text-100 as background */ + --ifm-background-secondary-color: #5c5c5c; /* darkened text-200 as secondary */ + --ifm-background-alt: #bfbfbf; /* bg-300 */ + + /* Code highlighting adjustments */ + --docusaurus-highlighted-code-line-bg: rgba(255, 255, 255, 0.15); +} + +/* GitHub icon */ +.header-github-link { + padding-left: 10px; +} + +.header-github-link:hover { + opacity: 0.6; +} + +.header-github-link::before { + content: ''; + width: 24px; + height: 24px; + display: flex; + background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E") + no-repeat; +} + +/* Twitter icon */ +.header-twitter-link { + padding-left: 10px; +} + +.header-twitter-link:hover { + opacity: 0.6; +} + +.header-twitter-link::before { + content: ''; + width: 24px; + height: 24px; + display: flex; + background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%231da1f2' d='M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z'/%3E%3C/svg%3E") + no-repeat; } diff --git a/src/pages/index.js b/src/pages/index.js index aa0bb57..17dd323 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -35,8 +35,8 @@ export default function Home() { const {siteConfig} = useDocusaurusContext(); return ( + title={`Bitcoin Node in Substrate`} + description="Subcoin is a Rust Bitcoin Full Node in Substrate, featured in Decentralized Fast Sync. />">
diff --git a/static/img/subcoin-logo.svg b/static/img/subcoin-logo.svg new file mode 100644 index 0000000..6821d52 --- /dev/null +++ b/static/img/subcoin-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file From 894f514822e91a4ebdf46e01b23dc8e5fa4107e4 Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Fri, 15 Nov 2024 20:25:56 +0800 Subject: [PATCH 2/6] Add donate --- docs/basics/download-UTXO-snapshot.md | 18 +++++++++++-- docs/donate.md | 37 +++++++++++++++++++++++++++ docusaurus.config.js | 1 + 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 docs/donate.md diff --git a/docs/basics/download-UTXO-snapshot.md b/docs/basics/download-UTXO-snapshot.md index 463627e..24bf440 100644 --- a/docs/basics/download-UTXO-snapshot.md +++ b/docs/basics/download-UTXO-snapshot.md @@ -4,8 +4,22 @@ sidebar_position: 3 # Download UTXO Snapshot (Coming Soon) -Subcoin provides a dedicated tool for downloading Bitcoin Core compatible UTXO snapshot so that Bitcoin Core users don't have to rely on a trusted snapshot provider to do a fast sync in Bitcoin Core. +Subcoin offers a dedicated tool for downloading a Bitcoin Core-compatible UTXO snapshot from the Subcoin P2P network directly. This eliminates the need for Bitcoin Core users to rely on trusted snapshot providers for performing a fast sync. + +## Tool: `snapcake` + +To download the UTXO snapshot, simply use the following command: + +```bash +snapcake +``` + +## Using the Snapshot in Bitcoin Core + +Once the snapshot is successfully downloaded, it can be loaded into your Bitcoin Core node using the `loadtxoutset` RPC command: ```bash -subcoin-snapshot-tool +bitcoin-cli loadtxoutset ``` + +This process initializes your Bitcoin Core node with a recent UTXO set, allowing you to sync quickly to the network tip without the need to process historical blocks. This can significantly reduce the time required to get a fully functional bitcoind instance. diff --git a/docs/donate.md b/docs/donate.md new file mode 100644 index 0000000..3f7e04d --- /dev/null +++ b/docs/donate.md @@ -0,0 +1,37 @@ +--- +id: donate +title: Donate to Subcoin +sidebar_label: ๐Ÿ’ฐ Donate +sidebar_position: 4 +--- + +# Donate to Subcoin + +Thank you for considering a donation to support Subcoin! Your contributions help us build innovative solutions that integrate Bitcoin with Substrate, bringing decentralized fast sync and more efficient tools to the Bitcoin ecosystem. + +Every contribution, no matter the size, makes a difference. + +--- + +## Why Donate? + +By donating, youโ€™re helping us: + +- Improve the decentralized Bitcoin fast sync supported by Subcoin. +- Develop tools like `snapcake` to enhance the Bitcoin Core software. +- Build a robust and decentralized future for Bitcoin users. + +We are deeply grateful for your support and look forward to building a better blockchain ecosystem together. + +--- + +## How to Donate + +You can support us by sending donations in either **Bitcoin (BTC)** or **Polkadot (DOT)**. + +- **BTC**: `bc1p9nvx58550rlhk29a6urzxg06hmgv9sh5afwdt66md09xwpdytlmqun0j4v` +- **DOT**: `12uXLCZZkprwRBhfmhTXdfQE8faQwgNpS76wwmnEbgDwWB9e` + +--- + +For inquiries or other ways to contribute, feel free to [contact us](mailto:support@xuliuchengxlc@gmail.com). diff --git a/docusaurus.config.js b/docusaurus.config.js index 47977cf..008e469 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -108,6 +108,7 @@ const config = { label: 'Dev Guide', position: 'left', }, + {to: '/docs/donate', label: 'Donate', position: 'left'}, { href: 'https://github.com/subcoin-project/subcoin', position: 'right', From 9d1e89a7353ff714f6baf562c588d791fcbe4c70 Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Fri, 15 Nov 2024 20:40:09 +0800 Subject: [PATCH 3/6] Remove unused deps --- docusaurus.config.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 008e469..2c44a81 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -35,19 +35,6 @@ const config = { locales: ['en'], }, - stylesheets: [ - { - href: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css', - type: 'text/css', - }, - { - href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css', - type: 'text/css', - integrity: 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM', - crossorigin: 'anonymous', - }, - ], - presets: [ [ 'classic', From 97bbddbe7ae8683ff43cbb655c10dd0a61193009 Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Tue, 17 Dec 2024 23:05:14 +0800 Subject: [PATCH 4/6] Update docs --- docs/basics/download-UTXO-snapshot.md | 42 +++++++++++++++++++++--- docusaurus.config.js | 2 +- src/components/HomepageFeatures/index.js | 32 +++++++++++------- static/img/snapshot_provider.svg | 6 ++++ 4 files changed, 65 insertions(+), 17 deletions(-) create mode 100644 static/img/snapshot_provider.svg diff --git a/docs/basics/download-UTXO-snapshot.md b/docs/basics/download-UTXO-snapshot.md index 24bf440..4067bcf 100644 --- a/docs/basics/download-UTXO-snapshot.md +++ b/docs/basics/download-UTXO-snapshot.md @@ -2,16 +2,48 @@ sidebar_position: 3 --- -# Download UTXO Snapshot (Coming Soon) +# Download UTXO Snapshot -Subcoin offers a dedicated tool for downloading a Bitcoin Core-compatible UTXO snapshot from the Subcoin P2P network directly. This eliminates the need for Bitcoin Core users to rely on trusted snapshot providers for performing a fast sync. +Subcoin offers a dedicated tool `snapcake` for downloading a Bitcoin Core-compatible UTXO snapshot from the Subcoin P2P network directly. This eliminates the need for Bitcoin Core users to rely on trusted snapshot providers for performing a fast sync. -## Tool: `snapcake` +## Command to Download a UTXO Snapshot -To download the UTXO snapshot, simply use the following command: +To download the UTXO snapshot for a specified block, simply use the following command: ```bash -snapcake +snapcake --bootnodes --block-number 840000 +``` + +### Notes + +- Supported Block: + + While snapcake supports downloading the snapshot at any block as long as the peer does not prune the state, only the UTXO snapshot at hardcoded block height 840000 is currently supported for importing into Bitcoin Core. + +- Snapshot integrity: + +The expected `sha256sum` for the snapshot at block 840000 is: + +```text +dc4bb43d58d6a25e91eae93eb052d72e3318bd98ec62a5d0c11817cefbba177b +``` +This checksum matches the one documented in the official [Bitcoin Core pull request](https://github.com/bitcoin/bitcoin/pull/28553#issue-1920247340). + +## Verify the Downloaded Snapshot + +To ensure the integrity of the downloaded snapshot, verify its checksum using the `sha256sum` command: + +```bash +# Replace with the path to your downloaded snapshot. +# By default, the file is stored at: +# snapshots/840000_0000000000000000000320283a032748cef8227873ff4872689bf23f1cda83a5/snapshot.dat +sha256sum +``` + +The output should match the expected checksum: + +```text +dc4bb43d58d6a25e91eae93eb052d72e3318bd98ec62a5d0c11817cefbba177b ``` ## Using the Snapshot in Bitcoin Core diff --git a/docusaurus.config.js b/docusaurus.config.js index 2c44a81..a065280 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -83,7 +83,6 @@ const config = { src: 'img/subcoin-logo.svg', }, items: [ - {to: '/blog', label: 'Blog', position: 'left'}, { type: 'docSidebar', sidebarId: 'tutorialSidebar', @@ -95,6 +94,7 @@ const config = { label: 'Dev Guide', position: 'left', }, + {to: '/blog', label: 'Blog', position: 'left'}, {to: '/docs/donate', label: 'Donate', position: 'left'}, { href: 'https://github.com/subcoin-project/subcoin', diff --git a/src/components/HomepageFeatures/index.js b/src/components/HomepageFeatures/index.js index 9fd4f99..ba89ff8 100644 --- a/src/components/HomepageFeatures/index.js +++ b/src/components/HomepageFeatures/index.js @@ -1,18 +1,9 @@ import clsx from 'clsx'; import Heading from '@theme/Heading'; import styles from './styles.module.css'; +import Link from '@docusaurus/Link'; const FeatureList = [ - { - title: 'Decentralized Fast Sync', - Svg: require('@site/static/img/blockchain.svg').default, - description: ( - <> - Subcoin enables new Bitcoin participants to quickly sync the latest Bitcoin state in a decentralized manner, - achieving the fast sync functionality of Bitcoin Core without depending on a trusted snapshot provider. - - ), - }, { title: 'Written in Rust', Svg: require('@site/static/img/rust.svg').default, @@ -33,11 +24,30 @@ const FeatureList = [ ), }, + { + title: 'Decentralized Fast Sync', + Svg: require('@site/static/img/blockchain.svg').default, + description: ( + <> + Subcoin node enables new Bitcoin participants to quickly sync the latest Bitcoin state in a decentralized manner, + achieving the fast sync functionality of Bitcoin Core without depending on a trusted snapshot provider. + + ), + }, + { + title: 'Trustless UTXO Snapshot Provider for Bitcoin Core', + Svg: require('@site/static/img/snapshot_provider.svg').default, + description: ( + <> + Subcoin provides a dedicated tool Snapcake that serves as a trustless UTXO snapshot provider for Bitcoin Core without running a Subcoin node, downloading the Bitcoin state from the Subcoin P2P network and generating a Bitcoin Core-compatible UTXO snapshot which can be directly imported into Bitcoin Core. + + ), + }, ]; function Feature({Svg, title, description}) { return ( -
+
diff --git a/static/img/snapshot_provider.svg b/static/img/snapshot_provider.svg new file mode 100644 index 0000000..f9e2a65 --- /dev/null +++ b/static/img/snapshot_provider.svg @@ -0,0 +1,6 @@ + + + โ‚ฟ + + + From 917ab8605a64e6748474313fe94007fbefe525e0 Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Tue, 17 Dec 2024 23:13:22 +0800 Subject: [PATCH 5/6] TODO --- docs/basics/download-UTXO-snapshot.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/basics/download-UTXO-snapshot.md b/docs/basics/download-UTXO-snapshot.md index 4067bcf..2150539 100644 --- a/docs/basics/download-UTXO-snapshot.md +++ b/docs/basics/download-UTXO-snapshot.md @@ -14,6 +14,8 @@ To download the UTXO snapshot for a specified block, simply use the following co snapcake --bootnodes --block-number 840000 ``` +TODO: public bootnodes + ### Notes - Supported Block: From 04c1b5d168cd5dc46416db051c056b94faadc261 Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Wed, 18 Dec 2024 00:58:01 +0800 Subject: [PATCH 6/6] . --- docs/basics/download-UTXO-snapshot.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/basics/download-UTXO-snapshot.md b/docs/basics/download-UTXO-snapshot.md index 2150539..e89597a 100644 --- a/docs/basics/download-UTXO-snapshot.md +++ b/docs/basics/download-UTXO-snapshot.md @@ -22,14 +22,18 @@ TODO: public bootnodes While snapcake supports downloading the snapshot at any block as long as the peer does not prune the state, only the UTXO snapshot at hardcoded block height 840000 is currently supported for importing into Bitcoin Core. +- Snapshot Format Compatibility: + + The snapshot format may change in future versions of Bitcoin Core. Currently, snapcake supports the snapshot format used in Bitcoin Core v28.0. + - Snapshot integrity: -The expected `sha256sum` for the snapshot at block 840000 is: + The expected `sha256sum` for the snapshot at block 840000 is: -```text -dc4bb43d58d6a25e91eae93eb052d72e3318bd98ec62a5d0c11817cefbba177b -``` -This checksum matches the one documented in the official [Bitcoin Core pull request](https://github.com/bitcoin/bitcoin/pull/28553#issue-1920247340). + ```text + dc4bb43d58d6a25e91eae93eb052d72e3318bd98ec62a5d0c11817cefbba177b + ``` + This checksum matches the one documented in the official [Bitcoin Core pull request](https://github.com/bitcoin/bitcoin/pull/28553#issue-1920247340). ## Verify the Downloaded Snapshot