Skip to main content

stage_node_key

Function stage_node_key 

Source
pub fn stage_node_key(data_dir: &Path) -> Result<StagedNodeKey>
Expand description

Generate a fresh node key and write it to a temp file in data_dir (mode 0o600 on Unix) without touching node.secret. Validates or securely creates data_dir with the same 0o700 semantics as load_or_create.

The returned StagedNodeKey is committed via StagedNodeKey::commit. This is the staged counterpart of load_or_create’s generate path, used by decdn key-gen so the node key and the eth keystore are both generated before either canonical file is replaced (#844).

§Errors

Returns an error if data_dir cannot be validated or created, or if writing the temp file fails.