getNodeHealth Query
Paramètres
Cette méthode n'accepte aucun paramètre
Renvoie
données
objet
Chargement...
santé
booléen
Chargement...
Requête
1curl --location 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql' \2--en-tête 'Accept: application/json' \3--header 'Content-Type: application/json' \4--data '{5"query": "{ health }"6}'
1curl --location 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql' \2--en-tête 'Accept: application/json' \3--header 'Content-Type: application/json' \4--data '{5"query": "{ health }"6}'
1const HEALTH_QUERY = `2query {3santé4}5`;67const fetchNodeHealth = async (): Promise<void> => {8essayer {9const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {10méthode: « POST »,11headers: {12« Accepter »: 'application/json',13« Content-Type »: 'application/json',14},15body: JSON.stringify({16query: HEALTH_QUERY,17}),18});1920si (!réponse.ok) {21throw new Error(`HTTP error! status: ${response.status}`);22}2324const résultat = await response.json();25console.log('Node Health:', result.data.health);26} catch (erreur) {27console.error('Error fetching node health:', error);28}29};3031fetchNodeHealth();32
1const HEALTH_QUERY = `2query {3santé4}5`;67const fetchNodeHealth = async (): Promise<void> => {8essayer {9const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {10méthode: « POST »,11headers: {12« Accepter »: 'application/json',13« Content-Type »: 'application/json',14},15body: JSON.stringify({16query: HEALTH_QUERY,17}),18});1920si (!réponse.ok) {21throw new Error(`HTTP error! status: ${response.status}`);22}2324const résultat = await response.json();25console.log('Node Health:', result.data.health);26} catch (erreur) {27console.error('Error fetching node health:', error);28}29};3031fetchNodeHealth();32
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3mesEnTêtes.ajouter("Content-Type", "application/json");45const brut = JSON.stringify({6"query": "{ health }"7});89const requestOptions = {10méthode: « POST »,11headers: myHeaders,12body: raw,13redirect: "follow"14};1516récupérer(« https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql », requestOptions)17.then((response) => response.text())18.then((result) => console.log(result))19.catch((error) => console.error(error));
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3mesEnTêtes.ajouter("Content-Type", "application/json");45const brut = JSON.stringify({6"query": "{ health }"7});89const requestOptions = {10méthode: « POST »,11headers: myHeaders,12body: raw,13redirect: "follow"14};1516récupérer(« https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql », requestOptions)17.then((response) => response.text())18.then((result) => console.log(result))19.catch((error) => console.error(error));
1const { ApolloClient, InMemoryCache, gql } = require('@apollo/client/core');2const fetch = require('cross-fetch');34const client = new ApolloClient({5uri: « https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql »,6cache: new InMemoryCache(),7récupérer: récupérer,8headers: {9« Accepter »: 'application/json',10« Content-Type »: 'application/json'11}12});1314const HEALTH_QUERY = gql`15{16santé17}18`;1920client.requête({21query: HEALTH_QUERY22})23.puis(résultat => {24console.log('Node Health Status:', result.data.health);25})26.catch(erreur => console.erreur('Erreur :', erreur));
1const { ApolloClient, InMemoryCache, gql } = require('@apollo/client/core');2const fetch = require('cross-fetch');34const client = new ApolloClient({5uri: « https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql »,6cache: new InMemoryCache(),7récupérer: récupérer,8headers: {9« Accepter »: 'application/json',10« Content-Type »: 'application/json'11}12});1314const HEALTH_QUERY = gql`15{16santé17}18`;1920client.requête({21query: HEALTH_QUERY22})23.puis(résultat => {24console.log('Node Health Status:', result.data.health);25})26.catch(erreur => console.erreur('Erreur :', erreur));
1import requests2import json34url = « https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql »56payload = json.dumps({7"query": "{ health }"8})9headers = {10'Accept': 'application/json',11'Content-Type': 'application/json'12}1314response = requests.request("POST", url, headers=headers, data=payload)1516print(response.text)17
1import requests2import json34url = « https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql »56payload = json.dumps({7"query": "{ health }"8})9headers = {10'Accept': 'application/json',11'Content-Type': 'application/json'12}1314response = requests.request("POST", url, headers=headers, data=payload)1516print(response.text)17
1require "uri"2require "json"3require "net/http"45url = URI(« https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql »)67https = Net::HTTP.new(url.host, url.port)8https.use_ssl = true910request = Net::HTTP::Post.new(url)11request["Accept"] = "application/json"12request["Content-Type"] = "application/json"13request.body = JSON.dump({14"query": "{ health }"15})1617response = https.request(request)18puts response.read_body19
1require "uri"2require "json"3require "net/http"45url = URI(« https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql »)67https = Net::HTTP.new(url.host, url.port)8https.use_ssl = true910request = Net::HTTP::Post.new(url)11request["Accept"] = "application/json"12request["Content-Type"] = "application/json"13request.body = JSON.dump({14"query": "{ health }"15})1617response = https.request(request)18puts response.read_body19
Vous n'avez pas encore de compte ?
Créez votre endpoint Quicknode en quelques secondes et commencez à développer
Commencez gratuitement