dial_peers
curl --request GET \
--url https://rpc.cosmos.directory/cosmoshub/dial_peersimport requests
url = "https://rpc.cosmos.directory/cosmoshub/dial_peers"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://rpc.cosmos.directory/cosmoshub/dial_peers', 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/dial_peers",
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/dial_peers"
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/dial_peers")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.cosmos.directory/cosmoshub/dial_peers")
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{
"Log": "Dialing seeds in progress. See /net_info for details"
}{
"id": 0,
"jsonrpc": "2.0",
"error": "Description of failure"
}Unsafe
dial_peers
Add Peers/Persistent Peers (unsafe)
Set a persistent peer, this route in under unsafe, and has to manually enabled to use.
Example: curl ‘localhost:26657/dial_peers?peers=[“f9baeaa15fedf5e1ef7448dd60f46c01f1a9e9c4@1.2.3.4:26656”,“0491d373a8e0fcf1023aaf18c51d6a1d0d4f31bd@5.6.7.8:26656”]&persistent=false’
GET
/
dial_peers
dial_peers
curl --request GET \
--url https://rpc.cosmos.directory/cosmoshub/dial_peersimport requests
url = "https://rpc.cosmos.directory/cosmoshub/dial_peers"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://rpc.cosmos.directory/cosmoshub/dial_peers', 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/dial_peers",
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/dial_peers"
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/dial_peers")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.cosmos.directory/cosmoshub/dial_peers")
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{
"Log": "Dialing seeds in progress. See /net_info for details"
}{
"id": 0,
"jsonrpc": "2.0",
"error": "Description of failure"
}Query Parameters
Have the peers you are dialing be persistent
Example:
true
Have the peers you are dialing be unconditional
Example:
true
Have the peers you are dialing be private
Example:
true
array of peers to dial
Response
Dialing seeds in progress. See /net_info for details
Example:
"Dialing seeds in progress. See /net_info for details"
Was this page helpful?