| 41 | } |
| 42 | |
| 43 | static void show_usage(const char *progname) |
| 44 | { |
| 45 | printf("%s <method> [arguments]\n", progname); |
| 46 | printf("methods:\n"); |
| 47 | printf(" - decrypt <path/to/hsm_secret> [LEGACY - binary format only]\n"); |
| 48 | printf(" - encrypt <path/to/hsm_secret> [LEGACY - binary format only]\n"); |
| 49 | printf(" - dumpcommitments <node id> <channel dbid> <depth> " |
| 50 | "<path/to/hsm_secret>\n"); |
| 51 | printf(" - guesstoremote <P2WPKH address> <node id> <tries> " |
| 52 | "<path/to/hsm_secret>\n"); |
| 53 | printf(" - generatehsm <path/to/new/hsm_secret>\n"); |
| 54 | printf(" - derivetoremote <node id> <channel dbid> [<cmt pt>] " |
| 55 | "<path/to/hsm_secret>\n"); |
| 56 | printf(" - checkhsm <path/to/new/hsm_secret>\n"); |
| 57 | printf(" - dumponchaindescriptors [--show-secrets] <path/to/hsm_secret> [network]\n"); |
| 58 | printf(" - makerune <path/to/hsm_secret>\n"); |
| 59 | printf(" - getsecret <path/to/hsm_secret> [<id>]\n"); |
| 60 | printf(" - getemergencyrecover <path/to/emergency.recover>\n"); |
| 61 | printf(" - getnodeid <path/to/hsm_secret>\n"); |
| 62 | exit(0); |
| 63 | } |
| 64 | |
| 65 | static bool ensure_hsm_secret_exists(int fd, const char *path) |
| 66 | { |