본문으로 건너뛰기

JOC에 노드 연결

본 문서는 사용자 환경에서 Geth 노드를 구축하여 Japan Open Chain의 Mainnet 및 Testnet에 연결하는 방법을 설명합니다. RPC Endpoints를 이용하여 dApps에 연결하고자 하는 분은 여기를 참조하십시오.

JOC Mainnet에 노드 연결하기​

연결 과정은 다음과 같습니다.

1. 필수 패키지 설치​

# Ubuntu / Debian
sudo apt-get update
sudo apt-get install -y curl openssl

# Amazon Linux 2023 / RHEL-based
sudo dnf install -y curl openssl

2. 데이터 디렉토리 생성​

sudo mkdir -p /data/ethereum
sudo mkdir -p /data/ethereum/consensus/config

3. 설정 파일 다운로드​

아래 파일들을 다운로드하여 지정된 위치에 복사합니다.

FileLink
genesis.json보기
config.yaml보기
genesis.ssz다운로드
deposit_contract.txt보기
deposit_contract_block.txt보기
# genesis.json -> /data/ethereum/genesis.json
# config.yaml -> /data/ethereum/consensus/config/config.yaml
# genesis.ssz -> /data/ethereum/consensus/config/genesis.ssz
# deposit_contract_block.txt -> /data/ethereum/consensus/config/deposit_contract_block.txt

4. 클라이언트 설치​

Geth (실행 클라이언트, v1.13.5에서 동작 확인됨):

https://geth.ethereum.org/docs/getting-started/installing-geth

주의

현재 Geth v1.14.0 이상은 지원되지 않습니다.

Lighthouse (컨센서스 클라이언트, v7.0.1에서 동작 확인됨):

https://lighthouse-book.sigmaprime.io/installation.html

5. JWT Secret 생성​

JWT Secret은 Geth와 Lighthouse 간의 내부 통신을 인증하는 데 사용됩니다. 최초 1회만 생성합니다.

openssl rand -hex 32 | tr -d "\n" > /data/ethereum/jwtsecret
chmod 644 /data/ethereum/jwtsecret

6. Geth 초기화​

geth init \
--datadir=/data/ethereum \
/data/ethereum/genesis.json

이 명령어는 최초 1회만 실행합니다.

7. Geth 실행​

현재 BootNodes 목록은 enodes.yaml에서 가져옵니다.

geth --datadir=/data/ethereum \
--networkid=81 \
--http \
--authrpc.vhosts="*" \
--authrpc.addr=127.0.0.1 \
--authrpc.jwtsecret=/data/ethereum/jwtsecret \
--bootnodes="$BOOTNODES"

8. Lighthouse 실행​

현재 Boot ENR 목록은 bootstrap_nodes.yaml에서 가져옵니다.

lighthouse beacon_node \
--datadir=/data/ethereum/consensus \
--http \
--execution-endpoint=http://127.0.0.1:8551 \
--execution-jwt=/data/ethereum/jwtsecret \
--testnet-dir=/data/ethereum/consensus/config \
--boot-nodes="$BOOT_ENRS"

9. 확인​

Geth 동기화 상태 확인:

curl -s -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'
# false → 동기화 완료
# object → 동기화 진행 중, currentBlock / highestBlock 표시

Lighthouse 동기화 상태 확인:

curl -s http://localhost:5052/eth/v1/node/peer_count

"Looking for peers" 메시지가 지속될 경우 정상적으로 연결되지 않았으므로, bootnode/ENR 값과 방화벽 설정(Geth는 30303 TCP+UDP 포트, Lighthouse는 9000 TCP+UDP 포트)을 확인하시기 바랍니다.

Explorer​