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 ¶
GeneratePersistedFileKey generates a new random FileKey persisted to disk.
func LoadFileKey ¶
LoadFileKey reads a FileKey from the given file path.
func LoadOrMakeFileKey ¶
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) PubKey ¶
func (fs *LocalSigner) PubKey() crypto.PubKey
PubKey implements types.Signer.