Menghubungkan Node ke JOC
Dokumen ini menjelaskan langkah-langkah untuk membangun node Geth di lingkungan pengguna dan menghubungkannya ke Mainnet serta Testnet dari Japan Open Chain. Jika Anda ingin menggunakan RPC Endpoints untuk menghubungkan dApps, silakan merujuk ke sini.
- Mainnet
- Testnet
Menghubungkan Node ke JOC Mainnet
Alur untuk menghubungkan adalah sebagai berikut:
- 1. Instalasi Paket yang Diperlukan
- 2. Membuat Direktori Data
- 3. Mengunduh File Konfigurasi
- 4. Instalasi Client
- 5. Membuat JWT Secret
- 6. Inisialisasi Geth
- 7. Menjalankan Geth
- 8. Menjalankan Lighthouse
- 9. Verifikasi
1. Instalasi Paket yang Diperlukan
# 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. Membuat Direktori Data
sudo mkdir -p /data/ethereum
sudo mkdir -p /data/ethereum/consensus/config
3. Mengunduh File Konfigurasi
Unduh file di bawah ini dan salin ke lokasi yang benar:
| File | Link |
|---|---|
genesis.json | Lihat |
config.yaml | Lihat |
genesis.ssz | Unduh |
deposit_contract.txt | Lihat |
deposit_contract_block.txt | Lihat |
# 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. Instalasi Client
Geth (Execution Client, teruji dengan v1.13.5):
https://geth.ethereum.org/docs/getting-started/installing-geth
Saat ini, Geth v1.14.0 atau yang lebih baru belum didukung.
Lighthouse (Consensus Client, teruji dengan v7.0.1):
https://lighthouse-book.sigmaprime.io/installation.html
5. Membuat JWT Secret
JWT secret digunakan untuk mengautentikasi komunikasi internal antara Geth dan Lighthouse. Buat satu kali saja:
openssl rand -hex 32 | tr -d "\n" > /data/ethereum/jwtsecret
chmod 644 /data/ethereum/jwtsecret
6. Inisialisasi Geth
geth init \
--datadir=/data/ethereum \
/data/ethereum/genesis.json
Jalankan perintah ini hanya sekali.
7. Menjalankan Geth
Daftar BootNodes saat ini diambil dari 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. Menjalankan Lighthouse
Daftar Boot ENR saat ini diambil dari 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. Verifikasi
Periksa status sinkronisasi Geth:
curl -s -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'
# false → sudah tersinkronisasi sepenuhnya
# object → sedang sinkronisasi, menampilkan currentBlock / highestBlock
Periksa status sinkronisasi Lighthouse:
curl -s http://localhost:5052/eth/v1/node/peer_count
Jika pesan "Looking for peers" terus muncul, itu berarti koneksi belum berhasil. Periksa kembali nilai bootnode/ENR serta pengaturan firewall Anda (port 30303 TCP+UDP untuk Geth, port 9000 TCP+UDP untuk Lighthouse).
Explorer
Menghubungkan Node ke JOC Testnet
Alur untuk menghubungkan adalah sebagai berikut:
- 1. Instalasi Paket yang Diperlukan
- 2. Membuat Direktori Data
- 3. Mengunduh File Konfigurasi
- 4. Instalasi Client
- 5. Membuat JWT Secret
- 6. Inisialisasi Geth
- 7. Menjalankan Geth
- 8. Menjalankan Lighthouse
- 9. Verifikasi
1. Instalasi Paket yang Diperlukan
# 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. Membuat Direktori Data
sudo mkdir -p /data/ethereum
sudo mkdir -p /data/ethereum/consensus/config
3. Mengunduh File Konfigurasi
Unduh file di bawah ini dan salin ke lokasi yang benar:
| File | Link |
|---|---|
genesis.json | Lihat |
config.yaml | Lihat |
genesis.ssz | Unduh |
deposit_contract.txt | Lihat |
deposit_contract_block.txt | Lihat |
# 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. Instalasi Client
Geth (Execution Client, teruji dengan v1.13.5):
https://geth.ethereum.org/docs/getting-started/installing-geth
Lighthouse (Consensus Client, teruji dengan v7.0.1):
https://lighthouse-book.sigmaprime.io/installation.html
5. Membuat JWT Secret
JWT secret digunakan untuk mengautentikasi komunikasi internal antara Geth dan Lighthouse. Buat satu kali saja:
openssl rand -hex 32 | tr -d "\n" > /data/ethereum/jwtsecret
chmod 644 /data/ethereum/jwtsecret
6. Inisialisasi Geth
geth init \
--datadir=/data/ethereum \
/data/ethereum/genesis.json
Jalankan perintah ini hanya sekali.
7. Menjalankan Geth
Daftar BootNodes saat ini diambil dari enodes.yaml.
geth --datadir=/data/ethereum \
--networkid=361257328 \
--http \
--authrpc.vhosts="*" \
--authrpc.addr=127.0.0.1 \
--authrpc.jwtsecret=/data/ethereum/jwtsecret \
--bootnodes="$BOOTNODES"
8. Menjalankan Lighthouse
Daftar Boot ENR saat ini diambil dari 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. Verifikasi
Periksa status sinkronisasi Geth:
curl -s -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'
# false → sudah tersinkronisasi sepenuhnya
# object → sedang sinkronisasi, menampilkan currentBlock / highestBlock
Periksa status sinkronisasi Lighthouse:
curl -s http://localhost:5052/eth/v1/node/peer_count
Jika pesan "Looking for peers" terus muncul, itu berarti koneksi belum berhasil. Periksa kembali nilai bootnode/ENR serta pengaturan firewall Anda (port 30303 TCP+UDP untuk Geth, port 9000 TCP+UDP untuk Lighthouse).