The xrpld server has a limited gRPC API it can provide. Clio servers use this API to retrieve data about the latest validated ledgers and transactions. You can enable the gRPC API on your server with a new configuration stanza.
To enable gRPC, you must meet the following prerequisites:
You must have installed xrpld.
Your server must be able to bind to the port you choose.
To enable gRPC on your server, complete the following steps:
Ensure the
[port_grpc]stanza is in yourxrpldconfig file.[port_grpc] port = 50051 ip = 127.0.0.1portdefines the port the server listens on for gRPC connections from client applications. The recommended port is50051.ipdefines which interfaces the server listens on.127.0.0.1limits connections to the local loopback network (same machine) and is enabled by default. Changing the value to0.0.0.0listens on all available network interfaces.
The recommended installation uses the config file
/etc/xrpld/xrpld.cfgby default. Other places you can put a config file include$HOME/.config/xrpld/xrpld.cfg(where$HOMEis the home directory of the user runningrippled),$HOME/.local/xrpld/xrpld.cfg, or the current working directory from where you startrippled.The config file was renamed from
rippled.cfgtoxrpld.cfg. During the transition, ifxrpld.cfgis not present the server still readsrippled.cfgfrom the same locations, so existing config files keep working without being renamed.(Optional) To secure gRPC connections with TLS, add the following settings to the
[port_grpc]stanza. All certificate and key files must be in PEM format.[port_grpc] port = 50051 ip = 127.0.0.1 ssl_cert = /etc/ssl/certs/grpc-server.crt ssl_key = /etc/ssl/private/grpc-server.key ssl_cert_chain = /etc/ssl/certs/grpc-intermediate-ca.crt ssl_client_ca = /etc/ssl/certs/grpc-client-ca.crtssl_certandssl_keydefine the paths to the server's TLS certificate and private key. Set both to enable TLS.ssl_cert_chain(optional) defines the path to a file of intermediate CA certificates.ssl_client_ca(optional) defines the path to a CA certificate used to verify client certificates, enabling mutual TLS (mTLS).
Start (or restart) the
xrpldservice.sudo systemctl restart xrpld