genesis_chunked
curl --request GET \
--url https://rpc.cosmos.directory/cosmoshub/genesis_chunkedimport requests
url = "https://rpc.cosmos.directory/cosmoshub/genesis_chunked"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://rpc.cosmos.directory/cosmoshub/genesis_chunked', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://rpc.cosmos.directory/cosmoshub/genesis_chunked",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://rpc.cosmos.directory/cosmoshub/genesis_chunked"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://rpc.cosmos.directory/cosmoshub/genesis_chunked")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.cosmos.directory/cosmoshub/genesis_chunked")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 0,
"result": {
"chunk": 0,
"total": 1,
"data": "Z2VuZXNpcwo="
}
}{
"id": 0,
"jsonrpc": "2.0",
"error": "Description of failure"
}Info
genesis_chunked
Get Genesis in multiple chunks
Get genesis document in multiple chunks to make it easier to iterate through larger genesis structures. Each chunk is produced by converting the genesis document to JSON and then splitting the resulting payload into 16MB blocks, and then Base64-encoding each block.
Upon success, the Cache-Control header will be set with the default
maximum age.
GET
/
genesis_chunked
genesis_chunked
curl --request GET \
--url https://rpc.cosmos.directory/cosmoshub/genesis_chunkedimport requests
url = "https://rpc.cosmos.directory/cosmoshub/genesis_chunked"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://rpc.cosmos.directory/cosmoshub/genesis_chunked', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://rpc.cosmos.directory/cosmoshub/genesis_chunked",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://rpc.cosmos.directory/cosmoshub/genesis_chunked"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://rpc.cosmos.directory/cosmoshub/genesis_chunked")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.cosmos.directory/cosmoshub/genesis_chunked")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 0,
"result": {
"chunk": 0,
"total": 1,
"data": "Z2VuZXNpcwo="
}
}{
"id": 0,
"jsonrpc": "2.0",
"error": "Description of failure"
}Was this page helpful?