MCPcopy Create free account
hub / github.com/DOSNetwork/core / getkey

Function getkey

main.go:82–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80}
81
82func getkey() (key *keystore.Key, err error) {
83 //Check if there is a keystore
84 password := ""
85 key, err = onchain.ReadEthKey(dosPath, password)
86 if err != nil && err.Error() == "No Account" {
87 return
88 }
89 //Get password from env variable
90 password = os.Getenv("PASSPHRASE")
91 if len(password) == 0 {
92 //Get password from terminal
93 password = getPassword("Enter password :")
94 }
95 key, err = onchain.ReadEthKey(dosPath, password)
96
97 return
98}
99
100func getPassword(s string) (p string) {
101 fmt.Print(s)

Callers

nothing calls this directly

Calls 2

getPasswordFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected