NodeRpcClientImpl
Ktor-based implementation of NodeRpcClient for Midnight node JSON-RPC API.
Connection:
HTTP endpoint: POST to
{nodeUrl}(e.g., http://localhost:9944)JSON-RPC 2.0 protocol
Timeout: 30 seconds (configurable)
Security:
Development mode: Allows HTTP to localhost (testing only)
Production mode: Requires HTTPS (not yet implemented)
Parameters
HTTP client for making requests (injectable for testing)
Node RPC endpoint URL (e.g., "http://localhost:9944")
If true, allows HTTP to localhost (INSECURE - testing only)
Functions
Get the hash of the latest finalized block.
The node's runtime version (standard Substrate RPC: state_getRuntimeVersion).
Submit transaction and wait for finalization using WebSocket subscription.
Submit a serialized transaction to the Midnight node (fire-and-forget).