LoadNodeKey loads NodeKey located in filePath.
(filePath string)
| 67 | |
| 68 | // LoadNodeKey loads NodeKey located in filePath. |
| 69 | func LoadNodeKey(filePath string) (NodeKey, error) { |
| 70 | jsonBytes, err := ioutil.ReadFile(filePath) |
| 71 | if err != nil { |
| 72 | return NodeKey{}, err |
| 73 | } |
| 74 | nodeKey := NodeKey{} |
| 75 | err = tmjson.Unmarshal(jsonBytes, &nodeKey) |
| 76 | if err != nil { |
| 77 | return NodeKey{}, err |
| 78 | } |
| 79 | nodeKey.ID = NodeIDFromPubKey(nodeKey.PubKey()) |
| 80 | return nodeKey, nil |
| 81 | } |
searching dependent graphs…