getGenesisHash RPC Method
매개변수
이 메서드는 매개변수를 받지 않습니다.
반품
결과
로딩 중...
요청
1curl https://docs-demo.solana-mainnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"jsonrpc":"2.0","id":1, "method":"getGenesisHash"}'
1curl https://docs-demo.solana-mainnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"jsonrpc":"2.0","id":1, "method":"getGenesisHash"}'
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.solana-mainnet.quiknode.pro/")67https = Net::HTTP.new(url.호스트, url.포트)8https.use_ssl = true910요청 = 순::HTTP::POST.새(URL)11요청["Content-Type"] = "application/json"12요청.본문 = JSON.dump({13"jsonrpc": "2.0",14"id": 1,15"method": "getGenesisHash"16})1718답변 = https.요청(요청)19응답을 넣습니다.read_body20
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.solana-mainnet.quiknode.pro/")67https = Net::HTTP.new(url.호스트, url.포트)8https.use_ssl = true910요청 = 순::HTTP::POST.새(URL)11요청["Content-Type"] = "application/json"12요청.본문 = JSON.dump({13"jsonrpc": "2.0",14"id": 1,15"method": "getGenesisHash"16})1718답변 = https.요청(요청)19응답을 넣습니다.read_body20
1import { createSolanaRpc } from "@solana/kit";23(async () => {4const solanaRpc = createSolanaRpc("https://docs-demo.solana-mainnet.quiknode.pro/");56시도해 보세요 {7const genesisHash = await solanaRpc.getGenesisHash().send();8console.log(genesisHash);9} catch (error) {10console.error("Error fetching genesis hash:", error);11}12})();
1import { createSolanaRpc } from "@solana/kit";23(async () => {4const solanaRpc = createSolanaRpc("https://docs-demo.solana-mainnet.quiknode.pro/");56시도해 보세요 {7const genesisHash = await solanaRpc.getGenesisHash().send();8console.log(genesisHash);9} catch (error) {10console.error("Error fetching genesis hash:", error);11}12})();
1// not currently supported by solanaJS2const axios = require("axios");3(() => {4const config = {5headers: {6"Content-Type": "application/json",7},8};9const data = {10jsonrpc: "2.0",11id: 1,12method: "getGenesisHash",13};14axios15.post("https://docs-demo.solana-mainnet.quiknode.pro/", data, config)16.then(function (response) {17// handle success18console.log(response.data);19})20.catch((err) => {21// handle error22console.log(err);23});24})();25
1// not currently supported by solanaJS2const axios = require("axios");3(() => {4const config = {5headers: {6"Content-Type": "application/json",7},8};9const data = {10jsonrpc: "2.0",11id: 1,12method: "getGenesisHash",13};14axios15.post("https://docs-demo.solana-mainnet.quiknode.pro/", data, config)16.then(function (response) {17// handle success18console.log(response.data);19})20.catch((err) => {21// handle error22console.log(err);23});24})();25
1출처: 솔라나.rpc.api import Client2solana_client = 클라이언트("https://docs-demo.solana-mainnet.quiknode.pro/")3print(solana_client.get_genesis_hash() )
1출처: 솔라나.rpc.api import Client2solana_client = 클라이언트("https://docs-demo.solana-mainnet.quiknode.pro/")3print(solana_client.get_genesis_hash() )
1사용 reqwest::헤더;2사용 reqwest::클라이언트;3사용 std::error::오류;45#[tokio::main]6async fn main() -> Result<(), Box<dyn Error>> {7let mut 헤더 = header::헤더맵::새();8헤더.삽입("Content-Type", "application/json".parse().unwrap());910let 클라이언트 client = Client::new();11let json_data = r#"12{13"jsonrpc": "2.0",14"id": 1,15"method": "getGenesisHash"16}17"#;18let 응답 = client19.게시물("https://docs-demo.solana-mainnet.quiknode.pro/")20.헤더(헤더))21.본문(json_data)22.보내기()23.await?;2425let 본문 = response.text().await?;26println!("{}", body);2728알겠습니다(())29}
1사용 reqwest::헤더;2사용 reqwest::클라이언트;3사용 std::error::오류;45#[tokio::main]6async fn main() -> Result<(), Box<dyn Error>> {7let mut 헤더 = header::헤더맵::새();8헤더.삽입("Content-Type", "application/json".parse().unwrap());910let 클라이언트 client = Client::new();11let json_data = r#"12{13"jsonrpc": "2.0",14"id": 1,15"method": "getGenesisHash"16}17"#;18let 응답 = client19.게시물("https://docs-demo.solana-mainnet.quiknode.pro/")20.헤더(헤더))21.본문(json_data)22.보내기()23.await?;2425let 본문 = response.text().await?;26println!("{}", body);2728알겠습니다(())29}
답변
1{2"jsonrpc": "2.0",3"result": "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d",4"id": 15}
1{2"jsonrpc": "2.0",3"result": "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d",4"id": 15}