You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/design/eth-subscribe.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,6 +228,29 @@ continuous, gapless sequence without duplicates in the following:
228
228
returned block is in the cache. If it is not, it saves it to cache, and then
229
229
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.
230
230
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
+
231
254
## Error Codes
232
255
233
256
| Error Codes | Error message | Solution |
@@ -289,6 +312,7 @@ Add acceptance tests that follow the structure of the existing polling for logs
0 commit comments