localkey

package
v1.21.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package localkey provides functions to load keys from ~/.lux/keys at runtime. Keys are NEVER embedded in code - they must exist on disk or be generated.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoKeysFound = errors.New("no keys found in ~/.lux/keys - please generate keys first")
)

Functions

func ClearCache

func ClearCache()

ClearCache clears the cached key, forcing a reload on next GetLocalKey call.

func GetLocalKey

func GetLocalKey() (*secp256k1.PrivateKey, error)

GetLocalKey returns the first key from ~/.lux/keys for local network operations. Keys are loaded from disk at runtime, never embedded in code. The key is cached after first load.

func MustGetLocalKey

func MustGetLocalKey() *secp256k1.PrivateKey

MustGetLocalKey returns the local key or panics if not found. Use this only in contexts where key availability is guaranteed.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL