local

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2025 License: Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileKey

type FileKey struct {
	PrivKey crypto.PrivKey `json:"priv_key" comment:"the validator private key"`
	PubKey  crypto.PubKey  `json:"pub_key" comment:"the validator public key"`
	Address types.Address  `json:"address" comment:"the validator address"`
}

FileKey is a struct that contains the private key, public key, and address of a FileSigner. It is persisted to disk in JSON format using amino. NOTE: keep in sync with gno.land/cmd/gnoland/secrets.go

func GenerateFileKey

func GenerateFileKey() *FileKey

GenerateFileKey generates a new random FileKey.

func GeneratePersistedFileKey

func GeneratePersistedFileKey(filePath string) (*FileKey, error)

GeneratePersistedFileKey generates a new random FileKey persisted to disk.

func LoadFileKey

func LoadFileKey(filePath string) (*FileKey, error)

LoadFileKey reads a FileKey from the given file path.

func LoadOrMakeFileKey

func LoadOrMakeFileKey(filePath string) (*FileKey, error)

LoadOrMakeFileKey returns a new FileKey instance from the given file path. If the file does not exist, a new FileKey is generated and persisted to disk.

type LocalSigner

type LocalSigner struct {
	// contains filtered or unexported fields
}

LocalSigner implements types.Signer using a FileKey persisted to disk.

func LoadOrMakeLocalSigner

func LoadOrMakeLocalSigner(filePath string) (*LocalSigner, error)

LoadOrMakeLocalSigner returns a new LocalSigner instance using a file key from the given file path. If the file does not exist, a new random FileKey is generated and persisted to disk.

func (*LocalSigner) Close

func (fs *LocalSigner) Close() error

Close implements types.Signer.

func (*LocalSigner) PubKey

func (fs *LocalSigner) PubKey() crypto.PubKey

PubKey implements types.Signer.

func (*LocalSigner) Sign

func (fs *LocalSigner) Sign(signBytes []byte) ([]byte, error)

Sign implements types.Signer.

func (*LocalSigner) String

func (fs *LocalSigner) String() string

String implements fmt.Stringer.

Jump to

Keyboard shortcuts

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