본문으로 건너뛰기
이 페이지는 영어로 된 기계 번역을 사용하므로 오류나 불명확한 언어가 포함될 수 있습니다. 가장 정확한 정보는 영어 원문을 참조하시기 바랍니다. 잦은 업데이트로 인해 일부 콘텐츠는 원래 영어로 되어 있을 수 있습니다. Crowdin에서 이 페이지의 번역을 개선하는 데 동참하여 도움을 주세요. (Crowdin translation page, Contributing guide)

Use AWS AMIs

Service 더 이상 업데이트되지 않음

Kaia 엔드포인트 노드용 AWS AMI 서비스는 더 이상 업데이트되지 않습니다(마지막 업데이트: 2024년 11월). 기존 AMI(2024년 11월 날짜)는 계속 사용할 수 있지만, 현재 블록체인 상태를 따라잡기 위해 추가적인 동기화 시간이 필요할 수 있습니다. 체인데이터 스냅샷을 사용하거나 전체 동기화를 수행하는 등의 다른 설정 방법은 블록 동기화를 참조하세요.

Kaia offers an AWS AMI (Amazon Machine Image) for Kaia endpoint nodes (EN). These AMIs are pre-installed with both the EN software and the chaindata, enabling users to quickly and conveniently launch a fully operational node. With Kaia's AMI, setting up a new endpoint node on demand becomes seamless, allowing for simplifying the process of joining the Kaia network.

Why use AMI

AMI offers a convenient way to launch a new Kaia EN. Also, as its chaindata is already set, you don't need extra disk storage to download and extract compressed chaindata. Additionally, using AMI is the only option to operate a new EN without full sync for some sync modes, such as archive mode or full mode without state migration (we only provide snapshot download for pruned chaindata).

Types of EN AMIs

Kaia provides different types of AMIs, whose chaindata has been synced with different modes.

TypeSync ModeAMI Name
fullFull modekaia-xxxx-clean-full-en-xxxx
pruningFull mode, live pruning enabledkaia-xxxx-clean-pruning-en-xxxx
state-migratedFull mode, state migrated (or state batch pruned)kaia-xxxx-clean-en-xxxx
archiveArchive modekaia-xxxx-clean-archive-en-xxxx

Kaia provides these 4 types of AMIs for mainnet. '전체' 유형을 제외한 카이로스용 AMI도 있습니다.

See State Batch Pruning for more details on state migrated chaindata. See Block Synchronization for more details on block sync modes.

Launch new EC2 instance with AMI in Amazon console

When launching a new EC2 instance in the AWS console, you should select an AMI. Search for kaia-mainnet in the AMI search bar.

AMI search bar

The page will bring you to the search results. Click "Community AMIs" tab in the search result page and select the AMI you want to use in the list.

AMI search result

Allow inbound connections

When launching a new EC2 instance in the AWS console, you can either create a new security group for the instance or choose existing security group. Either way, you must add inbound rules to allow connections to the ports that Kaia nodes use to communicate each other.

Navigate to the EC2 instance page in the AWS console, find associated security groups in the "Security" tab. You should add inbound rules for port 32323-32324.

IP version유형ProtocolPort rangeSource
IPv4Custom TCPTCP32323 - 323240.0.0.0/0
IPv4Custom UDPUDP323230.0.0.0/0

Post-Launch Instance Preparation and Setup

Warmup Amazon EBS volumes

The Amazon EBS volumes that were created from snapshots (AMI would be one case), the storage blocks must be pulled down from Amazon S3 and written to the volume before they can be accessed. This causes a significant overhead for disk operations the first time each block is accessed. Volume performance is recovered after all blocks have been downloaded and written to the volume. For more details, see Initialize Amazon EBS volumes.

In order to get our volume ready, we can run a task to read all blocks.


$ sudo yum install -y fio
$ sudo fio --filename=/dev/nvme1n1 --rw=read --bs=128k --iodepth=32 --ioengine=libaio --direct=1 --name=volume-initialize

노트

This task to warmup Amazon EBS volume would take a long time depending on the data size. Refer to fio output for the ETA.

Check kend.conf configuration

Before starting the node, check NETWORK and NETWORK_ID fields in the configuration file kend.conf. The kend.conf file is located in /etc/kend/conf/kend.conf.

For Mainnet, the NETWORK field should be mainnet. For Kairos, the NETWORK field should be kairos.


# for Mainnet
NETWORK=mainnet
# for Kairos
NETWORK=kairos

Note that NETWORK_ID is only used for private network. Thus make sure not to set NETWORK_ID for Mainnet or Kairos.

For more details on kend.conf, see Configuration.

Start kend service

In the EC2 instance, Kaia CLI client and the chaindata are installed. Also, kend, the script to start/terminate EN, is installed as a service. You can check the kend service's status by the following command.


$ sudo service kend status

If the service is not running, try to restart it.


$ sudo service kend restart

If the service restarted and the EN has started successfully, you can check its logs in the path /var/kend/logs/kend.out.


$ tail -f /var/kend/logs/kend.out

Kaia provides a CLI client ken console. You can interact with the Kaia node using the ken console via multiple endpoints, and one option is to use IPC (inter-process communication). The IPC file klay.ipc is located in the DATA_DIR path on an EN, in our case /var/kend/data. Thus in order to use ken console:


$ sudo ken attach --datadir /var/kend/data
Welcome to the Kaia JavaScript console!
instance: Kaia/vX.X.X/XXXX-XXXX/goX.X.X
datadir: /var/kend/data
modules: admin:1.0 debug:1.0 governance:1.0 istanbul:1.0 klay:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0
>

Wait for block sync

Since the AMI was created hours ago, we need some time to sync to the latest block. You can check the currently synced block number and the sync progress in the ken console.


> klay.blockNumber
165227166
> klay.syncing
{
currentBlock: 165227166,
highestBlock: 165357203,
knownStates: 0,
pulledStates: 0,
startingBlock: 165222272
}

When the block sync is done, querying sync progress should return false.


> klay.syncing
false

페이지를 개선해 주세요