mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 20:37:17 +00:00
Windows friendly stdin reads for passwords (#5010)
* cast os.stdin filehandle since on windows syscall.Stdin is not int * import ordering * Merge branch 'master' into prysm-5008-windows-stdin-not-int
This commit is contained in:
parent
e635e5b205
commit
5961aaf588
@ -7,7 +7,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
contract "github.com/prysmaticlabs/prysm/contracts/deposit-contract"
|
contract "github.com/prysmaticlabs/prysm/contracts/deposit-contract"
|
||||||
@ -136,7 +135,7 @@ func CreateValidatorAccount(path string, passphrase string) (string, string, err
|
|||||||
reader := bufio.NewReader(os.Stdin)
|
reader := bufio.NewReader(os.Stdin)
|
||||||
log.Info("Create a new validator account for eth2")
|
log.Info("Create a new validator account for eth2")
|
||||||
log.Info("Enter a password:")
|
log.Info("Enter a password:")
|
||||||
bytePassword, err := terminal.ReadPassword(syscall.Stdin)
|
bytePassword, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Could not read account password: %v", err)
|
log.Fatalf("Could not read account password: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
|
||||||
|
|
||||||
"github.com/prysmaticlabs/prysm/shared/bls"
|
"github.com/prysmaticlabs/prysm/shared/bls"
|
||||||
"github.com/prysmaticlabs/prysm/shared/bytesutil"
|
"github.com/prysmaticlabs/prysm/shared/bytesutil"
|
||||||
@ -63,7 +62,7 @@ func NewKeystore(input string) (KeyManager, string, error) {
|
|||||||
} else {
|
} else {
|
||||||
if opts.Passphrase == "" {
|
if opts.Passphrase == "" {
|
||||||
log.Info("Enter your validator account password:")
|
log.Info("Enter your validator account password:")
|
||||||
bytePassword, err := terminal.ReadPassword(syscall.Stdin)
|
bytePassword, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, keystoreOptsHelp, err
|
return nil, keystoreOptsHelp, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user