From 55e1625dfb052017f826862ffb9e515bc637e6fb Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 17 Sep 2018 15:10:34 -0400 Subject: [PATCH 1/2] update submit_block rpc documentation with example --- .../ar/resources/developer-guides/daemon-rpc.md | 17 ++++++++++++++++- .../en/resources/developer-guides/daemon-rpc.md | 17 ++++++++++++++++- .../es/resources/developer-guides/daemon-rpc.md | 17 ++++++++++++++++- .../fr/resources/developer-guides/daemon-rpc.md | 17 ++++++++++++++++- .../it/resources/developer-guides/daemon-rpc.md | 17 ++++++++++++++++- 5 files changed, 80 insertions(+), 5 deletions(-) diff --git a/_i18n/ar/resources/developer-guides/daemon-rpc.md b/_i18n/ar/resources/developer-guides/daemon-rpc.md index fcd5d984..a9606aed 100644 --- a/_i18n/ar/resources/developer-guides/daemon-rpc.md +++ b/_i18n/ar/resources/developer-guides/daemon-rpc.md @@ -204,12 +204,27 @@ Alias: *submitblock*. 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: * *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** diff --git a/_i18n/en/resources/developer-guides/daemon-rpc.md b/_i18n/en/resources/developer-guides/daemon-rpc.md index 1cf8310b..11fe435e 100644 --- a/_i18n/en/resources/developer-guides/daemon-rpc.md +++ b/_i18n/en/resources/developer-guides/daemon-rpc.md @@ -204,12 +204,27 @@ Alias: *submitblock*. 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: * *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** diff --git a/_i18n/es/resources/developer-guides/daemon-rpc.md b/_i18n/es/resources/developer-guides/daemon-rpc.md index fcd5d984..a9606aed 100644 --- a/_i18n/es/resources/developer-guides/daemon-rpc.md +++ b/_i18n/es/resources/developer-guides/daemon-rpc.md @@ -204,12 +204,27 @@ Alias: *submitblock*. 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: * *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** diff --git a/_i18n/fr/resources/developer-guides/daemon-rpc.md b/_i18n/fr/resources/developer-guides/daemon-rpc.md index fcd5d984..a9606aed 100644 --- a/_i18n/fr/resources/developer-guides/daemon-rpc.md +++ b/_i18n/fr/resources/developer-guides/daemon-rpc.md @@ -204,12 +204,27 @@ Alias: *submitblock*. 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: * *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** diff --git a/_i18n/it/resources/developer-guides/daemon-rpc.md b/_i18n/it/resources/developer-guides/daemon-rpc.md index fcd5d984..a9606aed 100644 --- a/_i18n/it/resources/developer-guides/daemon-rpc.md +++ b/_i18n/it/resources/developer-guides/daemon-rpc.md @@ -204,12 +204,27 @@ Alias: *submitblock*. 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: * *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** From 729a0a5c48de07b2d1508c54b0c0e1b9cca52130 Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 17 Sep 2018 18:03:24 -0400 Subject: [PATCH 2/2] bump versions to 2.2.0 --- _i18n/ar/resources/developer-guides/daemon-rpc.md | 2 +- _i18n/en/resources/developer-guides/daemon-rpc.md | 2 +- _i18n/es/resources/developer-guides/daemon-rpc.md | 2 +- _i18n/fr/resources/developer-guides/daemon-rpc.md | 2 +- _i18n/it/resources/developer-guides/daemon-rpc.md | 2 +- resources/developer-guides/daemon-rpc.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/_i18n/ar/resources/developer-guides/daemon-rpc.md b/_i18n/ar/resources/developer-guides/daemon-rpc.md index a9606aed..4dc08f86 100644 --- a/_i18n/ar/resources/developer-guides/daemon-rpc.md +++ b/_i18n/ar/resources/developer-guides/daemon-rpc.md @@ -1,4 +1,4 @@ -{% assign version = '2.1.0' | split: '.' %} +{% assign version = '2.2.0' | split: '.' %} {% include disclaimer.html translated="false" version=page.version %} ## Introduction diff --git a/_i18n/en/resources/developer-guides/daemon-rpc.md b/_i18n/en/resources/developer-guides/daemon-rpc.md index 11fe435e..361b4ee0 100644 --- a/_i18n/en/resources/developer-guides/daemon-rpc.md +++ b/_i18n/en/resources/developer-guides/daemon-rpc.md @@ -1,4 +1,4 @@ -{% assign version = '2.1.0' | split: '.' %} +{% assign version = '2.2.0' | split: '.' %} {% include disclaimer.html translated="true" version=page.version %} ## Introduction diff --git a/_i18n/es/resources/developer-guides/daemon-rpc.md b/_i18n/es/resources/developer-guides/daemon-rpc.md index a9606aed..4dc08f86 100644 --- a/_i18n/es/resources/developer-guides/daemon-rpc.md +++ b/_i18n/es/resources/developer-guides/daemon-rpc.md @@ -1,4 +1,4 @@ -{% assign version = '2.1.0' | split: '.' %} +{% assign version = '2.2.0' | split: '.' %} {% include disclaimer.html translated="false" version=page.version %} ## Introduction diff --git a/_i18n/fr/resources/developer-guides/daemon-rpc.md b/_i18n/fr/resources/developer-guides/daemon-rpc.md index a9606aed..4dc08f86 100644 --- a/_i18n/fr/resources/developer-guides/daemon-rpc.md +++ b/_i18n/fr/resources/developer-guides/daemon-rpc.md @@ -1,4 +1,4 @@ -{% assign version = '2.1.0' | split: '.' %} +{% assign version = '2.2.0' | split: '.' %} {% include disclaimer.html translated="false" version=page.version %} ## Introduction diff --git a/_i18n/it/resources/developer-guides/daemon-rpc.md b/_i18n/it/resources/developer-guides/daemon-rpc.md index a9606aed..4dc08f86 100644 --- a/_i18n/it/resources/developer-guides/daemon-rpc.md +++ b/_i18n/it/resources/developer-guides/daemon-rpc.md @@ -1,4 +1,4 @@ -{% assign version = '2.1.0' | split: '.' %} +{% assign version = '2.2.0' | split: '.' %} {% include disclaimer.html translated="false" version=page.version %} ## Introduction diff --git a/resources/developer-guides/daemon-rpc.md b/resources/developer-guides/daemon-rpc.md index 3da5dfc8..7af6139d 100644 --- a/resources/developer-guides/daemon-rpc.md +++ b/resources/developer-guides/daemon-rpc.md @@ -4,7 +4,7 @@ title: "Daemon RPC documentation" permalink: /resources/developer-guides/daemon-rpc.html mainVersion: - "2" - - "1" + - "2" - "0" ---