Skip to content

Commit

Permalink
chore: fix linting issues (#9)
Browse files Browse the repository at this point in the history
* chore: fix linting issues

* chore: update github actions

* chore: fix broken links
  • Loading branch information
b00f authored Jun 12, 2024
1 parent f9144e8 commit 6865dab
Show file tree
Hide file tree
Showing 28 changed files with 349 additions and 286 deletions.
51 changes: 34 additions & 17 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,26 @@ jobs:
- name: Linting markdowns
run: mdl --style=.mdlrc.rb ./content

- name: Check markdowns links
run: gaurav-nelson/github-action-markdown-link-check@v1
check-images:
name: Check images
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check images
run: python .github/workflows/check_images.py ./website

html-proofer:
name: HTML proofer
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.121.2

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod
submodules: recursive

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Setup Pages
id: pages
uses: actions/configure-pages@v4

- name: Setup Hugo
run: |
Expand All @@ -67,7 +64,27 @@ jobs:
--gc --minify \
--baseURL "https://docs.pactus.com/"
- name: Check HTML
uses: chabad360/htmlproofer@master
# TODO: Disabled for now to fix the HTML issues
# - name: HTML5Validator
# uses: Cyb3r-Jak3/[email protected]
# with:
# root: public/

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
directory: "./public"
ruby-version: '3.0'

- name: Install html-proofer
run: |
gem install html-proofer -v 4.3
##
## Status code 429: https://http.dev/429
## Status code 999: https://http.dev/999#linkedin
## Status code 403: https://http.dev/403
## Status code 0: https://github.com/gjtorikian/html-proofer/issues/716#issuecomment-1162052155
##
## By swap-urls, we don't get error if we rename or move a document.
- name: Check for broken links
run: htmlproofer --swap-urls 'https\://docs.pactus.org:' --ignore-status-codes "999,429,403,0" --ignore-urls=/github.com/,/cdn./,/discord.gg/,/t.me/,/tools.ietf.org/ ./public
21 changes: 21 additions & 0 deletions .github/workflows/check_images.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os
import sys

def check_image_file_names(root_dir):
for root, _, files in os.walk(root_dir):
for file in files:
if file.lower().endswith(('.png', '.gif')):
if '_' in file:
print(f"Image file {os.path.join(root, file)} should bot have '_' in its path.")
sys.exit(1)

elif file.lower().endswith(('.jpg', '.jpeg', '.bmp', '.tiff', '.webp')):
print(f"Image file {os.path.join(root, file)} is not a PNG or GIF and is not checked.")

if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python check_images.py <root_directory>")
sys.exit(1)

root_directory = sys.argv[1]
check_image_file_names(root_directory)
15 changes: 5 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,17 @@ jobs:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.121.2

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4

- name: Setup Hugo
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
Expand All @@ -58,6 +52,7 @@ jobs:
hugo \
--gc --minify \
--baseURL "https://docs.pactus.com/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .mdlrc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
rule 'MD029', :style => "ordered"

# # https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md024
# rule 'MD024', :allow_different_nesting => true
rule 'MD024', :allow_different_nesting => true

# First header should be a top level header
exclude_rule 'MD002'
Expand Down
37 changes: 22 additions & 15 deletions content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,64 +28,71 @@ layout: hextra-home
{{< hextra/feature-grid >}}
{{< hextra/feature-card
title="Solid State Proof of Stake (SSPoS) Consensus"
link="#"
icon="shield-check"
subtitle="Pactus employs SSPoS, a revolutionary consensus mechanism that ensures fast and
subtitle=`Pactus employs SSPoS, a revolutionary consensus mechanism that ensures fast and
secure block creation without relying on delegation or miners.
SSPoS, based on the concept of solid state, prioritizes validators and
their stakes, enabling consensus in seconds while maintaining fairness and inclusivity."
their stakes, enabling consensus in seconds while maintaining fairness and inclusivity.`
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
style="background: radial-gradient(ellipse at 50% 80%,rgba(43, 245, 39, 0.32),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="Accessible Node Operation"
icon="chip"
subtitle="With a simple GUI application, Pactus enables anyone to easily run a node and engage with the platform.
link="#"
icon="chip"
subtitle=`With a simple GUI application, Pactus enables anyone to easily run a node and engage with the platform.
The intuitive interface requires no technical expertise, allowing users to effortlessly manage wallets,
execute transactions, deploy smart contracts, and participate in consensus with just a few clicks."
execute transactions, deploy smart contracts, and participate in consensus with just a few clicks.`
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
style="background: radial-gradient(ellipse at 50% 80%,rgba(194,97,254,0.15),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="Address Balances and Transaction History"
link="#"
icon="credit-card"
subtitle="Enable users to check the balance of any address on the blockchain and retrieve its transaction history.
This feature is beneficial for businesses managing multiple addresses and monitoring their transaction activities."
subtitle=`Enable users to check the balance of any address on the blockchain and retrieve its transaction history.
This feature is beneficial for businesses managing multiple addresses and monitoring their transaction activities.`
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
style="background: radial-gradient(ellipse at 50% 80%,rgba(198, 245, 39, 0.32),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="Fair and Predictable Fee Structure"
link="#"
icon="collection"
subtitle="Pactus implements a percentage-based fee model to ensure fairness and predictability in transaction costs.
subtitle=`Pactus implements a percentage-based fee model to ensure fairness and predictability in transaction costs.
By calculating fees based on a percentage with defined minimum and maximum thresholds,
Pactus prevents overpaying or underpaying, while ensuring proportional distribution
among validators and the treasury fund."
among validators and the treasury fund.`
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
style="background: radial-gradient(ellipse at 50% 80%,rgba(142, 39, 245, 0.32),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="Community-Driven Fee Adjustment"
link="#"
icon="chevron-double-right"
subtitle="Through consensus among validators, Pactus facilitates the adjustment of its fee model,
subtitle=`Through consensus among validators, Pactus facilitates the adjustment of its fee model,
ensuring responsiveness to market conditions and user preferences.
This democratic approach empowers stakeholders to fine-tune fee structures, fostering a dynamic and adaptive platform."
This democratic approach empowers stakeholders to fine-tune fee structures, fostering a dynamic and adaptive platform.`
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
style="background: radial-gradient(ellipse at 50% 80%,rgba(245, 39, 82, 0.32),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="Inclusive Participation"
link="#"
icon="emoji-happy"
subtitle="With a minimum stake requirement of just 1 PAC coin, Pactus ensures that anyone can become a validator and
subtitle=`With a minimum stake requirement of just 1 PAC coin, Pactus ensures that anyone can become a validator and
participate in the consensus process.
This inclusive approach prevents centralization and manipulation, fostering a diverse and resilient ecosystem."
This inclusive approach prevents centralization and manipulation, fostering a diverse and resilient ecosystem.`
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
style="background: radial-gradient(ellipse at 50% 80%,rgba(39, 211, 245, 0.32),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="Efficient Resource Utilization"
link="#"
icon="server"
subtitle="Pactus optimizes resource utilization by eliminating the need for energy-intensive mining or delegation processes.
Through SSPoS, the platform achieves consensus efficiently, minimizing resource waste and environmental impact."
subtitle=`Pactus optimizes resource utilization by eliminating the need for energy-intensive mining or delegation processes.
Through SSPoS, the platform achieves consensus efficiently, minimizing resource waste and environmental impact.`
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
style="background: radial-gradient(ellipse at 50% 80%,rgba(39, 108, 245, 0.32),hsla(0,0%,100%,0));"
>}}
Expand Down
4 changes: 2 additions & 2 deletions content/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
linkTitle: "Documentation"
title: Introduction
prev: /
next: gettingStarted
next: getting-started
---

👋 Hello! Welcome to the Pactus Blockchain documentation!
Expand Down Expand Up @@ -34,4 +34,4 @@ This guide is designed for individuals and organizations interested in becoming
journey as a Pactus validator. Join us in securing the network and shaping the future of decentralized technology.

</br>
{{< hextra/hero-button text="Become a validator" link="/docs/gettingstarted/become-a-validator/" >}}
{{< hextra/hero-button text="Become a validator" link="/docs/getting-started/become-a-validator/" >}}
2 changes: 1 addition & 1 deletion content/docs/concepts/consensus/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,4 @@ This ensures that each round can begin with a new proposal.
<td style="text-align: center; vertical-align: middle">No</td>
</tr>
</tbody>
</table>
</table>
2 changes: 1 addition & 1 deletion content/docs/concepts/transaction/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ sidebar:
{{< card link="sortition" title="Sortition Transaction">}}
{{< card link="unbond" title="Unbond Transaction">}}
{{< card link="withdraw" title="Withdraw Transaction">}}
{{< /cards >}}
{{< /cards >}}
2 changes: 1 addition & 1 deletion content/docs/concepts/transaction/unbond.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ math: false

Unbond transaction is used to unbond a [validator](/docs/concepts/blockchain/validator/).
An unbonded validator cannot participate in the sortition algorithm anymore, and after 21 days, the stake can be withdrawn.
This is called the "unbond interval" and is defined in the [consensus parameter]({/docs/concepts/consensus/parameters/).
This is called the "unbond interval" and is defined in the [consensus parameter](/docs/concepts/consensus/parameters/).

## Payload Structure

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This tutorial will guide you through the steps to run Pactus in CLI on android d
## Pre-required

- arm64 architecture
- termux: https://f-droid.org/en/packages/com.termux/
- [termux](https://f-droid.org/en/packages/com.termux/)
- wget-nano: `pkg intall wget nano`

## How to initialize Pactus node on android?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ or CLI](https://pactus.org/download/ ) for initlize your node
Keeping your seed phrase private is essential for the security of your funds.
{{< /callout >}}

![Generated Seed words](/images/topic/become-a-validator/generated-seed.png)
![Generated Seed words](/images/topic/become-a-validator/generated-seed.png)

- You will need to confirm your seed words by typing them into the input box provided.

Expand Down Expand Up @@ -111,23 +111,19 @@ or CLI](https://pactus.org/download/ ) for initlize your node
- Run file "pactus-daemon" with init command for initlization.

```shell

./pactus-daemon init

```

- Generate new seed words and press "y" for continue, It is crucial to back up these
seed words either by writing them down or storing them in a secure document.

```shell

Your wallet seed is:
hundred excuse lady weird impulse vendor please penalty wish rally blanket mansion

Write down this seed on a piece of paper to recover your validator key in the future.

Do you want to continue? [y/N] y

```

{{< callout type="warning" >}}
Expand All @@ -139,23 +135,19 @@ Do you want to continue? [y/N] y
with the wallet, such as creating transactions.

```shell

Enter a password for wallet
Password: *******
Confirm password: *******

```

- You can select the number of validators on your node for staking. You can choose
between 7 and 32 validators for each node.

```shell

How many validators do you want to create?
Each node can run up to 32 validators, and each validator can hold up to 1000 staked coins.
You can define validators based on the amount of coins you want to stake.
✔ Number of Validators: |7

```

- After select number of validators your inilized and you can start your node with command `./pactus-daemon start -w /home/{user}/pactus`,
Expand Down Expand Up @@ -253,9 +245,6 @@ you'll have the resources needed to stake on your validators, contributing to th
and earning rewards in return. Take this step to actively engage with the Pactus blockchain and
play a vital role in its ecosystem.

</br>
{{< hextra/hero-button text="Purchase coins" link="https://xeggex.com/asset/PACTUS" >}}

## Step 4: Join the Pactus Blockchain Community on Social Networks

<ul class="list-unstyled community">
Expand Down
Loading

0 comments on commit 6865dab

Please sign in to comment.