submit_block - Monero

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

This method submits a mined block to the network. The block blob must be hex-encoded and ordered correctly. The params field is a single-element array containing the block blob.

Parameters

Parameter
Type
Required
Description

params[0]

string

Yes

Hex-encoded block blob from a successful mining solution

Request Example

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

Response Example

{
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": {
        "status": "OK",
        "untrusted": false
    }
}

Response Parameters

Field
Type
Description

result.status

string

OK if the block was accepted

result.untrusted

boolean

true if the node is in bootstrap mode

Use Cases

  • Submitting successful mining solutions

  • Mining pool block broadcast

  • Solo mining clients

Error Handling

Status Code
Error Message
Cause

404

Not Found

Missing or invalid <ACCESS-TOKEN>

429

Too Many Requests

Rate limit exceeded for your plan

-7

Block not accepted

Submitted block failed validation (bad PoW, stale, malformed)

SDK Integration

Last updated

Was this helpful?