relay_tx - Monero

Example code for the relay_tx JSON-RPC method. Complete guide on how to use relay_tx JSON-RPC in GetBlock Web3 documentation.

This method instructs the node to relay one or more transactions (identified by hash) to its peers. The transactions must already be in the node's mempool.

Parameters

Parameter
Type
Required
Description

txids

array of string

Yes

List of transaction hashes (hex) to relay

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "relay_tx",
    "params": {
        "txids": [
            "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"
        ]
    },
    "id": "getblock.io"
}'

Response Example

Response Parameters

Field
Type
Description

result.status

string

OK if relay was attempted

Use Cases

  • Re-broadcasting transactions stuck in the mempool

  • Mining-pool operations re-relaying after upstream issues

Error Handling

Status Code
Error Message
Cause

404

Not Found

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?