-
Notifications
You must be signed in to change notification settings - Fork 0
Specifiying RPC 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 messagesUsing the -v, --verbose option will display the uri of the endpoint for all commands.
rchia can look up endpoints in the normal chia config file; typically located at ~/.chia/mainnet/config/config.yaml.
./rchia show state --default-chia-configThe path to a chia config file can also be specified
./rchia show state --chia-config-path /some/path/config.yamlWhen 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.
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.keyrchia can save endpoint details locally so that they can easily be reused.
Every saved endpoint has a unique id.
./rchia show state --endpoint node1A 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/
...chia and its logo are the registered trademark or trademark of Chia Network, Inc. in the United States and worldwide.