lightwalletd icon indicating copy to clipboard operation
lightwalletd copied to clipboard

Verify that the zcashd configuration enables the "lightwalletd" indices

Open LarryRuane opened this issue 4 years ago • 0 comments

The instance of zcashd that a lightwalletd uses is required to have either lightwalletd or insightexplorer configuration options enabled. Currently, lightwalletd doesn't check that one of these options is enabled. It could easily do so by executing the getexperimentalfeatures RPC during startup and checking the returned result for either of these two options. Here's an example of what this RPC returns using the CLI:

$ src/zcash-cli getexperimentalfeatures
[
  "lightwalletd"
]

It would be very easy for lightwalletd to execute this RPC, parse the result to look for either option being present, and if not, print a helpful error message and exit.

An alternate approach is to note that lightwalletd opens and parses the zcash.conf file, and these options may be specified there. But they may instead be specified on the zcashd command line, in which case lightwalletd will think neither option is enabled when it actually is. So it's more reliable to use the RPC.

A possible future problem that may arise is if these options are moved out of the "experimental" category. (They probably could be even now.) If that happens, a possible solution is to add an entry to the JSON result of the getinfo RPC (which lightwalletd calls during startup already).

LarryRuane avatar Dec 20 '21 18:12 LarryRuane