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
Ein Quicknode-Konto erstellen
Melde dich hier an, falls du das noch nicht getan hast.
Gehen Sie zu Ihrem Dashboard
Öffnen Sie das Endpunkte-Dashboard über das Menü in der linken Seitenleiste, um alle Ihre Blockchain-Endpunkte zu verwalten
Neuen Endpunkt erstellen
Click Create an Endpoint in the top-right corner, select Celestia as your blockchain, then select your preferred network
Kopieren Sie die URLs Ihres Anbieters
Halten Sie die HTTP-URL griffbereit. Sie werden sie in den folgenden Anfragen verwenden.
Eine ausführliche Anleitung zur Nutzung des Quicknode-Dashboards finden Sie in unserem Leitfaden
Senden Sie Ihre erste Anfrage
Your endpoint is ready. Now, let's make your first call to the Celestia blockchain. We’ll use the Status method, which retrieves Tendermint status including node info, pubkey, latest block hash, app hash, block height und Zeit. Wählen Sie Ihre bevorzugte Sprache aus und befolgen Sie die nachstehenden Schritte, um Ihre erste Anfrage zu senden.
- cURL
- Node.js
Python
- TypeScript
- Ruby
cURL-Installation überprüfen
Die meisten *nix-basierten Systeme unterstützen cURL standardmäßig. Öffnen Sie Ihr Terminal und überprüfen Sie die cURL-Version, indem Sie den folgenden Befehl ausführen:
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'
Richten Sie Ihr Projekt ein
Create a directory and initialize a Node.js project:
mkdir celestia-js-quickstart
cd celestia-js-quickstart
npm init -y
Create 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();
Run
Execute your script:
Knoten app.js
Richten Sie Ihr Projekt ein
Erstellen Sie ein neues Verzeichnis für Ihr Python-Projekt:
mkdir celestia-python-quickstart
cd celestia-python-quickstart
Eine virtuelle Umgebung erstellen und aktivieren
Erstellen Sie eine virtuelle Umgebung zur Verwaltung von Abhängigkeiten:
python3 -m venv venv
source venv/bin/activate
Installationsanfragen
Installieren Sie die Bibliothek „requests“ zum Absenden von HTTP-Anfragen:
pip install Requests
Erstellen Sie ein Python-Skript (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)
Run
Execute your script:
python app.py
Richten Sie Ihr Projekt ein
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();
Run
Execute your script:
npx tsx app.ts
Richten Sie Ihr Projekt ein
Erstellen Sie ein neues Verzeichnis für Ihr Ruby-Projekt:
mkdir celestia-ruby-quickstart
cd celestia-ruby-quickstart
Ruby-Installation überprüfen
Überprüfen Sie, ob Ruby auf Ihrem System installiert ist. Falls nicht, installieren Sie es unter 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
Führen Sie das Skript aus
Execute your Ruby script:
ruby app.rb
Wenn Sie mehr über das Absenden von API-Anfragen erfahren möchten, sehen Sie sich unsere Anleitungen und Beispiel-Apps an.
Wir ❤️ Feedback!
Wenn Sie Anregungen oder Fragen zu dieser Dokumentation haben, teilen Sie uns diese bitte mit. Wir freuen uns auf Ihre Rückmeldung!