getEpochSchedule RPC Method
參數
此方法不接受任何參數
退貨
結果
載入中...
firstNormalEpoch
載入中...
firstNormalSlot
載入中...
leaderScheduleSlotOffset
載入中...
slotsPerEpoch
載入中...
warmup
載入中...
請求
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":"getEpochSchedule"}'
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":"getEpochSchedule"}'
1需要 "uri"2require "json"3需要 "net/http"45url = URI("https://docs-demo.solana-mainnet.quiknode.pro/")67https = 網::HTTP.new(url.主機, url.port)8https.use_ssl = true910請求 = 淨::HTTP::POST.new(網址)11請求["Content-Type"] = "application/json"12請求。正文 = JSON.dump({13"jsonrpc": "2.0",14"id": 1,15"method": "getEpochSchedule"16})1718回應 = https.請求(請求)19將回應。read_body20
1需要 "uri"2require "json"3需要 "net/http"45url = URI("https://docs-demo.solana-mainnet.quiknode.pro/")67https = 網::HTTP.new(url.主機, url.port)8https.use_ssl = true910請求 = 淨::HTTP::POST.new(網址)11請求["Content-Type"] = "application/json"12請求。正文 = JSON.dump({13"jsonrpc": "2.0",14"id": 1,15"method": "getEpochSchedule"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 epochSchedule = await solanaRpc.getEpochSchedule().send();8console.log(epochSchedule);9} catch (錯誤) {10console.error("Error fetching epoch schedule:", error);11}12})();
1import { createSolanaRpc } from "@solana/kit";23(async () => {4const solanaRpc = createSolanaRpc("https://docs-demo.solana-mainnet.quiknode.pro/");56試試看 {7const epochSchedule = await solanaRpc.getEpochSchedule().send();8console.log(epochSchedule);9} catch (錯誤) {10console.error("Error fetching epoch schedule:", error);11}12})();
1const web3 = require("@solana/web3.js");2(async () => {3const solana = new web3.Connection("https://docs-demo.solana-mainnet.quiknode.pro/");4console.log(await solana.getEpochschedule());5})();6
1const web3 = require("@solana/web3.js");2(async () => {3const solana = new web3.Connection("https://docs-demo.solana-mainnet.quiknode.pro/");4console.log(await solana.getEpochschedule());5})();6
1from solana.rpc.api import Client2solana_client = Client("https://docs-demo.solana-mainnet.quiknode.pro/")3print(solana_client.get_epoch_schedule())
1from solana.rpc.api import Client2solana_client = Client("https://docs-demo.solana-mainnet.quiknode.pro/")3print(solana_client.get_epoch_schedule())
1use reqwest::header;2use reqwest::Client;3use std::error::Error;45#[tokio::main]6async fn main() -> Result<(), Box<dyn Error>> {7let mut headers = header::HeaderMap::new();8headers.insert("Content-Type", "application/json".parse().unwrap());910let client = Client::new();11let json_data = r#"12{13"jsonrpc": "2.0",14"id": 1,15"method": "getEpochSchedule"16}17"#;18let response = client19.post("https://docs-demo.solana-mainnet.quiknode.pro/")20.headers(headers)21.body(json_data)22.send()23.await?;2425let body = response.text().await?;26println!("{}", body);2728好(())29}
1use reqwest::header;2use reqwest::Client;3use std::error::Error;45#[tokio::main]6async fn main() -> Result<(), Box<dyn Error>> {7let mut headers = header::HeaderMap::new();8headers.insert("Content-Type", "application/json".parse().unwrap());910let client = Client::new();11let json_data = r#"12{13"jsonrpc": "2.0",14"id": 1,15"method": "getEpochSchedule"16}17"#;18let response = client19.post("https://docs-demo.solana-mainnet.quiknode.pro/")20.headers(headers)21.body(json_data)22.send()23.await?;2425let body = response.text().await?;26println!("{}", body);2728好(())29}
回應
1{2"jsonrpc": "2.0",3"result": {4"firstNormalEpoch": 0,5"firstNormalSlot": 0,6"leaderScheduleSlotOffset": 432000,7"slotsPerEpoch": 432000,8"warmup": false9},10"id": 111}
1{2"jsonrpc": "2.0",3"result": {4"firstNormalEpoch": 0,5"firstNormalSlot": 0,6"leaderScheduleSlotOffset": 432000,7"slotsPerEpoch": 432000,8"warmup": false9},10"id": 111}