Commit 0790c8a7 authored by Riccardo Spagni's avatar Riccardo Spagni

Merge branch 'update_submit_block' into 'master'

update submit_block rpc documentation with example

See merge request monero-project/monero-site!887
parents 5cbfec6f 729a0a5c
{% assign version = '2.1.0' | split: '.' %} {% assign version = '2.2.0' | split: '.' %}
{% include disclaimer.html translated="false" version=page.version %} {% include disclaimer.html translated="false" version=page.version %}
## Introduction ## Introduction
...@@ -204,12 +204,27 @@ Alias: *submitblock*. ...@@ -204,12 +204,27 @@ Alias: *submitblock*.
Inputs: Inputs:
* Block blob data - string * Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine.
Outputs: Outputs:
* *status* - string; Block submit status. * *status* - string; Block submit status.
In this example, a block blob which has not been mined is submitted:
```
$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json'
{
"id": "0",
"jsonrpc": "2.0",
"error": {
"code": -7,
"message": "Block not accepted"
}
}
```
### **get_last_block_header** ### **get_last_block_header**
......
{% assign version = '2.1.0' | split: '.' %} {% assign version = '2.2.0' | split: '.' %}
{% include disclaimer.html translated="true" version=page.version %} {% include disclaimer.html translated="true" version=page.version %}
## Introduction ## Introduction
...@@ -204,12 +204,27 @@ Alias: *submitblock*. ...@@ -204,12 +204,27 @@ Alias: *submitblock*.
Inputs: Inputs:
* Block blob data - string * Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine.
Outputs: Outputs:
* *status* - string; Block submit status. * *status* - string; Block submit status.
In this example, a block blob which has not been mined is submitted:
```
$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json'
{
"id": "0",
"jsonrpc": "2.0",
"error": {
"code": -7,
"message": "Block not accepted"
}
}
```
### **get_last_block_header** ### **get_last_block_header**
......
{% assign version = '2.1.0' | split: '.' %} {% assign version = '2.2.0' | split: '.' %}
{% include disclaimer.html translated="false" version=page.version %} {% include disclaimer.html translated="false" version=page.version %}
## Introduction ## Introduction
...@@ -204,12 +204,27 @@ Alias: *submitblock*. ...@@ -204,12 +204,27 @@ Alias: *submitblock*.
Inputs: Inputs:
* Block blob data - string * Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine.
Outputs: Outputs:
* *status* - string; Block submit status. * *status* - string; Block submit status.
In this example, a block blob which has not been mined is submitted:
```
$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json'
{
"id": "0",
"jsonrpc": "2.0",
"error": {
"code": -7,
"message": "Block not accepted"
}
}
```
### **get_last_block_header** ### **get_last_block_header**
......
{% assign version = '2.1.0' | split: '.' %} {% assign version = '2.2.0' | split: '.' %}
{% include disclaimer.html translated="false" version=page.version %} {% include disclaimer.html translated="false" version=page.version %}
## Introduction ## Introduction
...@@ -204,12 +204,27 @@ Alias: *submitblock*. ...@@ -204,12 +204,27 @@ Alias: *submitblock*.
Inputs: Inputs:
* Block blob data - string * Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine.
Outputs: Outputs:
* *status* - string; Block submit status. * *status* - string; Block submit status.
In this example, a block blob which has not been mined is submitted:
```
$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json'
{
"id": "0",
"jsonrpc": "2.0",
"error": {
"code": -7,
"message": "Block not accepted"
}
}
```
### **get_last_block_header** ### **get_last_block_header**
......
{% assign version = '2.1.0' | split: '.' %} {% assign version = '2.2.0' | split: '.' %}
{% include disclaimer.html translated="false" version=page.version %} {% include disclaimer.html translated="false" version=page.version %}
## Introduction ## Introduction
...@@ -204,12 +204,27 @@ Alias: *submitblock*. ...@@ -204,12 +204,27 @@ Alias: *submitblock*.
Inputs: Inputs:
* Block blob data - string * Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine.
Outputs: Outputs:
* *status* - string; Block submit status. * *status* - string; Block submit status.
In this example, a block blob which has not been mined is submitted:
```
$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json'
{
"id": "0",
"jsonrpc": "2.0",
"error": {
"code": -7,
"message": "Block not accepted"
}
}
```
### **get_last_block_header** ### **get_last_block_header**
......
...@@ -4,7 +4,7 @@ title: "Daemon RPC documentation" ...@@ -4,7 +4,7 @@ title: "Daemon RPC documentation"
permalink: /resources/developer-guides/daemon-rpc.html permalink: /resources/developer-guides/daemon-rpc.html
mainVersion: mainVersion:
- "2" - "2"
- "1" - "2"
- "0" - "0"
--- ---
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment