# 풀노드 실행하기

## 풀노드 실행 방법

Sui 풀노드를 실행하는데 아래의 두가지 방법이 있습니다.

* Docker 를 통해서 실행 (권장)
* 소스를 빌드하여 실행

본 문서에서는 쉽게 따라할 수 있는 Docker 를 통해서 실행하는 방법을 권장드리며 이를 위주로 설명드리겠습니다.

## 풀노드 실행을 위한 소프트웨어 설치

Docker 를 통해서 Sui 풀노드를 실행하기 위해서 우리는 아래의 소프트웨어를 설치합니다.

* Docker
* Docker Compose

docker 및 docker-compose 설치에 필요한 유틸리티를 다운받기 위해 아래의 명령어를 실행합니다.

```
sudo apt install apt-transport-https ca-certificates curl software-properties-common
```

## Docker 설치

docker 리포지토리에 접근하기 위한 키 생성 설정

```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```

패키지 매니저가 docker 설치 시, 설치 위치를 알기 위한 repository 추가

```
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
```

위에서 추가한 repository를 위해서 업데이트

```
sudo apt update
```

docker 설치

```
sudo apt install docker-ce
```

docker 설치가 잘 되었는지 확인합니다&#x20;

```
sudo systemctl status docker
```

아래와 같이 출력되면 잘 설치 되었다고 판단합니다

![](/files/fIniiJNIEKhchDh6hoJM)

## Docker Compose 설치

최신 버전을 [공식 Repository](https://github.com/docker/compose/releases) 에서 확인합니다.

문서 작성 기준 [v2.6.1](https://github.com/docker/compose/releases/tag/v2.6.1)이 최신이므로 아래의 명령어를 통해 설치합니다

```
sudo curl -L "https://github.com/docker/compose/releases/download/v2.6.1/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose
```

(선택) 버전이 다른 경우 아래의 명령어와 같이 <최신 버전명> 부분에 버전명을 기입해서 실행해주세요.&#x20;

아니라면, 아래의 명령어는 무시해주세요

```
sudo curl -L "https://github.com/docker/compose/releases/download/<최신 버전명>/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose
```

docker-compose 를 실행이 가능하게 설정합니다

```
sudo chmod +x /usr/local/bin/docker-compose
```

docker-compose가 잘 설치되었는지 아래 명령어를 통해 확인합니다

```
docker-compose -v
```

아래와 같이 출력되면 정상적으로 설치되었다고 판단합니다

```
$ docker-compose -v
Docker Compose version v2.6.1
```

## Docker 권한 부여하기

아래 명령어를 통해 권한 부여

```
sudo groupadd docker \
&& sudo usermod -aG docker $USER \
&& newgrp docker
```

## Sui 풀노드 실행하기&#x20;

가장 최근 업데이트된 내용은 [공식 홈페이지](https://docs.sui.io/build/fullnode#using-docker-compose)를 기반으로 합니다. 따라서, 업데이트 내용과 차이가 있을 수 있습니다.

Sui 풀노드 실행하기 위해서는 아래의 명령어를 통해 Sui 노드 관련 설정들을 다운로드 합니다.

```
mkdir -p ~/devnet \
&& wget https://raw.githubusercontent.com/MystenLabs/sui/devnet/docker/fullnode/docker-compose.yaml -P ~/devnet \
&& wget https://github.com/MystenLabs/sui/raw/main/crates/sui-config/data/fullnode-template.yaml -P ~/devnet \
&& wget https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob -P ~/devnet 
```

위 명령어 실행 후, devnet 디렉토리에는 아래의 3가지 파일이 있어야 합니다.

* docker-compose.yaml
* fullnode-template.yaml
* genesis.blob

### 풀노드 API 접근 허용

아래 명령어를 통해 API 접근을 허용합니다.

```
cd ~/devnet
sed -i 's/127.0.0.1/0.0.0.0/' fullnode-template.yaml
```

### 풀노드 실행하기

아래의 명령어를 통해 Sui 풀노드를 실행해주세요.

```
docker-compose up -d
```

### 풀노드 작동 확인

아래의 명령어를 통해 Sui 풀노드가 잘 실행 되는지 확인합니다.

```
docker ps
```

#### 결과

```
CONTAINER ID   IMAGE                    COMMAND                  CREATED         STATUS         PORTS                                                                                  NAMES
d26352d61303   mysten/sui-node:stable   "/usr/local/bin/sui-…"   3 minutes ago   Up 3 minutes   0.0.0.0:9000->9000/tcp, :::9000->9000/tcp, 0.0.0.0:9184->9184/tcp, :::9184->9184/tcp   devnet-fullnode-1
```

최근 5개의 트랜잭션을 가져와서 확인합니다.

```
curl --location --request POST 'http://127.0.0.1:9000/' \
    --header 'Content-Type: application/json' \
    --data-raw '{ "jsonrpc":"2.0", "id":1, "method":"sui_getRecentTransactions", "params":[5] }' | jq 
```

#### 결과

```
$ curl --location --request POST 'http://127.0.0.1:9000/' \
    --header 'Content-Type: application/json' \
    --data-raw '{ "jsonrpc":"2.0", "id":1, "method":"sui_getRecentTransactions", "params":[5] }' | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   389  100   310  100    79  53337  13592 --:--:-- --:--:-- --:--:-- 77800
{
  "jsonrpc": "2.0",
  "result": [
    [
      17404,
      "ASFePe8TI+aGbosg94Gc2Dw6nYSPQaAPWFwuxuz6n5s="
    ],
    [
      17405,
      "wr+VaXY6xuZcBDC1N8/pz0DP50aY4kynzIND2guZs/A="
    ],
    [
      17406,
      "cDY5V2h4cgwxD4DX01dDs+fsB5ql2vEBcagslYEtJpM="
    ],
    [
      17407,
      "jNNwzR48O5Ou06WcuN32WDgHUP2xGSVw9I8OTlzRBqY="
    ],
    [
      17408,
      "JLia63qW7vtlEYMBSdNZ1mjFjDHBQdV72EbDtZSYPF4="
    ]
  ],
  "id": 1
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://korea-crypto-degen-club.gitbook.io/sui/undefined/running-fullnode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
