broadcast_tx_sync
curl --request GET \
--url https://rpc.cosmos.directory/cosmoshub/broadcast_tx_syncimport requests
url = "https://rpc.cosmos.directory/cosmoshub/broadcast_tx_sync"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://rpc.cosmos.directory/cosmoshub/broadcast_tx_sync', 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/broadcast_tx_sync",
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/broadcast_tx_sync"
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/broadcast_tx_sync")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.cosmos.directory/cosmoshub/broadcast_tx_sync")
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": {
"code": "0",
"data": "",
"log": "",
"hash": "0D33F2F03A5234F38706E43004489E061AC40A2E",
"codespace": "ibc"
},
"error": ""
}{
"id": 0,
"jsonrpc": "2.0",
"error": "Description of failure"
}Tx
broadcast_tx_sync
Returns with the response from CheckTx. Does not wait for DeliverTx result.
If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSONRPC via a websocket. See https://docs.cosmos.network/cometbft/v0.38/docs/core/Subscribing-to-events-via-Websocket If you haven’t received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen:
- malicious node can drop or pretend it had committed your tx
- malicious proposer (not necessary the one you’re communicating with) can drop transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322)
Please refer to formatting/encoding rules for additional details
GET
/
broadcast_tx_sync
broadcast_tx_sync
curl --request GET \
--url https://rpc.cosmos.directory/cosmoshub/broadcast_tx_syncimport requests
url = "https://rpc.cosmos.directory/cosmoshub/broadcast_tx_sync"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://rpc.cosmos.directory/cosmoshub/broadcast_tx_sync', 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/broadcast_tx_sync",
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/broadcast_tx_sync"
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/broadcast_tx_sync")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.cosmos.directory/cosmoshub/broadcast_tx_sync")
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": {
"code": "0",
"data": "",
"log": "",
"hash": "0D33F2F03A5234F38706E43004489E061AC40A2E",
"codespace": "ibc"
},
"error": ""
}{
"id": 0,
"jsonrpc": "2.0",
"error": "Description of failure"
}Was this page helpful?