broadcast_tx_commit
curl --request GET \
--url https://rpc.cosmos.directory/cosmoshub/broadcast_tx_commitimport requests
url = "https://rpc.cosmos.directory/cosmoshub/broadcast_tx_commit"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://rpc.cosmos.directory/cosmoshub/broadcast_tx_commit', 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_commit",
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_commit"
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_commit")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.cosmos.directory/cosmoshub/broadcast_tx_commit")
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{
"error": "",
"result": {
"height": "26682",
"hash": "75CA0F856A4DA078FC4911580360E70CEFB2EBEE",
"deliver_tx": {
"log": "",
"data": "",
"code": "0"
},
"check_tx": {
"log": "",
"data": "",
"code": "0"
}
},
"id": 0,
"jsonrpc": "2.0"
}{
"id": 0,
"jsonrpc": "2.0",
"error": "Description of failure"
}Tx
broadcast_tx_commit
Returns with the responses from CheckTx and DeliverTx.
IMPORTANT: use only for testing and development. In production, use BroadcastTxSync or BroadcastTxAsync. You can subscribe for the transaction result using JSONRPC via a websocket. See https://docs.cosmos.network/cometbft/v0.38/docs/core/Subscribing-to-events-via-Websocket
CONTRACT: only returns error if mempool.CheckTx() errs or if we timeout waiting for tx to commit.
If CheckTx or DeliverTx fail, no error will be returned, but the returned result will contain a non-OK ABCI code.
Please refer to formatting/encoding rules for additional details
GET
/
broadcast_tx_commit
broadcast_tx_commit
curl --request GET \
--url https://rpc.cosmos.directory/cosmoshub/broadcast_tx_commitimport requests
url = "https://rpc.cosmos.directory/cosmoshub/broadcast_tx_commit"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://rpc.cosmos.directory/cosmoshub/broadcast_tx_commit', 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_commit",
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_commit"
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_commit")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.cosmos.directory/cosmoshub/broadcast_tx_commit")
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{
"error": "",
"result": {
"height": "26682",
"hash": "75CA0F856A4DA078FC4911580360E70CEFB2EBEE",
"deliver_tx": {
"log": "",
"data": "",
"code": "0"
},
"check_tx": {
"log": "",
"data": "",
"code": "0"
}
},
"id": 0,
"jsonrpc": "2.0"
}{
"id": 0,
"jsonrpc": "2.0",
"error": "Description of failure"
}Was this page helpful?