Skip to content

Commit 19566c6

Browse files
AlfredoG87ebadiere
andauthored
fix: Fix to eth_subscribe.md (#2230) (#2344)
feat: newHeads documentation update. Signed-off-by: ebadiere <[email protected]> Signed-off-by: Alfredo Gutierrez <[email protected]> Co-authored-by: Eric Badiere <[email protected]>
1 parent bc57e6b commit 19566c6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/design/eth-subscribe.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,29 @@ continuous, gapless sequence without duplicates in the following:
228228
returned block is in the cache. If it is not, it saves it to cache, and then
229229
sends it to the subscriber in the `websocket.send` call. If it is in cache, then we know it's already been sent and it is skipped.
230230

231+
#### Handle non-subscription JSON RPC calls to the relay
232+
The WebSocket provider will be connected to the `webSocketServer.ts` via a websocket connection. Besu and other execution engines support [JSON-RPC over
233+
WebSockets](https://besu.hyperledger.org/public-networks/how-to/use-besu-api/json-rpc). In order for the WebSocket server in the relay to support JSON-RPC over
234+
WebSockets, each method call to the `webSocketServer.ts` needs to call the existing JSON-RPC call in the relay. The `webSocketServer.ts` just needs to handle the
235+
JSON-RPC method call to the relay. The JSON-RPC calls to the relay are listed below.
236+
237+
#### Blockchain Data Reading
238+
1. **getBlockNumber():** Returns the current block number.
239+
2. **getGasPrice():** Returns the current gas price.
240+
3. **getBlock(blockHashOrBlockTag, includeTransactions):** Fetches a block by its hash or tag, optionally including transactions.
241+
4. **getTransaction(transactionHash):** Fetches a transaction by its hash.
242+
5. **getTransactionReceipt(transactionHash):** Fetches the receipt of a transaction by its hash.
243+
6. **getTransactionCount(address, blockTag):** Gets the number of transactions sent from an address, optionally at a specific block.
244+
7. **getCode(address, blockTag):** Gets the code at a specific address.
245+
8. **getStorageAt(address, position, blockTag):** Reads a storage slot from a contract.
246+
9. **call(transaction, blockTag):** Simulates a transaction call.
247+
10. **estimateGas(transaction):** Estimates the gas needed to execute a transaction.
248+
11. **getBalance(address, blockTag):** Gets the balance of an address.
249+
250+
### Blockchain Interaction
251+
1. **sendTransaction(signedTransaction):** Sends a signed transaction to the network.
252+
253+
231254
## Error Codes
232255

233256
| Error Codes | Error message | Solution |
@@ -289,6 +312,7 @@ Add acceptance tests that follow the structure of the existing polling for logs
289312
"hash":"0x50d2fe6747f21334213a8bc2691f02b6338f265e9f39f12c1f98f247e18f33aa",
290313
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
291314
"miner": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069",
315+
"mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
292316
"nonce": "0x084149998194cc5f",
293317
"number": "0x1348c9",
294318
"parentHash": "0x7736fab79e05dc611604d22470dadad26f56fe494421b5b333de816ce1f25701",

0 commit comments

Comments
 (0)