mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Fix IPC Paths For Windows (#11324)
* return early for windows * mick's review
This commit is contained in:
@@ -113,7 +113,7 @@ func (s *Service) newRPCClientWithAuth(ctx context.Context, endpoint network.End
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
case "":
|
||||
case "", "ipc":
|
||||
client, err = gethRPC.DialIPC(ctx, endpoint.Url)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -188,6 +188,9 @@ func main() {
|
||||
if err := cmd.ExpandSingleEndpointIfFile(ctx, flags.ExecutionEngineEndpoint); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := cmd.ExpandSingleEndpointIfFile(ctx, flags.HTTPWeb3ProviderFlag); err != nil {
|
||||
return err
|
||||
}
|
||||
if ctx.IsSet(flags.SetGCPercent.Name) {
|
||||
runtimeDebug.SetGCPercent(ctx.Int(flags.SetGCPercent.Name))
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
@@ -73,12 +74,17 @@ func EnterPassword(confirmPassword bool, pr PasswordReader) (string, error) {
|
||||
return passphrase, nil
|
||||
}
|
||||
|
||||
// ExpandSingleEndpointIfFile expands the path for --http-web3provider if specified as a file.
|
||||
// ExpandSingleEndpointIfFile expands the path for --execution-provider if specified as a file.
|
||||
func ExpandSingleEndpointIfFile(ctx *cli.Context, flag *cli.StringFlag) error {
|
||||
// Return early if no flag value is set.
|
||||
if !ctx.IsSet(flag.Name) {
|
||||
return nil
|
||||
}
|
||||
// Return early for non-unix operating systems, as there is
|
||||
// no shell path expansion for ipc endpoints on windows.
|
||||
if runtime.GOOS == "windows" {
|
||||
return nil
|
||||
}
|
||||
web3endpoint := ctx.String(flag.Name)
|
||||
switch {
|
||||
case strings.HasPrefix(web3endpoint, "http://"):
|
||||
|
||||
Reference in New Issue
Block a user