getNodeHealth Query
Parâmetros
Este método não aceita quaisquer parâmetros
Devoluções
dados
objeto
A carregar...
saúde
booleano
A carregar...
Pedido
1curl --location 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql' \2--header 'Accept: application/json' \3--cabeçalho 'Content-Type: application/json' \4--dados '{5"query": "{ health }"6}'
1curl --location 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql' \2--header 'Accept: application/json' \3--cabeçalho 'Content-Type: application/json' \4--dados '{5"query": "{ health }"6}'
1const HEALTH_QUERY = `2query {3saúde4}5`;67const fetchNodeHealth = async (): Promise<void> => {8try {9const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {10method: 'POST',11headers: {12'Accept': 'application/json',13'Content-Type': 'application/json',14},15body: JSON.stringify({16query: HEALTH_QUERY,17}),18});1920if (!response.ok) {21throw new Error(`HTTP error! status: ${response.status}`);22}2324const result = await response.json();25console.log('Node Health:', result.data.health);26} catch (error) {27console.error('Error fetching node health:', error);28}29};3031fetchNodeHealth();32
1const HEALTH_QUERY = `2query {3saúde4}5`;67const fetchNodeHealth = async (): Promise<void> => {8try {9const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {10method: 'POST',11headers: {12'Accept': 'application/json',13'Content-Type': 'application/json',14},15body: JSON.stringify({16query: HEALTH_QUERY,17}),18});1920if (!response.ok) {21throw new Error(`HTTP error! status: ${response.status}`);22}2324const result = await response.json();25console.log('Node Health:', result.data.health);26} catch (error) {27console.error('Error fetching node health:', error);28}29};3031fetchNodeHealth();32
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3myHeaders.acrescentar("Content-Type", "application/json");45const raw = JSON.stringify({6"query": "{ health }"7});89const requestOptions = {10método: "POST",11cabeçalhos: myHeaders,12corpo: raw,13redirecionar: "seguir"14};1516fetch("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql", requestOptions)17.então((resposta) => resposta.texto())18.então((resultado) => console.log(resultado))19.catch((erro) => console.erro(erro));
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3myHeaders.acrescentar("Content-Type", "application/json");45const raw = JSON.stringify({6"query": "{ health }"7});89const requestOptions = {10método: "POST",11cabeçalhos: myHeaders,12corpo: raw,13redirecionar: "seguir"14};1516fetch("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql", requestOptions)17.então((resposta) => resposta.texto())18.então((resultado) => console.log(resultado))19.catch((erro) => console.erro(erro));
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(),7fetch: fetch,8headers: {9'Accept': 'application/json',10'Content-Type': 'application/json'11}12});1314const HEALTH_QUERY = gql`15{16saúde17}18`;1920client.query({21query: HEALTH_QUERY22})23.then(result => {24console.log('Node Health Status:', result.data.health);25})26.catch(error => console.error('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(),7fetch: fetch,8headers: {9'Accept': 'application/json',10'Content-Type': 'application/json'11}12});1314const HEALTH_QUERY = gql`15{16saúde17}18`;1920client.query({21query: HEALTH_QUERY22})23.then(result => {24console.log('Node Health Status:', result.data.health);25})26.catch(error => console.error('Error:', error));
1importar pedidos2import json34url = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56carga útil = json.dumps({7"query": "{ health }"8})9cabeçalhos = {10'Accept': 'application/json',11'Content-Type': 'application/json'12}1314resposta = pedidos.pedido("POST", url, headers=headers, dados=carga útil)1516imprimir(resposta.texto)17
1importar pedidos2import json34url = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56carga útil = json.dumps({7"query": "{ health }"8})9cabeçalhos = {10'Accept': 'application/json',11'Content-Type': 'application/json'12}1314resposta = pedidos.pedido("POST", url, headers=headers, dados=carga útil)1516imprimir(resposta.texto)17
1exigir "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = Net::HTTP.novo(url.host, url.porta)8https.use_ssl = true910pedido = Líquido::HTTP::POST.novo(url)11request["Accept"] = "application/json"12pedido["Content-Type"] = "application/json"13pedido.corpo = JSON.dump({14"query": "{ health }"15})1617resposta = https.pedido(pedido)18insere a resposta.read_body19
1exigir "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = Net::HTTP.novo(url.host, url.porta)8https.use_ssl = true910pedido = Líquido::HTTP::POST.novo(url)11request["Accept"] = "application/json"12pedido["Content-Type"] = "application/json"13pedido.corpo = JSON.dump({14"query": "{ health }"15})1617resposta = https.pedido(pedido)18insere a resposta.read_body19
Ainda não tem uma conta?
Crie o seu ponto de extremidade Quicknode em segundos e comece a desenvolver
Comece gratuitamente