mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Fix Web UI Integration With Prysm Beta (#7591)
* fix change password endpoint * attempt same port as gateway * update site to latest release * final fixes * rem gorilla mux * gaz fix * gaz fix * fmt * fix build * fix flags
This commit is contained in:
@@ -53,7 +53,7 @@ func (s *Server) Signup(ctx context.Context, req *pb.AuthRequest) (*pb.AuthRespo
|
||||
return nil, status.Error(codes.FailedPrecondition, "Could not check if wallet directory exists")
|
||||
}
|
||||
if !hasDir {
|
||||
if err := os.MkdirAll(walletDir, params.BeaconIoConfig().ReadWritePermissions); err != nil {
|
||||
if err := os.MkdirAll(walletDir, os.ModePerm); err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "could not write directory %s to disk: %v", walletDir, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ go_library(
|
||||
visibility = ["//validator:__subpackages__"],
|
||||
deps = [
|
||||
"//proto/validator/accounts/v2:ethereum_validator_account_gateway_proto",
|
||||
"//validator/web:go_default_library",
|
||||
"@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library",
|
||||
"@com_github_rs_cors//:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
|
||||
@@ -3,9 +3,11 @@ package gateway
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
pb "github.com/prysmaticlabs/prysm/proto/validator/accounts/v2_gateway"
|
||||
"github.com/prysmaticlabs/prysm/validator/web"
|
||||
"github.com/rs/cors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc"
|
||||
@@ -66,7 +68,14 @@ func (g *Gateway) Start() {
|
||||
log.Fatalf("Could not register API handler with grpc endpoint: %v", err)
|
||||
}
|
||||
}
|
||||
g.mux.Handle("/", g.corsMiddleware(gwmux))
|
||||
apiHandler := g.corsMiddleware(gwmux)
|
||||
g.mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.HasPrefix(r.URL.Path, "/api") {
|
||||
http.StripPrefix("/api", apiHandler).ServeHTTP(w, r)
|
||||
} else {
|
||||
web.Handler(w, r)
|
||||
}
|
||||
})
|
||||
g.server = &http.Server{
|
||||
Addr: g.gatewayAddr,
|
||||
Handler: g.mux,
|
||||
|
||||
@@ -44,6 +44,8 @@ type Config struct {
|
||||
GenesisFetcher client.GenesisFetcher
|
||||
WalletInitializedFeed *event.Feed
|
||||
NodeGatewayEndpoint string
|
||||
Wallet *wallet.Wallet
|
||||
Keymanager keymanager.IKeymanager
|
||||
}
|
||||
|
||||
// Server defining a gRPC server for the remote signer API.
|
||||
@@ -86,7 +88,9 @@ func NewServer(ctx context.Context, cfg *Config) *Server {
|
||||
genesisFetcher: cfg.GenesisFetcher,
|
||||
walletDir: cfg.WalletDir,
|
||||
walletInitializedFeed: cfg.WalletInitializedFeed,
|
||||
walletInitialized: false,
|
||||
walletInitialized: cfg.Wallet != nil,
|
||||
wallet: cfg.Wallet,
|
||||
keymanager: cfg.Keymanager,
|
||||
nodeGatewayEndpoint: cfg.NodeGatewayEndpoint,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user