Servers
Define server URLs and transport mechanisms for your JSON-RPC API
OpenRPC allows you to specify one or more server configurations that define how clients can connect to your JSON-RPC API.
Specifying servers is valuable for both SDKs and Docs:
- For SDKs, your users won’t need to manually specify the server URL at client instantiation
- For Docs, your API playground will automatically connect to the correct server
Transport protocols
JSON-RPC can be used over various transport protocols:
HTTP/HTTPS Transport
WebSocket Transport
TCP Transport
Server variables
Use variables to make your server configurations more flexible:
Multiple environments
Configure different environments with appropriate descriptions:
Server-specific configurations
Add server-specific metadata and configurations:
Load balancing and multiple URLs
Configure multiple server URLs for load balancing:
WebSocket-specific configurations
Configure WebSocket servers with connection parameters:
Security configurations
Configure authentication and security at the server level:
Transport-specific optimizations
Configure servers for specific use cases:
Server configurations help clients understand how to connect to your JSON-RPC API and which transport mechanism is most appropriate for their use case.