From 5f951c299c625cef8272bdd8aada67ff2a285fa2 Mon Sep 17 00:00:00 2001 From: Alfie John Date: Wed, 11 Jan 2023 21:03:19 +1100 Subject: [PATCH] [website] more minor fixes (#26471) * Fix typo * Moving JSON examples to json highlighting * Align braces * Fixing formatting to follow every other example --- .../rpc/ns-personal-deprecation.md | 2 +- docs/interacting-with-geth/rpc/pubsub.md | 74 +++++++++---------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/docs/interacting-with-geth/rpc/ns-personal-deprecation.md b/docs/interacting-with-geth/rpc/ns-personal-deprecation.md index 2b2f19ef9b..559b213b8e 100644 --- a/docs/interacting-with-geth/rpc/ns-personal-deprecation.md +++ b/docs/interacting-with-geth/rpc/ns-personal-deprecation.md @@ -135,7 +135,7 @@ Clef also has `account_signTypedData` that signs data structured according to [E Example call (use the following as a template for `` in `curl --data -X POST localhost:8550 -H "Content-Type: application/json"`) -```sh +```json { "id": 68, "jsonrpc": "2.0", diff --git a/docs/interacting-with-geth/rpc/pubsub.md b/docs/interacting-with-geth/rpc/pubsub.md index c360c65af6..be787f08bb 100644 --- a/docs/interacting-with-geth/rpc/pubsub.md +++ b/docs/interacting-with-geth/rpc/pubsub.md @@ -64,7 +64,7 @@ Subscriptions are cancelled with a regular RPC call with `eth_unsubscribe` as me ### Example -```sh +```json {"id": 1, "method": "eth_unsubscribe", "params": ["0x9cef478923ff08bf67fde6c64013158d"]} {"jsonrpc":"2.0","id":1,"result":true} ``` @@ -79,37 +79,37 @@ In case of a chain reorganization the subscription will emit the last header in #### Example -```sh +```json {"id": 1, "method": "eth_subscribe", "params": ["newHeads"]} ``` returns -```sh +```json {"jsonrpc":"2.0","id":2,"result":"0x9ce59a13059e417087c02d3236a0b1cc"} { - "jsonrpc": "2.0", - "method": "eth_subscription", - "params": { - "result": { - "difficulty": "0x15d9223a23aa", - "extraData": "0xd983010305844765746887676f312e342e328777696e646f7773", - "gasLimit": "0x47e7c4", - "gasUsed": "0x38658", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "miner": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069", - "nonce": "0x084149998194cc5f", - "number": "0x1348c9", - "parentHash": "0x7736fab79e05dc611604d22470dadad26f56fe494421b5b333de816ce1f25701", - "receiptRoot": "0x2fab35823ad00c7bb388595cb46652fe7886e00660a01e867824d3dceb1c8d36", - "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - "stateRoot": "0xb3346685172db67de536d8765c43c31009d0eb3bd9c501c9be3229203f15f378", - "timestamp": "0x56ffeff8", - "transactionsRoot": "0x0167ffa60e3ebc0b080cdb95f7c0087dd6c0e61413140e39d94d3468d7c9689f" - }, - "subscription": "0x9ce59a13059e417087c02d3236a0b1cc" - } + "jsonrpc": "2.0", + "method": "eth_subscription", + "params": { + "result": { + "difficulty": "0x15d9223a23aa", + "extraData": "0xd983010305844765746887676f312e342e328777696e646f7773", + "gasLimit": "0x47e7c4", + "gasUsed": "0x38658", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "miner": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069", + "nonce": "0x084149998194cc5f", + "number": "0x1348c9", + "parentHash": "0x7736fab79e05dc611604d22470dadad26f56fe494421b5b333de816ce1f25701", + "receiptRoot": "0x2fab35823ad00c7bb388595cb46652fe7886e00660a01e867824d3dceb1c8d36", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "stateRoot": "0xb3346685172db67de536d8765c43c31009d0eb3bd9c501c9be3229203f15f378", + "timestamp": "0x56ffeff8", + "transactionsRoot": "0x0167ffa60e3ebc0b080cdb95f7c0087dd6c0e61413140e39d94d3468d7c9689f" + }, + "subscription": "0x9ce59a13059e417087c02d3236a0b1cc" + } } ``` @@ -117,7 +117,7 @@ returns Returns logs that are included in new imported blocks and match the given filter criteria. -In case of a chain reorganization previous sent logs that are on the old chain will be resend with the `removed` property set to true. Logs from transactions that ended up in the new chain are emitted. Therefore a subscription can emit logs for the same transaction multiple times. +In case of a chain reorganization previous sent logs that are on the old chain will be resent with the `removed` property set to true. Logs from transactions that ended up in the new chain are emitted. Therefore a subscription can emit logs for the same transaction multiple times. #### Parameters @@ -127,13 +127,13 @@ In case of a chain reorganization previous sent logs that are on the old chain w #### Example -```sh +```json {"id": 1, "method": "eth_subscribe", "params": ["logs", {"address": "0x8320fe7702b96808f7bbc0d4a888ed1468216cfd", "topics": ["0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"]}]} ``` returns -```sh +```json {"jsonrpc":"2.0","id":2,"result":"0x4a8a4c0517381924f9838102c5a4dcb7"} {"jsonrpc":"2.0","method":"eth_subscription","params": {"subscription":"0x4a8a4c0517381924f9838102c5a4dcb7","result":{"address":"0x8320fe7702b96808f7bbc0d4a888ed1468216cfd","blockHash":"0x61cdb2a09ab99abf791d474f20c2ea89bf8de2923a2d42bb49944c8c993cbf04","blockNumber":"0x29e87","data":"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003","logIndex":"0x0","topics":["0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"],"transactionHash":"0xe044554a0a55067caafd07f8020ab9f2af60bdfe337e395ecd84b4877a3d1ab4","transactionIndex":"0x0"}}} @@ -151,22 +151,22 @@ none #### Example -```sh +```json {"id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]} ``` returns -```sh +```json {"jsonrpc":"2.0","id":2,"result":"0xc3b33aa549fb9a60e95d21862596617c"} { - "jsonrpc":"2.0", - "method":"eth_subscription", - "params":{ - "subscription":"0xc3b33aa549fb9a60e95d21862596617c", - "result":"0xd6fdc5cc41a9959e922f30cb772a9aef46f4daea279307bc5f7024edc4ccd7fa" - } - } + "jsonrpc":"2.0", + "method":"eth_subscription", + "params":{ + "subscription":"0xc3b33aa549fb9a60e95d21862596617c", + "result":"0xd6fdc5cc41a9959e922f30cb772a9aef46f4daea279307bc5f7024edc4ccd7fa" + } +} ``` ### syncing {#syncing} @@ -179,7 +179,7 @@ none #### Example -```sh +```json {"id": 1, "method": "eth_subscribe", "params": ["syncing"]} {"jsonrpc":"2.0","id":2,"result":"0xe2ffeb2703bcf602d42922385829ce96"}