diff --git a/server/cmd/blockmeta/logger.go b/server/cmd/blockmeta/logger.go deleted file mode 100644 index befbc30..0000000 --- a/server/cmd/blockmeta/logger.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import ( - "github.com/streamingfast/logging" -) - -var zlog, tracer = logging.RootLogger("blockmeta", "github.com/streamingfast/blockmeta-service/server/cmd/blockmeta") diff --git a/server/cmd/blockmeta/main.go b/server/cmd/blockmeta/main.go index 55a011f..4ad680a 100644 --- a/server/cmd/blockmeta/main.go +++ b/server/cmd/blockmeta/main.go @@ -8,24 +8,25 @@ import ( "github.com/streamingfast/blockmeta-service/server" "github.com/streamingfast/dauth" - authGrpc "github.com/streamingfast/dauth/grpc" authNull "github.com/streamingfast/dauth/null" "github.com/streamingfast/derr" + "github.com/streamingfast/logging" "go.uber.org/zap" ) var ( - listenAddress = flag.String("grpc-listen-addr", "", "The gRPC server listen address") - sinkServerAddress = flag.String("sink-addr", "", "The sink server address") + listenAddress = flag.String("grpc-listen-addr", ":9000*", "The gRPC server listen address") + sinkServerAddress = flag.String("sink-addr", ":9001", "The sink server address") authUrl = flag.String("auth-url", "null://", "The URL of the auth server") corsHostRegexAllowFlag = flag.String("cors-host-regex-allow", "^localhost", "Regex to allow CORS origin requests from, defaults to localhost only") ) +var zlog, tracer = logging.ApplicationLogger("blockmeta", "github.com/streamingfast/blockmeta-service/server/cmd/blockmeta") + func main() { flag.Parse() ctx := context.Background() - authGrpc.Register() authNull.Register() if *sinkServerAddress == "" { diff --git a/server/go.mod b/server/go.mod index c65b4e2..a830c90 100644 --- a/server/go.mod +++ b/server/go.mod @@ -7,7 +7,7 @@ require ( github.com/rs/cors v1.8.3 github.com/streamingfast/dauth v0.0.0-20240213192022-da4946165b42 github.com/streamingfast/derr v0.0.0-20230515163924-8570aaa43fe1 - github.com/streamingfast/dgrpc v0.0.0-20240213191930-14e90f32025f + github.com/streamingfast/dgrpc v0.0.0-20240214134727-3290b8959f76 github.com/streamingfast/logging v0.0.0-20221209193439-bff11742bf4c github.com/streamingfast/shutter v1.5.0 github.com/streamingfast/substreams-sink-kv v0.1.3-0.20240213164553-1d839b800880 diff --git a/server/go.sum b/server/go.sum index 94446ab..6d18848 100644 --- a/server/go.sum +++ b/server/go.sum @@ -148,8 +148,8 @@ github.com/streamingfast/dauth v0.0.0-20240213192022-da4946165b42 h1:rJ0uQ5xuGn9 github.com/streamingfast/dauth v0.0.0-20240213192022-da4946165b42/go.mod h1:cwfI5vaMd+CiwZIL0H0JdP5UDWCZOVFz/ex3L0+o/j4= github.com/streamingfast/derr v0.0.0-20230515163924-8570aaa43fe1 h1:xJB7rXnOHLesosMjfwWsEL2i/40mFSkzenEb3M0qTyM= github.com/streamingfast/derr v0.0.0-20230515163924-8570aaa43fe1/go.mod h1:QSm/AfaDsE0k1xBYi0lW580YJ/WDV/FKZI628tkZR0Y= -github.com/streamingfast/dgrpc v0.0.0-20240213191930-14e90f32025f h1:KFXHHIx0lAMLOn/hnyOcMURUyxfQHgyVA3CbJoQgfi8= -github.com/streamingfast/dgrpc v0.0.0-20240213191930-14e90f32025f/go.mod h1:NuKCwOHjbT0nRji0O+7+c70AiBfLHEKNoovs/gFfMPY= +github.com/streamingfast/dgrpc v0.0.0-20240214134727-3290b8959f76 h1:g12+wDmubRwQD9R7MqjVE1Xaj61pJqz7qOGovoAy6GU= +github.com/streamingfast/dgrpc v0.0.0-20240214134727-3290b8959f76/go.mod h1:NuKCwOHjbT0nRji0O+7+c70AiBfLHEKNoovs/gFfMPY= github.com/streamingfast/dtracing v0.0.0-20210811175635-d55665d3622a h1:/7Rw3pYpueJYOQReTJpfAhAPk0uZD4I58LfiUAr4IMc= github.com/streamingfast/dtracing v0.0.0-20210811175635-d55665d3622a/go.mod h1:bqiYZaX6L/MoXNfFQeAdau6g9HLA3yKHkX8KzStt58Q= github.com/streamingfast/logging v0.0.0-20220304214715-bc750a74b424/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= diff --git a/server/server.go b/server/server.go index f561574..da5b45e 100644 --- a/server/server.go +++ b/server/server.go @@ -71,8 +71,8 @@ func (s *GrpcServer) Run(ctx context.Context) { streamHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { return pbbmsrvconnect.NewBlockHandler(s, opts...) - } + srv := connectweb.New([]connectweb.HandlerGetter{streamHandlerGetter}, options...) addr := strings.ReplaceAll(s.httpListenAddr, "*", "") @@ -141,6 +141,7 @@ func (s *GrpcServer) allowedOrigin(origin string) bool { } func (s *GrpcServer) healthCheck() dgrpcserver.HealthCheck { + s.logger.Debug("health checking") return func(ctx context.Context) (isReady bool, out interface{}, err error) { if derr.IsShuttingDown() { return false, nil, nil