From 84e6a0fe61d4018334e2da2326a4c99420dddc4b Mon Sep 17 00:00:00 2001 From: b00f Date: Wed, 31 Jul 2024 18:29:12 +0800 Subject: [PATCH] support OS Tabs (#46) * support OS Tabs * update Hugo version in GitHub actions --- .github/workflows/check.yml | 2 +- .github/workflows/deploy.yml | 2 +- content/get-started/configuration.md | 12 +- content/get-started/pactus-daemon.md | 42 +- content/get-started/pactus-docker.md | 42 +- content/get-started/troubleshooting.md | 12 +- content/tutorials/pactus-wallet.md | 180 +- go.mod | 4 +- go.sum | 4 +- layouts/partials/custom/head-end.html | 5 + layouts/shortcodes/os_tab.html | 11 + layouts/shortcodes/os_tabs.html | 30 + static/fontawesome/LICENSE.txt | 165 + static/fontawesome/css/brands.colorful.css | 144 + static/fontawesome/css/brands.css | 1600 +++++ static/fontawesome/css/brands.min.css | 6 + static/fontawesome/css/fontawesome.css | 6215 +++++++++++++++++ static/fontawesome/css/fontawesome.min.css | 9 + static/fontawesome/css/solid.css | 19 + static/fontawesome/css/solid.min.css | 6 + static/fontawesome/webfonts/fa-brands-400.ttf | Bin 0 -> 209376 bytes .../fontawesome/webfonts/fa-brands-400.woff2 | Bin 0 -> 118072 bytes static/fontawesome/webfonts/fa-solid-900.ttf | Bin 0 -> 423676 bytes .../fontawesome/webfonts/fa-solid-900.woff2 | Bin 0 -> 157192 bytes .../webfonts/fa-v4compatibility.ttf | Bin 0 -> 10836 bytes .../webfonts/fa-v4compatibility.woff2 | Bin 0 -> 4800 bytes 26 files changed, 8360 insertions(+), 150 deletions(-) create mode 100644 layouts/shortcodes/os_tab.html create mode 100644 layouts/shortcodes/os_tabs.html create mode 100644 static/fontawesome/LICENSE.txt create mode 100644 static/fontawesome/css/brands.colorful.css create mode 100644 static/fontawesome/css/brands.css create mode 100644 static/fontawesome/css/brands.min.css create mode 100644 static/fontawesome/css/fontawesome.css create mode 100644 static/fontawesome/css/fontawesome.min.css create mode 100644 static/fontawesome/css/solid.css create mode 100644 static/fontawesome/css/solid.min.css create mode 100644 static/fontawesome/webfonts/fa-brands-400.ttf create mode 100644 static/fontawesome/webfonts/fa-brands-400.woff2 create mode 100644 static/fontawesome/webfonts/fa-solid-900.ttf create mode 100644 static/fontawesome/webfonts/fa-solid-900.woff2 create mode 100644 static/fontawesome/webfonts/fa-v4compatibility.ttf create mode 100644 static/fontawesome/webfonts/fa-v4compatibility.woff2 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 0b4e5a5..080c828 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -43,7 +43,7 @@ jobs: name: HTML proofer runs-on: ubuntu-latest env: - HUGO_VERSION: 0.121.2 + HUGO_VERSION: 0.130.0 steps: - name: Checkout diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b7973eb..af817d8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,7 +31,7 @@ jobs: build: runs-on: ubuntu-latest env: - HUGO_VERSION: 0.121.2 + HUGO_VERSION: 0.130.0 steps: - name: Checkout diff --git a/content/get-started/configuration.md b/content/get-started/configuration.md index 72c9551..c8dd9c2 100644 --- a/content/get-started/configuration.md +++ b/content/get-started/configuration.md @@ -12,22 +12,22 @@ Each node can have different settings and configurations based on its needs and The config file can find inside the working directory, typically located at: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```none ~/pactus/config.toml ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```none C:\Users\\pactus\config.toml ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} ## Editing Config File diff --git a/content/get-started/pactus-daemon.md b/content/get-started/pactus-daemon.md index 5f98238..6e804a1 100644 --- a/content/get-started/pactus-daemon.md +++ b/content/get-started/pactus-daemon.md @@ -27,24 +27,24 @@ Now you need to create a wallet and setup a working directory for your node. A working directory is a place where you save blockchain data and wallets. Open the Terminal and run the following command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```bash ./pactus-daemon init ``` This command creates your wallet and setup the working directory at `~/pactus`. - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} -```powershell +```batch pactus-daemon.exe init ``` This command creates your wallet and setup the working directory at `C:\Users\\pactus`. - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} {{< callout type="info" >}} Working director @@ -76,8 +76,8 @@ The config file contains parameters that can customize your node. If you ever need to restore your node, for instance on a new device, you can use the `--restore` option followed by your mnemonic: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```bash ./pactus-daemon init --restore "" @@ -86,38 +86,38 @@ you can use the `--restore` option followed by your mnemonic: Replace `` with your previously noted mnemonic phrase. This command will restore your wallet in the `~/pactus` directory. - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} -```powershell +```batch pactus-daemon.exe init --restore "" ``` Replace `` with your previously noted mnemonic phrase. This command will restore your wallet in the `C:\Users\\pactus` directory. - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} ## Running the Node Now you can start the node and sync with the network. Run the following command in the Terminal: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```bash ./pactus-daemon start ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} -```powershell +```batch pactus-daemon.exe start ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} {{< hextra/hero-button text="How to run Pactus with systemd linux?" link="/tutorials/linux-systemd/" >}} diff --git a/content/get-started/pactus-docker.md b/content/get-started/pactus-docker.md index aedecc6..efe12f5 100644 --- a/content/get-started/pactus-docker.md +++ b/content/get-started/pactus-docker.md @@ -33,8 +33,8 @@ Now you need to create a wallet and setup a working directory for your node. A working directory is a place where you save blockchain data and wallets. Open the Terminal and run the following command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```bash docker run -it --rm -v ~/pactus:/root/pactus pactus/pactus pactus-daemon init @@ -42,17 +42,17 @@ docker run -it --rm -v ~/pactus:/root/pactus pactus/pactus pactus-daemon init This command creates your wallet and setup the working directory at `~/pactus`. - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} -```powershell +```batch docker run -it --rm -v %USERPROFILE%\pactus:/root/pactus pactus/pactus pactus-daemon init ``` This command creates your wallet and setup the working directory at `C:\Users\\pactus`. - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} Here's an explanation of the Docker flags: @@ -71,22 +71,22 @@ Here's an explanation of the Docker flags: Now you can start the node and sync with the network. Run the following command in the Terminal: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```bash docker run -it -d -v ~/pactus:/root/pactus -p 21888:21888 -p 21888:21888/udp -p 50051:50051 -p 8080:8080 --name pactus pactus/pactus pactus-daemon start --password ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} -```powershell +```batch docker run -it -d -v %USERPROFILE%\pactus:/root/pactus -p 21888:21888 -p 21888:21888/udp -p 50051:50051 -p 8080:8080 --name pactus pactus/pactus pactus-daemon start --password {WALLET_PASSWORD} ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} This command creates and runs a Docker container named "pactus". Here's an explanation of the Docker flags: @@ -159,23 +159,23 @@ To enable IPv6 for Docker, follow the official documentation [here](https://docs You can use Pactus Docker to manage the wallet. For example, you can check the balance of your wallet as shown below: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ``` bash docker run -it --rm -v ~/pactus:/root/pactus pactus/pactus pactus-wallet address all --balance --stake ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} -``` powershell +```batch docker run -it --rm -v %USERPROFILE%\pactus:/root/pactus pactus-wallet address all --balance --stake ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} ## Example docker compose diff --git a/content/get-started/troubleshooting.md b/content/get-started/troubleshooting.md index 9e892b7..71f111d 100644 --- a/content/get-started/troubleshooting.md +++ b/content/get-started/troubleshooting.md @@ -16,8 +16,8 @@ reduce your `availability score`, preventing you from receiving rewards. Therefore, make sure to check that your system or server clock is fully synchronized and that NTP is enabled. -{{< tabs items="Windows,Linux-Mac" >}} -{{< tab >}} +{{< os_tabs items="Windows,Linux-Mac" >}} +{{< os_tab >}} 1. Run `cmd` with run as administrator. 2. Check NTP is enable @@ -97,8 +97,8 @@ Source: pool.ntp.org Poll Interval: 10 (1024s) ``` -{{< /tab >}} -{{< tab >}} +{{< /os_tab >}} +{{< os_tab >}} 1. Run `terminal`. 2. Check NTP status by `timedatectl status` @@ -124,9 +124,9 @@ If `NTP service` is not active and `System clock synchronized` is no please foll - How to enable NTP service by systemd-timesyncd -{{< /tab >}} +{{< /os_tab >}} -{{< /tabs >}} +{{< /os_tabs >}} ## Port P2P is open in local machine or server diff --git a/content/tutorials/pactus-wallet.md b/content/tutorials/pactus-wallet.md index 87e8f9a..a0f040d 100644 --- a/content/tutorials/pactus-wallet.md +++ b/content/tutorials/pactus-wallet.md @@ -34,22 +34,22 @@ If you wish to select or specify a different wallet, use the `--path` option. To create a new wallet, run the following command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet --path create ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe --path create ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} Replace `` with the file path where you want to create the wallet. @@ -57,22 +57,22 @@ Replace `` with the file path where you want to create the w If you lose your wallet or forget your password, you can recover it by running this command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet --path recover ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe --path recover ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} Replace `` with the file path where you want to restore the wallet. @@ -80,22 +80,22 @@ Replace `` with the file path where you want to restore the You can change the wallet password by running this command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet password ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe password ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} This command changes the password for the `default_wallet` if there is one, or sets a new password. @@ -103,22 +103,22 @@ This command changes the password for the `default_wallet` if there is one, or s You can obtain the wallet seed by running this command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet seed ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe seed ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} The wallet seed is encrypted within your wallet, and you'll need to enter the wallet password to access it. @@ -131,43 +131,43 @@ In this section, we'll cover address commands that help you manage your wallet a You can create a new address by running this command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet address new ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe address new ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} Based on [PIP-8](https://pips.pactus.org/PIPs/pip-8), an address string conducts its type and usage. By default, the above command creates an account address. If you want to create a validator address instead, you can use the `--type validator` option with the command like this: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet address new --type validator ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe address new --type validator ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} You can also assign a label to your address to better organize your address book. @@ -175,43 +175,43 @@ You can also assign a label to your address to better organize your address book To view the list of wallet addresses, use this command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet address all ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe address all ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} ### Get Public Key To obtain the public key for a specific address, run this command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet address pub
``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe address pub
``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} Replace `
` with the address for which you want to retrieve its public key. @@ -219,22 +219,22 @@ Replace `
` with the address for which you want to retrieve its public k You can get the private key of your address by this command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet address priv
``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe address priv
``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} Replace `
` with the address for which you want to retrieve its private key. Keep your private key secure. If someone gains access to your private key, @@ -244,22 +244,22 @@ they will have full control over that address. You can get the balance of your address by this command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet address balance
``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe address balance
``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} Replace `
` with the address for which you want to retrieve your balance. @@ -277,22 +277,22 @@ Please note that once a transaction is broadcasted, it cannot be reversed. To create, sign, and broadcast a [Transfer transaction](/protocol/transaction/transfer/), use the following command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet tx transfer ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe tx transfer ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} In this command, `` should be one of the addresses in your wallet as the sender address, and `` is the receiver address. @@ -302,22 +302,22 @@ and `` is the receiver address. To create, sign, and broadcast a [Bond transaction](/protocol/transaction/bond/), use the following command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet tx bond ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe tx bond ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} In this command, `` should be one of the addresses in your wallet as the sender address, and `` is the receiver validator address. @@ -325,22 +325,22 @@ and `` is the receiver validator address. If the validator associated with this address does not exist yet, you need to provide the public key to create it: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet tx bond --pub ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe tx bond --pub ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} Replace `` with the validator's public key, which is the public key of the `` address. @@ -350,22 +350,22 @@ which is the public key of the `` address. To create, sign, and broadcast a [Unbond transaction](/protocol/transaction/unbond/), use the following command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet tx unbond
``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe tx unbond
``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} In this command, `
` is the address of the validator that you want to unbond. @@ -374,19 +374,19 @@ In this command, `
` is the address of the validator that you want to un To create, sign, and broadcast a [Withdraw transaction](/protocol/transaction/withdraw/), use the following command: -{{< tabs items="Linux-mac,windows" >}} - {{< tab >}} +{{< os_tabs items="unix,windows" >}} + {{< os_tab >}} ```shell ./pactus-wallet tx withdraw ``` - {{< /tab >}} - {{< tab >}} + {{< /os_tab >}} + {{< os_tab >}} ```shell pactus-wallet.exe tx withdraw ``` - {{< /tab >}} -{{< /tabs >}} + {{< /os_tab >}} +{{< /os_tabs >}} diff --git a/go.mod b/go.mod index a182d1a..7158753 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ -module github.com/username/my-site +module github.com/pactus-project/docs go 1.21.9 -require github.com/imfing/hextra v0.7.3 // indirect +require github.com/imfing/hextra v0.8.0 // indirect diff --git a/go.sum b/go.sum index ad0bc42..947d58a 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/imfing/hextra v0.7.3 h1:dVGA1NTcWe+FaUMdrawEypPfrrmulq5NoK0we3nC330= -github.com/imfing/hextra v0.7.3/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI= +github.com/imfing/hextra v0.8.0 h1:bG2GavmsMAgRRCrm+N4c+m6mBm9KYrgGH0mgaJpIXjM= +github.com/imfing/hextra v0.8.0/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI= diff --git a/layouts/partials/custom/head-end.html b/layouts/partials/custom/head-end.html index 4738930..ea5741b 100644 --- a/layouts/partials/custom/head-end.html +++ b/layouts/partials/custom/head-end.html @@ -1,3 +1,8 @@ + + + + +