Add TCP and TLS listening support to the cardano-rpc gRPC server - #1322
Open
carbolymer wants to merge 2 commits into
Open
Add TCP and TLS listening support to the cardano-rpc gRPC server#1322carbolymer wants to merge 2 commits into
carbolymer wants to merge 2 commits into
Conversation
carbolymer
force-pushed
the
mgalazyn/feature/rpc-enable-http
branch
2 times, most recently
from
August 28, 2026 16:25
590e4ae to
919a74d
Compare
carbolymer
marked this pull request as ready for review
August 28, 2026 16:26
carbolymer
requested review from
CarlosLopezDeLara,
Jimbo4350,
disassembler,
erikd and
palas
as code owners
August 28, 2026 16:26
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends cardano-rpc’s server configuration to support listening on HTTP/2 endpoints (h2c and TLS) in addition to the existing unix-domain socket listener, and wires that into server startup and tracing. It introduces a breaking API change in the exposed Cardano.Rpc.Server.Config module by replacing rpcSocketPath with a new rpcEndpoint sum type.
Changes:
- Replace
RpcConfigF’s unix-socket-onlyrpcSocketPathwithrpcEndpoint :: RpcEndpoint(unix socket / h2c / h2 + TLS) and add TLS credential types. - Update server startup to translate
RpcEndpointinto the underlyinggrapesyServerConfig, and emit a new lifecycle trace when starting. - Add dependencies needed for IP/port representation (
iproute,network) and add a changelog fragment marking the change asbreaking.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cardano-rpc/src/Cardano/Rpc/Server/Internal/Tracing.hs | Adds a new TraceRpc constructor and pretty-printing for server start/listen events. |
| cardano-rpc/src/Cardano/Rpc/Server/Config.hs | Introduces RpcEndpoint/TLS types and replaces rpcSocketPath with rpcEndpoint in the exposed config. |
| cardano-rpc/src/Cardano/Rpc/Server.hs | Maps RpcEndpoint to ServerConfig (unix/h2c/h2+TLS) and emits the new trace event on startup. |
| cardano-rpc/cardano-rpc.cabal | Adds iproute and network dependencies required by the new endpoint types. |
| .changes/20260828_cardano_rpc_grpc_tcp_listener.yml | Adds a changelog fragment describing the new endpoint support and marking it as breaking. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replace the rpcSocketPath field of RpcConfigF with an RpcEndpoint sum type: the server listens either on a unix domain socket (default, rpc.sock next to the node socket) or on plaintext TCP (HTTP/2 without TLS) when a listen port is configured. The TCP listen address defaults to 127.0.0.1. Trace the resolved endpoint on server start.
9 tasks
carbolymer
force-pushed
the
mgalazyn/feature/rpc-enable-http
branch
from
August 28, 2026 16:32
919a74d to
9ffcc0d
Compare
Add an RpcEndpointTcpTls endpoint: when TLS certificate and private key files are configured, the server listens with TLS on the configured host and port. Grapesy's default of honouring the SSLKEYLOGFILE environment variable is explicitly disabled so the node never silently logs TLS session keys.
carbolymer
force-pushed
the
mgalazyn/feature/rpc-enable-http
branch
from
August 28, 2026 16:36
9ffcc0d to
999ef20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The cardano-rpc gRPC server has so far only listened on a unix domain socket, requiring a proxy such as Envoy in front of it for any remote or non-local access (documented as the accepted architecture in ADR-018).
This PR adds native HTTP/2 listeners to the server, superseding that part of ADR-018.
The server can now listen on:
The configuration surface for this (JSON keys
RpcListenAddress/RpcListenPort/RpcTlsCertificateFile/RpcTlsPrivateKeyFile/RpcTlsChainCertificateFiles, and CLI flags--grpc-listen-address/--grpc-listen-port/--grpc-tls-certificate/--grpc-tls-private-key/--grpc-tls-chain-certificate) lives in cardano-node; this PR provides the underlying cardano-rpc library support it builds on.The listen address defaults to
127.0.0.1and accepts either an IPv4 or IPv6 address.Configuring both a socket path and a listen port is rejected at configuration parsing time, since exactly one listener can be active.
TLS key logging follows grapesy's default behaviour, so it honours
SSLKEYLOGFILEwhen set.Breaking change
RpcConfigF'srpcSocketPathfield is replaced byrpcEndpoint, of a newRpcEndpointsum type:RpcTlsFilesis a new record ofFile-typed certificate and key paths.RpcEndpointhas aPrettyinstance, andTraceRpcgained a newTraceRpcServerListeningconstructor, emitted when the server starts listening, that reports the active endpoint.How to trust this PR
Two commits, one per listener type:
Add TCP listening support to the gRPC serverAdd TLS listening support to the gRPC serverReviewers can check
cardano-rpc/src/Cardano/Rpc/Server/Config.hsfor theRpcEndpoint/RpcTlsFilestypes and defaults, andcardano-rpc/src/Cardano/Rpc/Server.hsfor how eachRpcEndpointconstructor maps onto grapesy'sServerConfig(InsecureConfigfor h2c,SecureConfigfor TLS).Checklist
.changes/