pub async fn start_rpc(
database_url: Option<Url>,
bigtable_instance: Option<String>,
db_args: DbArgs,
rpc_args: RpcArgs,
node_args: NodeArgs,
system_package_task_args: SystemPackageTaskArgs,
rpc_config: RpcConfig,
registry: &Registry,
cancel: CancellationToken,
) -> Result<JoinHandle<()>>
Expand description
Set-up and run the RPC service, using the provided arguments (expected to be extracted from the command-line). The service will continue to run until the cancellation token is triggered, and will signal cancellation on the token when it is shutting down.
Access to most reads is controlled by the database_url
– if it is None
, reads will not work.
The only exception is the DelegationCoins
module, which is controlled by node_args.fullnode_rpc_url
,
which can be omitted to disable reads from this RPC.
KV queries can optionally be served by a Bigtable instance, if bigtable_instance
is provided.
Otherwise these requests are served by the database. If a bigtable_instance
is provided, the
GOOGLE_APPLICATION_CREDENTIALS
environment variable must point to the credentials JSON file.
Access to writes (executing and dry-running transactions) is controlled by node_args.fullnode_rpc_url
,
which can be omitted to disable writes from this RPC.
The service may spin up auxiliary services (such as the system package task) to support itself, and will clean these up on shutdown as well.