Commit 49fcee02 authored by Axel Kingsley's avatar Axel Kingsley Committed by GitHub

Directly Register APIs in RPC Server (#13454)

parent fe1d6849
...@@ -166,8 +166,12 @@ func (b *Server) AddAPI(api rpc.API) { ...@@ -166,8 +166,12 @@ func (b *Server) AddAPI(api rpc.API) {
func (b *Server) Start() error { func (b *Server) Start() error {
srv := rpc.NewServer() 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 // rpc middleware
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment