Documentation
¶
Index ¶
Constants ¶
View Source
const (
NodeKeyFileName = "node_key.json"
)
Variables ¶
This section is empty.
Functions ¶
func PubKeyToID ¶
PubKeyToID returns the ID corresponding to the given PubKey. It's the hex-encoding of the pubKey.Address().
Types ¶
type NodeKey ¶
NodeKey is the persistent peer key. It contains the nodes private key for authentication.
func GenerateNodeKey ¶
GenerateNodeKey generates a new NodeKey
func LoadNodeKey ¶
LoadNodeKey loads NodeKey located in dirPath/node_key.json.
func LoadOrGenNodeKey ¶
LoadOrGenNodeKey attempts to load the NodeKey from the given directory path. If the file node_key.json does not exist in that directory, it generates and saves a new NodeKey there.
func (*NodeKey) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*NodeKey) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
Click to show internal directories.
Click to hide internal directories.