SaveAs persists the NodeKey to filePath.
(filePath string)
| 84 | |
| 85 | // SaveAs persists the NodeKey to filePath. |
| 86 | func (nodeKey *NodeKey) SaveAs(filePath string) error { |
| 87 | jsonBytes, err := tmjson.Marshal(nodeKey) |
| 88 | if err != nil { |
| 89 | return err |
| 90 | } |
| 91 | err = os.WriteFile(filePath, jsonBytes, 0o600) |
| 92 | if err != nil { |
| 93 | return err |
| 94 | } |
| 95 | return nil |
| 96 | } |
| 97 | |
| 98 | //------------------------------------------------------------------------------ |
| 99 |