REST VC: Subscribe to Beacon API events (#13453)

* Revert "Revert "REST VC: Subscribe to Beacon API events  (#13354)" (#13428)"

This reverts commit 8d092a1113.

* change logic

* review

* test fix

* fix critical error

* merge flag check

* change error msg

* return on errors

---------

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
Radosław Kapka
2024-01-18 15:27:41 +01:00
committed by GitHub
parent f3ef1b64d6
commit 204de13c86
32 changed files with 503 additions and 84 deletions

View File

@@ -43,6 +43,7 @@ go_library(
"//validator:__subpackages__",
],
deps = [
"//api:go_default_library",
"//api/gateway:go_default_library",
"//api/server:go_default_library",
"//async/event:go_default_library",

View File

@@ -26,6 +26,7 @@ import (
gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/pkg/errors"
fastssz "github.com/prysmaticlabs/fastssz"
"github.com/prysmaticlabs/prysm/v4/api"
"github.com/prysmaticlabs/prysm/v4/api/gateway"
"github.com/prysmaticlabs/prysm/v4/api/server"
"github.com/prysmaticlabs/prysm/v4/async/event"
@@ -865,7 +866,7 @@ func (c *ValidatorClient) registerRPCGatewayService(router *mux.Router) error {
},
}),
gwruntime.WithMarshalerOption(
"text/event-stream", &gwruntime.EventSourceJSONPb{}, // TODO: remove this
api.EventStreamMediaType, &gwruntime.EventSourceJSONPb{}, // TODO: remove this
),
gwruntime.WithForwardResponseOption(gateway.HttpResponseModifier),
)