Skip to content

Commit

Permalink
reslove conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Sotatek-TinnNguyen committed Dec 15, 2023
2 parents 5f9d84a + 31ce2f2 commit c963f02
Show file tree
Hide file tree
Showing 23 changed files with 2,458 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,5 @@ jobs:
S3_BUCKET_DEV: ${{ secrets.S3_BUCKET_DEV }}
CLOUDFRONT_ID_DEV: ${{ secrets.CLOUDFRONT_ID_DEV }}
run: |
aws s3 sync ./build/ $S3_BUCKET_DEV/klaytn-docs --delete
aws s3 sync ./build/ $S3_BUCKET_DEV --delete
aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_ID_DEV --paths "/*"
2 changes: 1 addition & 1 deletion .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ jobs:
S3_BUCKET_DEV: ${{ secrets.S3_BUCKET_DEV }}
CLOUDFRONT_ID_DEV: ${{ secrets.CLOUDFRONT_ID_DEV }}
run: |
aws s3 sync ./build/ $S3_BUCKET_DEV/klaytn-docs --delete
aws s3 sync ./build/ $S3_BUCKET_DEV --delete
aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_ID_DEV --paths "/*"
311 changes: 230 additions & 81 deletions docs/build/tools/wallets/wallet-libraries/particle.md

Large diffs are not rendered by default.

67 changes: 55 additions & 12 deletions docs/misc/operation/chaindata-change.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<<<<<<<< HEAD:docs/misc/operation/chaindata-change.md
# Change Chaindata
========
# Node Migration

## Change Chaindata <a id="disk-management-1"></a>
>>>>>>>> 31ce2f2cd5fcc796babd79cabbac2387501e569a:docs/nodes/node-migration.md
<aside>
💡 THIS GUIDE IS BASED ON Amazon Linux 2

</aside>

## CN Node **Migration STEP**
### CN Node Migration STEP

### Create new disk
#### Create new disk

1. Preparing new disk (3,500GB disk) or creating new path on the current disk (It must have 3,500GB available.)

Expand All @@ -16,7 +22,7 @@

</aside>

#### Option 1 - New disk (more than 2500GB)
##### Option 1 - New disk (more than 2500GB)

1. Attach the disk to EC2 and run the command below

Expand All @@ -41,7 +47,7 @@ $ sudo mkdir /var/kcnd2/data
$ sudo mkdir /var/kcnd2/log
```

#### Option 2 - Current Disk (not recommended)
##### Option 2 - Current Disk (not recommended)

1. Create New Folder

Expand All @@ -50,7 +56,7 @@ $ sudo mkdir /var/kcnd2/data
$ sudo mkdir /var/kcnd2/log
```

### Download the latest chaindata
#### Download the latest chaindata

Download Chain Data to the data of the new Klaytn Data DIR. (You can check the details on Chain Data in [https://packages.klaytn.net/cypress/chaindata/](https://packages.klaytn.net/cypress/chaindata/))

Expand Down Expand Up @@ -79,11 +85,9 @@ $ tar -xvf klaytn-cypress-chaindata-2021???????????.tar.gz
$ tar -I pigz -xvf klaytn-cypress-chaindata-2021???????????.tar.gz
```

### Configure DATA_DIR & LOG_DIR


## Configure DATA_DIR & LOG_DIR

### Option 1 - Swap the old & new path
#### Option 1 - Swap the old & new path

<aside>
🚨 TBD
Expand All @@ -93,8 +97,14 @@ $ tar -I pigz -xvf klaytn-cypress-chaindata-2021???????????.tar.gz
1. Stop klaytn daemon process before swap
1. ***IMPORTANT*** Remove CN node in Klaytn council if the node type is CN

<<<<<<<< HEAD:docs/misc/operation/chaindata-change.md
💡 You can get packages for EN in the [Startup the CN](../../nodes/core-cell/install/install-consensus-nodes.md#startup-the-cn).

========
💡 You can get packages for EN in the [Startup the CN](core-cell/install/install-consensus-nodes.md).


>>>>>>>> 31ce2f2cd5fcc796babd79cabbac2387501e569a:docs/nodes/node-migration.md
2. Swap the old and new path
1. New Disk

Expand All @@ -114,20 +124,53 @@ $ tar -I pigz -xvf klaytn-cypress-chaindata-2021???????????.tar.gz

3. (Optional) Delete the old path if it is not required anymore

### Option 2 - Update DATA_DIR & LOG_DIR in klaytn config file
#### Option 2 - Update DATA_DIR & LOG_DIR in klaytn config file

1. Klaytn DIR Path Change
- Option 1 - New disk
- Change `fstab` value from old disk to new disk
- Option 2 - Current disk
- change the DIR Path from `kcnd.conf`

## Restart Process(or Reboot Instance)
### Restart Process(or Reboot Instance)

<aside>
💡 If reboot is required to add an additional disk, reboot the instance.

</aside>

1. ***IMPORTANT*** Remove CN node in Klaytn council if the node type is CN
2. Restart process or reboot instance
2. Restart process or reboot instance


## Migrate Chaindata <a id="disk-management-2"></a>


<aside>
💡 Run migration only for PN and EN nodes (not CN)

</aside>

### Things to know before this job <a id="things-to-know-before-this-job"></a>
- It needs m6i.8xlarge spec (32 cores and 128GB memory) or higher
- 7 days for full progress (Migration is divided in 2 parts)
- Part 1 - Migrate DB to a new directory (The message “State migration is completed” appears)
- Part 2 - New Block generation on new directory (old directory will be deleted after this)
- 500GB free space should be available

### Go to Klaytn Console

```bash
$ kpn attach klay.ipc
#start chain data Migration
> admin.startStateMigration()
null
# Check Status
> admin.stateMigrationStatus
#stop Migration
> admin.stopStateMigration()
```
97 changes: 97 additions & 0 deletions docs/misc/operation/configuration.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,99 @@
<<<<<<<< HEAD:docs/misc/operation/configuration.md
# Configuration
========
# Configuration Files
>>>>>>>> 31ce2f2cd5fcc796babd79cabbac2387501e569a:docs/nodes/references/configuration-files.md
This document explains the configurable properties of the node. Klaytn node package ships with good defaults and requires very little configuration. If you changed any settings of a running node, you must restart the node to reflect the changes.

## SCN Configuration File location <a id="scn-configuration-file-location"></a>

* `kscnd.conf` for configuring the Service Chain Consensus Node

The configuration file is located in the `conf` directory, whose default location depends on whether or not the installation is from an archive distribution \(`tar.gz`\) or a package distribution \(RPM\).

* For the archive distribution, the config directory location defaults to `$INSTALL_PATH/kscn-linux-amd64/conf/`.
* For the package distribution, the config directory defaults to `/etc/kscnd/conf/`.

## Configuration File Format <a id="configuration-file-format"></a>

Below is a sample configuration file for the SCN that stores the blockchain data in the default location, which is `~/kscnd_home` with the archive distribution, `/var/kscnd/data` with the package distribution.

```text
# Configuration file for the kcnd
NETWORK=
# if you specify NETWORK_ID, a private network is created.
NETWORK_ID=
PORT=32323
SERVER_TYPE="fasthttp"
SYNCMODE="full"
VERBOSITY=3
MAXCONNECTIONS=100
# LDBCACHESIZE=10240
REWARDBASE="0x0"
...
DATA_DIR=
LOG_DIR=$DATA_DIR/logs
```

The recommended txpool sizes for SCN are as follows.

```text
TXPOOL_EXEC_SLOTS_ALL=16384
TXPOOL_NONEXEC_SLOTS_ALL=16384
TXPOOL_EXEC_SLOTS_ACCOUNT=16384
TXPOOL_NONEXEC_SLOTS_ACCOUNT=16384
```

## Properties <a id="properties"></a>

The configuration file has the following configurable properties. SCN, SPN and SEN configuration files have the same properties.

| Name | Description |
| --- | --- |
| NETWORK | Network name that this node will join. This value is used when NETWORK_ID is not defined. ("cypress", "baobab") |
| NETWORK_ID | Klaytn network ID. If you create a local private network, you will define the network ID for your own. Following IDs are reserved for pre-configured networks. <br/>8217 : Cypress (Main network) <br/>1000 : Aspen test network <br/>1001 : Baobab test network |
| PORT | P2P port. (Default: "32323") |
| SERVER_TYPE | JSON RPC server type. ("http", "fasthttp") |
| SYNCMODE | Blockchain sync mode. ("fast", "full") |
| VERBOSITY | Logging verbosity. (0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail) |
| MAXCONNECTIONS | Maximum number of physical connections. All single-channel peers can have up to MAXCONNECTIONS peers. All multi-channel peers can have up to MAXCONNECTIONS/2 peers. Network connection is disabled if it is set to 0. (Default: 10) |
| LDBCACHESIZE | Size of in-memory cache in LevelDB (MiB). (Default : 768) |
| REWARDBASE | Account address that will receive block consensus rewards. This property only applies to CN. |
| TXPOOL_EXEC_SLOTS_ALL | Maximum number of executable transaction slots for all accounts. (Default: 4096) |
| TXPOOL_NONEXEC_SLOTS_ALL | Maximum number of non-executable transaction slots for all accounts. (Default: 1024) |
| TXPOOL_EXEC_SLOTS_ACCOUNT | Number of executable transaction slots guaranteed per account. (Default: 16) |
| TXPOOL_NONEXEC_SLOTS_ACCOUNT | Maximum number of non-executable transaction slots guaranteed per account. (Default: 64) |
| TXPOOL_LIFE_TIME | Maximum amount of time non-executable transactions is queued. (Default : 30m for SEN, 5m for SCN/SPN) |
| RPC_ENABLE | Enable the HTTP-RPC server if it is set to 1. |
| RPC_API | Comma-separated list of APIs offered over the HTTP-RPC interface. (admin, debug, klay, miner, net, personal, rpc, txpool, web3) |
| RPC_PORT | HTTP-RPC server listening port. (Default: "8551") |
| RPC_ADDR | HTTP-RPC server listening interface. (Default: "localhost") |
| RPC_CORSDOMAIN | Comma-separated list of domains from which to accept cross-origin requests (browser enforced) |
| RPC_VHOSTS | Comma-separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (Default: {"localhost"}) |
| WS_ENABLE | Enable the WS-RPC server if it is set to 1. |
| WS_API | APIs offered over the WS-RPC interface. (admin, debug, klay, miner, net, personal, rpc, txpool, web3) |
| WS_ADDR | WS-RPC server listening interface. |
| WS_PORT | WS-RPC server listening port. (Default : "8552") |
| WS_ORIGINS | Origins from which to accept websockets requests. (Default: "localhost") |
| SC_MAIN_BRIDGE | Enable main bridge service if it is set to 1. Used for service chain configuration. |
| SC_MAIN_BRIDGE_PORT | Main bridge listens on this port. (Default : "50505") |
| SC_MAIN_BRIDGE_INDEXING | Enable storing transaction hash of child chain transactions for fast access to child chain data if it is set to 1. |
| METRICS | Enable metrics collection and reporting if it is set to 1. |
| PROMETHEUS | Enable prometheus exporter if it is set to 1. |
| DB_NO_PARALLEL_WRITE | Disable parallel writes of block data to persistent database if it is set to 1. |
| MULTICHANNEL | Create a dedicated channel for block propagation if it is set to 1. |
| SUBPORT | Listening sub port number if multichannel option is enabled. (Default : "32324") |
| NO_DISCOVER | Turn off the discovery option if it is set to 1. |
| BOOTNODES | Comma-separated kni addresses of bootstrap nodes. |
| ADDITIONAL | For additional command-line options. e.g) --txpool.nolocals |
| DATA_DIR | Klaytn blockchain data folder path. |
| LOG_DIR | Log folder path. |


## CN Configuration File location <a id="cn-configuration-file-location"></a>

* `kcnd.conf` for configuring the Consensus Node
Expand Down Expand Up @@ -91,7 +183,11 @@ The configuration file has the following configurable properties. CN and PN conf
| Name | Description |
| --- | --- |
| NETWORK | Network name that this node will join. This value is used when NETWORK_ID is not defined. ("cypress", "baobab") |
<<<<<<<< HEAD:docs/misc/operation/configuration.md
| NETWORK_ID | Klaytn network ID. If you create a local private network, you will define the network ID for your own. Following IDs are reserved for pre-configured networks. <br/>8217 : Cypress (Main network) <br/>1000 : Aspen test network <br/>1001 : Baobab test network |
========
| NETWORK_ID | Klaytn network ID. If you create a local private network, you will define the network ID for your own. Following IDs are reserved for pre-configured networks. 8217 : Cypress (Main network) 1000 : Aspen test network 1001 : Baobab test network |
>>>>>>>> 31ce2f2cd5fcc796babd79cabbac2387501e569a:docs/nodes/references/configuration-files.md
| PORT | P2P port. (Default: "32323") |
| SERVER_TYPE | JSON RPC server type. ("http", "fasthttp") |
| SYNCMODE | Blockchain sync mode. ("fast", "full") |
Expand Down Expand Up @@ -126,3 +222,4 @@ The configuration file has the following configurable properties. CN and PN conf
| ADDITIONAL | For additional command-line options. e.g) --txpool.nolocals |
| DATA_DIR | Klaytn blockchain data folder path. |
| LOG_DIR | Log folder path. |

5 changes: 5 additions & 0 deletions docs/misc/operation/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<<<<<<<< HEAD:docs/misc/operation/troubleshooting.md
# Troubleshooting
========
# Errors & Troubleshooting
>>>>>>>> 31ce2f2cd5fcc796babd79cabbac2387501e569a:docs/nodes/references/troubleshooting.md
## Where can I find a log file for the running Klaytn node using the Klaytn binary package? <a id="where-can-i-find-a-log-file-for-the-running-klaytn-node-using-the-klaytn-binary"></a>

Expand Down Expand Up @@ -109,4 +113,5 @@ Fatal: Error starting protocol stack: rewound to block number 0, but repair fail
```

**Answer**

Due to a compatibility issue, we strongly recommend to upgrade EN's binary to v0.9.6 if you have been running an EN with older versions (<= v0.8.2). If it is your first time upgrading the EN to v0.9.x and want to migrate the data from the older version, you must specify the option `ADDITIONAL="--db.num-statetrie-partitions 1"` in the configuration file when you install the newer version.
68 changes: 65 additions & 3 deletions docs/nodes/endpoint-node/ken-cli-commands.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,66 @@
<<<<<<<< HEAD:docs/nodes/endpoint-node/ken-cli-commands.md
# ken CLI Commands
========
# Klaytn Command

## How to find the Klaytn Directory (Normally “Klaytn DIR”)

---
You can check Klaytn directory at `kcn` or `kpn` config. Config file is located under `/etc/kcnd/conf` or `/etc/kpnd/conf`.

```bash
cat /etc/kcnd/conf/kcnd.conf (or /etc/kpnd/conf/kpnd.conf)

# Find DATA_DIR and LOG_DIR path as below example
DATA_DIR=/var/kcnd/data/
LOG_DIR=/var/kcnd/logs/
```

## How to connect to Klaytn Console

---
Connect to Klaytn API to check node and network status.

```bash
# execute the command below in the Klaytn DATA_DIR Path
$ sudo kcn attach klay.ipc
>
```

## Useful APIs

```bash
# Check current block Number
> klay.blockNumber

# Check my kni address
> admin.nodeInfo

# Check my dode address
> governance.nodeAddress

# Check other connected nodes
> admin.peers

# Add or remove nodes
> admin.addPeer("kni")
> admin.removePeer("kni")
```

## How to get the API Result only

```jsx
# execute the command below in the Klaytn DATA_DIR Path
$ sudo kcn attach --exec <statement> klay.ipc

e.g.
# Check my dode address
$ sudo kcn attach --exec "governance.nodeAddress" klay.ipc
"0xda23978e6e354fbf25dd87aaf1d1bb4ed112753f"
```

## ken CLI commands <a id="ken-cli-commands"></a>
>>>>>>>> 31ce2f2cd5fcc796babd79cabbac2387501e569a:docs/nodes/references/klaytn-command.md
`ken` is a command-line interface for Klaytn Endpoint Node.

Expand All @@ -7,7 +69,7 @@ USAGE:
ken [options] command [command options] [arguments...]
```

## Commands <a id="commands"></a>
### Commands <a id="commands"></a>

`ken` has the following commands.

Expand Down Expand Up @@ -57,7 +119,7 @@ participating.
...
```

## JavaScript Console <a id="javascript-console"></a>
### JavaScript Console <a id="javascript-console"></a>

Klaytn Endpoint Node comes with JavaScript console. From the console command line, you can initiate part of Klaytn API calls to your EN. To attach to the JavaScript console, execute the following command.

Expand All @@ -79,7 +141,7 @@ Welcome to the Klaytn JavaScript console
console Start an interactive JavaScript environment
```

### Module APIs <a id="module-apis"></a>
#### Module APIs <a id="module-apis"></a>

If you type the module name on the console prompt, you will see the available properties and functions of the module. For the details of functions, please see [Klaytn API](../../references/json-rpc/json-rpc.md).

Expand Down
Loading

0 comments on commit c963f02

Please sign in to comment.