Skip to content
This repository was archived by the owner on Jul 22, 2022. It is now read-only.

Specifiying RPC Endpoints

Don Kackman edited this page Oct 4, 2021 · 6 revisions

Endpoints

Because rchia uses RPC, it needs to additional information in order to connect to a given node. In all cases rchia needs the private crt and key files that authenticate the RPC endpoints. rchia never copies or transmits these files, except to authenticate with the endpoint.

There are three approaches to defining endpoints and all rchia commands accept these endpoint options.

Options:
  -uri, --endpoint-uri <PATH>        The uri of the rpc endpoint, including the proper port and wss/https scheme prefix
  -cp, --cert-path <PATH>            The full path to the .crt file to use for authentication
  -kp, --key-path <PATH>             The full path to the .key file to use for authentication
  -ccp, --chia-config-path <PATH>    The full path to a chia config yaml file for endpoints
  -dcc, --default-chia-config        Flag indicating to use the default chia config for endpoints
  -de, --default-endpoint            Flag indicating to use the default saved endpoint
  -ep, --endpoint <ID>               Use a saved endpoint
  -v, --verbose                      Set output to verbose messages

Using the -v, --verbose option will display the uri of the endpoint for all commands.

Using the chia config

rchia can look up endpoints in the normal chia config file; typically located at ~/.chia/mainnet/config/config.yaml.

./rchia show state --default-chia-config

The path to a chia config file can also be specified

./rchia show state --chia-config-path /some/path/config.yaml

When using the chia config file, each command will lookup the endpoint configuration required in order to find the endpoint address and path to the authentication certificate.

On the command line

The details of the endpoint can be set on the command line with each call. With this approach the endpoint uri, as well as the path to the crt and key files must always be se set together.

./rchia show state --endpoint-uri https://node1:8555 --cert-path ~/certs/node1/private_full_node.crt --key-path ~/certs/node1/private_full_node.key

Using saved endpoints

rchia can save endpoint details locally so that they can easily be reused.

Using the id of a saved endpoint

Every saved endpoint has a unique id.

./rchia show state --endpoint node1

Using the default endpoint

A default endpoint can be set. In any case where no endpoint details are set, or when the -de, --default-endpoint` option is specified, the default endpoint will be used.

./rchia show state -v
No endpoint options set. Using default endpoint.
Using endpoint https://localhost:8555/

...

Clone this wiki locally