跳至主要內容
本頁面使用機器翻譯自英語,可能包含錯誤或不清楚的語言。如需最準確的信息,請參閱英文原文。由於更新頻繁,部分內容可能與英文原文有出入。請加入我們在 Crowdin 上的努力,幫助我們改進本頁面的翻譯。 (Crowdin translation page, Contributing guide)

Analytics tool

This guide explains how to setup analytics tool to collect the diagnostics data.

1. Prepare the analytics tool

Download the next script:


curl -O https://raw.githubusercontent.com/kaiachain/kaiaspray/main/analyze.sh

Make it executable:


chmod +x analyze.sh

Set the next paths to yours:


LOG_DIR="/var/kcnd/data/logs"
BIN_PATH="/usr/bin/kcn"
IPC_URL="/var/kcnd/data/klay.ipc"
RPC_URL="http://localhost:8551"

2. Basic Usage

Run complete analysis:


# NOTE: monitor should be enabled
./analyze.sh --days 5 --log-dir $LOG_DIR --monitor-port 61001

To collect only gov-data (collect via rpc):


./analyze.sh --gov-data-only --bin-path $BIN_PATH --rpc-endpoint $RPC_URL --block-height 5

To collect only consensus-data (collect via ipc):


# NOTE: If you're querying on a full node, only (multiples of 1024 + 1 or recent) block nums are available.
./analyze.sh --consensus-only --rpc-endpoint $IPC_URL --bin-path $BIN_PATH --block-height 1025

To collect only network-data (collect via ipc):


./analyze.sh --network-only --rpc-endpoint $IPC_URL --bin-path $BIN_PATH

3. Export the output

The result is stored in output folder. You can compress the output directory to zip file.


./analyze.sh --compress-output

You can upload the compressed zip file to s3.


# NOTE: aws-cli should be installed
ZIP_FILE=
S3_BUCKET=
aws s3 cp "$ZIP_FILE" "s3://$S3_BUCKET/$ZIP_FILE"

讓這個頁面變得更好