MCPcopy Create free account
hub / github.com/tendermint/tendermint / LoadNodeKey

Function LoadNodeKey

types/node_key.go:69–81  ·  view source on GitHub ↗

LoadNodeKey loads NodeKey located in filePath.

(filePath string)

Source from the content-addressed store, hash-verified

67
68// LoadNodeKey loads NodeKey located in filePath.
69func 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}

Callers 2

TestLoadNodeKeyFunction · 0.92
LoadOrGenNodeKeyFunction · 0.85

Calls 3

PubKeyMethod · 0.95
NodeIDFromPubKeyFunction · 0.85
UnmarshalMethod · 0.45

Tested by 1

TestLoadNodeKeyFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…