The quickest way to start building on Celestia with Quicknode is by sending a REST API request to your endpoint. In this quickstart, you’ll create an endpoint, copy its provider URL, and make your first request. Code samples are available in cURL as well as other popular programming languages.
Get Your Celestia Endpoint
Quicknode 만들기
아직 가입하지 않으셨다면 여기에서 가입해 주세요.
대시보드로 이동하세요
왼쪽 사이드바 메뉴에서 ‘엔드포인트’ 대시보드를 열어 모든 블록체인 엔드포인트를 관리하세요
새 endpoint 생성
Click Create an Endpoint in the top-right corner, select Celestia as your blockchain, then select your preferred network
서비스 제공업체 URL을 복사하세요
HTTP URL을 잘 챙겨 두세요. 아래에서 요청을 보낼 때 이 URL을 사용하게 될 것입니다.
Quicknode 대한 자세한 사용 방법은 당사의 가이드를 확인해 주세요
첫 요청 보내기
Your endpoint is ready. Now, let's make your first call to the Celestia blockchain. We’ll use the 상태 method, which retrieves Tendermint status including node info, pubkey, latest block hash, app hash, 블록 높이 그리고 시간. 원하는 언어를 선택하고 아래 단계를 따라 첫 번째 요청을 보내세요..
- cURL
- Node.js
파이썬
- TypeScript
- 루비
cURL 설치 상태 확인
대부분의 *nix 기반 시스템은 기본적으로 cURL을 지원합니다. 터미널을 열고 아래 명령어를 실행하여 cURL 버전을 확인하세요:
curl --version
Get Status
To retrieve the node status, run the following cURL command:
curl --location 'YOUR_QUICKNODE_ENDPOINT_URL/status' \
--header 'accept: application/json'
프로젝트 설정하기
디렉터리를 생성하고 Node.js 프로젝트를 초기화합니다:
mkdir celestia-js-quickstart
cd celestia-js-quickstart
npm init -y
app.js 파일 생성
Create a file named app.js to call the status endpoint:
const https = require('https');
const options = {
hostname: '{your-endpoint-name}.quiknode.pro',
path: '/{your-token}/status',
method: 'GET',
headers: {
'accept': 'application/json'
}
};
const req = https.request(options, (res) => {
let result = '';
res.on('data', (chunk) => {
result += chunk;
});
res.on('end', () => {
console.log('Status:', result);
});
});
req.on('error', (error) => {
console.error('Error:', error);
});
req.end();
실행
스크립트를 실행하세요:
node app.js
프로젝트 설정하기
Python 프로젝트를 위한 새 디렉터리를 생성하세요:
mkdir celestia-python-quickstart
cd celestia-python-quickstart
가상 환경 생성 및 활성화
의존성을 관리하기 위한 가상 환경을 생성합니다:
python3 -m venv venv
source venv/bin/activate
설치 요청
HTTP 요청을 보내기 위해 requests 라이브러리를 설치하세요:
pip 설치 requests
파이썬 스크립트(app.py)를 만듭니다.
Create a Python file to call the status endpoint:
import requests
url = "YOUR_QUICKNODE_ENDPOINT_URL/status"
headers = {
'accept': 'application/json'
}
response = requests.request("GET", url, headers=headers)
print('Status:')
print(response.text)
실행
스크립트를 실행하세요:
python app.py
프로젝트 설정하기
Create a directory and initialize a TypeScript project:
mkdir celestia-ts-quickstart
cd celestia-ts-quickstart
npm init -y
npm install typescript @types/node tsx
npx tsc --init
Create app.ts
Create a file named app.ts to call the status endpoint:
import https from 'https';
const options: https.RequestOptions = {
hostname: '{your-endpoint-name}.quiknode.pro',
path: '/{your-token}/status',
method: 'GET',
headers: {
'accept': 'application/json'
}
};
const req = https.request(options, (res) => {
let result = '';
res.on('data', (chunk: Buffer) => {
result += chunk.toString();
});
res.on('end', () => {
console.log('Status:', result);
});
});
req.on('error', (error: Error) => {
console.error('Error:', error);
});
req.end();
실행
스크립트를 실행하세요:
npx tsx app.ts
프로젝트 설정하기
Ruby 프로젝트를 위한 새 디렉터리를 생성하세요:
mkdir celestia-ruby-quickstart
cd celestia-ruby-quickstart
Ruby 설치 상태 확인
시스템에 Ruby가 설치되어 있는지 확인하십시오. 설치되어 있지 않다면, https://ruby-lang.org에서 설치하십시오:
ruby --version
Create a Ruby script (app.rb)
Create an app.rb file to call the status endpoint:
require "uri"
require "net/http"
url = URI("YOUR_QUICKNODE_ENDPOINT_URL/status")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
response = https.request(request)
puts "Status:"
puts response.read_body
스크립트를 실행하세요
Execute your Ruby script:
ruby app.rb
API 요청 방법에 대해 더 자세히 알아보고 싶으시다면, 당사의 가이드와 샘플 앱을 확인해 보세요.