Skip to content

Commit

Permalink
Directly Register APIs in RPC Server (#13454)
Browse files Browse the repository at this point in the history
  • Loading branch information
axelKingsley authored Dec 18, 2024
1 parent fe1d684 commit 49fcee0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions op-service/rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,12 @@ func (b *Server) AddAPI(api rpc.API) {

func (b *Server) Start() error {
srv := rpc.NewServer()
if err := node.RegisterApis(b.apis, nil, srv); err != nil {
return fmt.Errorf("error registering APIs: %w", err)

for _, api := range b.apis {
if err := srv.RegisterName(api.Namespace, api.Service); err != nil {
return fmt.Errorf("failed to register API %s: %w", api.Namespace, err)
}
b.log.Info("registered API", "namespace", api.Namespace)
}

// rpc middleware
Expand Down

0 comments on commit 49fcee0

Please sign in to comment.