Skip to content

Commit dee1e76

Browse files
authored
update prune docu (#109)
1 parent 90a944e commit dee1e76

10 files changed

Lines changed: 108 additions & 19 deletions

File tree

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
name: HTML proofer
4444
runs-on: ubuntu-latest
4545
env:
46-
HUGO_VERSION: 0.152.2
46+
HUGO_VERSION: 0.161.1
4747

4848
steps:
4949
- name: Checkout

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
build:
3232
runs-on: ubuntu-latest
3333
env:
34-
HUGO_VERSION: 0.152.2
34+
HUGO_VERSION: 0.161.1
3535

3636
steps:
3737
- name: Checkout

assets/css/custom.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ input[type="password"]:focus {
6565
white-space: nowrap;
6666
text-overflow: ellipsis;
6767
}
68+
6869
.hextra-scrollbar ul {
6970
overflow-x:auto;
7071
}
72+
73+
/* Remove radius from code blocks */
74+
.hextra-code-block pre,
75+
.hextra-code-block code {
76+
border-radius: 0 !important;
77+
}

content/tutorials/pruned-nodes.md

Lines changed: 91 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Prune Your Pactus Node
2+
title: Running a Pruned Node
33
weight: 4
44
---
55

@@ -39,15 +39,21 @@ enabling more participants to run nodes and contribute to network security and d
3939

4040
If you are running a Full Node and want to prune its data to operate in pruned mode, follow these steps:
4141

42-
1. **Stop the Running Node**
43-
Shut down your currently running Pactus full node completely.
42+
{{% steps %}}
4443

45-
2. **Open a Terminal or Command Prompt**
44+
#### Step 1
45+
46+
Stop your node if it's running.
47+
48+
#### Step 2
49+
50+
Open a Terminal or Command Prompt:
4651
- On **macOS/Linux**: Open the **Terminal**.
4752
- On **Windows**: Use **Command Prompt** or **PowerShell**.
4853

49-
3. **Prune the Node Data**
50-
Run the following command, replacing `<PATH-TO-WORKING-DIR>` with the actual path to your working directory:
54+
#### Step 3
55+
56+
Run the following command, replacing `<PATH-TO-WORKING-DIR>` with the actual path to your working directory:
5157

5258
{{< os_tabs items="unix,windows" >}}
5359
{{< os_tab >}}
@@ -66,11 +72,88 @@ pactus-daemon.exe prune -w <PATH-TO-WORKING-DIR>
6672
{{< /os_tab >}}
6773
{{< /os_tabs >}}
6874

69-
4. **Restart the Node**
70-
Start your Pactus node again to resume normal operation.
75+
#### Step 4
76+
77+
Start your Pactus node again to resume normal operation.
78+
79+
{{% /steps %}}
7180

7281
This process removes all blocks and transactions older than your configured `store.retention_days`
7382
(default: 10 days). You can adjust it in your node
7483
[config](/get-started/configuration/) if you want to keep more
7584
or less history.
7685
Pruning is especially useful for users with limited storage capacity.
86+
87+
## Importing a Blockchain Snapshot (Pruned Mode)
88+
89+
To get your node up and running quickly, you can import a recent pruned snapshot of the blockchain.
90+
This is much faster than syncing from the genesis block.
91+
92+
{{< callout type="warning" >}}
93+
Before importing, make sure your node is **completely stopped**.
94+
Importing while the node is running can corrupt your data.
95+
{{< /callout >}}
96+
97+
### Option 1: Automatic Import (Recommended)
98+
99+
The `import` command automates the process.
100+
101+
{{% steps %}}
102+
103+
#### Step 1
104+
105+
Stop your node if it's running.
106+
107+
#### Step 2
108+
109+
Run the import command:
110+
{{< os_tabs items="unix,windows" >}}
111+
{{< os_tab >}}
112+
113+
```shell
114+
./pactus-daemon import --working-dir=<PATH-TO-WORKING-DIR>
115+
```
116+
117+
{{< /os_tab >}}
118+
{{< os_tab >}}
119+
120+
```shell
121+
./pactus-daemon.exe import --working-dir=<PATH-TO-WORKING-DIR>
122+
```
123+
124+
{{< /os_tab >}}
125+
{{< /os_tabs >}}
126+
127+
*(Replace `<PATH-TO-WORKING-DIR>` with your node's working directory).*
128+
129+
The daemon will automatically download and import the latest official snapshot from https://snapshot.pactus.org/.
130+
131+
#### Step 3
132+
133+
Start your node normally after the import finishes.
134+
135+
{{% /steps %}}
136+
137+
### Option 2: Manual Import
138+
139+
Use this method if you want to choose a specific snapshot or download it manually.
140+
141+
{{% steps %}}
142+
143+
#### Step 1
144+
145+
Stop your node if it's running.
146+
147+
#### Step 2
148+
149+
Download a snapshot from https://snapshot.pactus.org/. Each snapshot shows its creation date, file size, and a SHA256 checksum for verification.
150+
151+
#### Step 3
152+
153+
Extract the archive directly into your node's working directory. The extracted contents should go into the `data` folder inside the working directory (e.g., `~/pactus/data/`).
154+
155+
#### Step 4
156+
157+
Start your node normally. It will resume operation from the imported state.
158+
159+
{{% /steps %}}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/pactus-project/docs
22

33
go 1.21.9
44

5-
require github.com/imfing/hextra v0.9.7 // indirect
5+
require github.com/imfing/hextra v0.12.3 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github.com/imfing/hextra v0.9.7 h1:Zg5n24us36Bn/S/5mEUPkRW6uwE6vHHEqWSgN0bPXaM=
2-
github.com/imfing/hextra v0.9.7/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI=
1+
github.com/imfing/hextra v0.12.3 h1:DZHY2rUWYteyzjlHi9r4n7Bb5e2Q+6LXe4C1Dqn0ZjM=
2+
github.com/imfing/hextra v0.12.3/go.mod h1:vi+yhpq8YPp/aghvJlNKVnJKcPJ/VyAEcfC1BSV9ARo=

hugo.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,3 @@ params:
116116
# date | lastmod | publishDate | title | weight
117117
sortBy: date
118118
sortOrder: desc # or "asc"
119-

layouts/_shortcodes/items.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="hextra-cards hx-mt-4 hx-gap-4 hx-grid not-prose" style="--hextra-cards-grid-cols: 3;">
1+
<div class="hextra-cards hx:mt-4 hx:gap-4 hx:grid not-prose" style="--hextra-cards-grid-cols: 1;">
22
{{ range .Page.RegularPages }}
33
{{- partial "shortcodes/card" (dict
44
"page" .Page

layouts/_shortcodes/os_tab.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{- $defaultIndex := int ((.Parent.Get "defaultIndex") | default "0") -}}
44

55
<div
6-
class="hextra-tabs-panel hx-rounded hx-pt-6 hx-hidden data-[state=selected]:hx-block"
6+
class="hextra-tabs-panel hx:pt-0 hx:hidden hx:data-[state=selected]:block"
77
id="tabs-panel-{{ .Ordinal }}"
88
role="tabpanel"
99
{{- if eq .Ordinal $defaultIndex }} tabindex="0" {{ end -}}

layouts/_shortcodes/os_tabs.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
{{ errorf "no items provided" }}
88
{{- end -}}
99

10-
<div class="hextra-scrollbar hx-overflow-x-auto hx-overflow-y-hidden hx-overscroll-x-contain">
11-
<div class="hx-mt-4 hx-flex hx-w-max hx-min-w-full hx-border-b hx-border-gray-200 hx-pb-px dark:hx-border-neutral-800">
10+
<div class="hextra-scrollbar hx:overflow-x-auto hx:overflow-y-hidden hx:overscroll-x-contain ">
11+
<div class="hx:mt-4 hx:flex hx:w-max hx:min-w-full hx:border-b hx:border-gray-200 hx:pb-px hx:dark:border-neutral-800" role="tablist">
1212
{{- range $i, $item := $items -}}
1313

1414
{{- $itemDisplay := $item | safeHTML -}}
@@ -26,7 +26,7 @@
2626
{{- end -}}
2727

2828
<button
29-
class="hextra-tabs-toggle data-[state=selected]:hx-border-primary-500 data-[state=selected]:hx-text-primary-600 data-[state=selected]:dark:hx-border-primary-500 data-[state=selected]:dark:hx-text-primary-600 hx-mr-2 hx-rounded-t hx-p-2 hx-font-medium hx-leading-5 hx-transition-colors -hx-mb-0.5 hx-select-none hx-border-b-2 hx-border-transparent hx-text-gray-600 hover:hx-border-gray-200 hover:hx-text-black dark:hx-text-gray-200 dark:hover:hx-border-neutral-800 dark:hover:hx-text-white"
29+
class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset"
3030
role="tab"
3131
type="button"
3232
aria-controls="tabs-panel-{{ $i }}"

0 commit comments

Comments
 (0)