NodeRpcClient
Client for Midnight node JSON-RPC API.
Submits transactions to the Midnight blockchain via the node's RPC interface.
JSON-RPC 2.0 Protocol:
Endpoint: HTTP POST to node RPC (default: http://localhost:9944)
Method:
author_submitExtrinsic(standard Substrate RPC)Params: Hex-encoded serialized transaction (SCALE codec)
Response: Transaction hash (32 bytes hex)
Transaction Lifecycle (with WebSocket):
1. Submit via WebSocket → Get subscription
2. Receive status events: ready → broadcast → inBlock → finalized
3. Return when finalized (typically 6-12 seconds)Error Handling:
Network errors: Retry with exponential backoff
Server errors (5xx): Retry with backoff
Client errors (4xx): Don't retry
Transaction rejected: Don't retry (fix transaction)
See also
for implementation details
Inheritors
Functions
Get the hash of the latest finalized block.
Submit a transaction and wait for it to be finalized on-chain.
Submit a serialized transaction to the Midnight node (fire-and-forget).