fix: curio: Start BoostAdapters before blocking rpc serve (#11871)
* fix: curio: Start BoostAdapters before blocking rpc serve * curio/lmrpc: Override unspecified rpc address to localhost
This commit is contained in:
parent
11cdb27bbb
commit
ae15eb1922
@ -131,15 +131,15 @@ var runCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
defer taskEngine.GracefullyTerminate()
|
defer taskEngine.GracefullyTerminate()
|
||||||
|
|
||||||
|
if err := lmrpc.ServeCurioMarketRPCFromConfig(dependencies.DB, dependencies.Full, dependencies.Cfg); err != nil {
|
||||||
|
return xerrors.Errorf("starting market RPCs: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
err = rpc.ListenAndServe(ctx, dependencies, shutdownChan) // Monitor for shutdown.
|
err = rpc.ListenAndServe(ctx, dependencies, shutdownChan) // Monitor for shutdown.
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := lmrpc.ServeCurioMarketRPCFromConfig(dependencies.DB, dependencies.Full, dependencies.Cfg); err != nil {
|
|
||||||
return xerrors.Errorf("starting market RPCs: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
finishCh := node.MonitorShutdown(shutdownChan) //node.ShutdownHandler{Component: "rpc server", StopFunc: rpcStopper},
|
finishCh := node.MonitorShutdown(shutdownChan) //node.ShutdownHandler{Component: "rpc server", StopFunc: rpcStopper},
|
||||||
//node.ShutdownHandler{Component: "curio", StopFunc: stop},
|
//node.ShutdownHandler{Component: "curio", StopFunc: stop},
|
||||||
|
|
||||||
|
@ -68,9 +68,8 @@ func MakeTokens(cfg *config.CurioConfig) (map[address.Address]string, error) {
|
|||||||
return xerrors.Errorf("net resolve: %w", err)
|
return xerrors.Errorf("net resolve: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(laddr.IP) == 0 {
|
if len(laddr.IP) == 0 || laddr.IP.IsUnspecified() {
|
||||||
// set localhost
|
return xerrors.Errorf("market rpc server listen address must be a specific address, not %s (probably missing bind IP)", listen)
|
||||||
laddr.IP = net.IPv4(127, 0, 0, 1)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// need minimal provider with just the config
|
// need minimal provider with just the config
|
||||||
@ -171,9 +170,8 @@ func ServeCurioMarketRPC(db *harmonydb.DB, full api.FullNode, maddr address.Addr
|
|||||||
return xerrors.Errorf("net resolve: %w", err)
|
return xerrors.Errorf("net resolve: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(laddr.IP) == 0 {
|
if len(laddr.IP) == 0 || laddr.IP.IsUnspecified() {
|
||||||
// set localhost
|
return xerrors.Errorf("market rpc server listen address must be a specific address, not %s (probably missing bind IP)", listen)
|
||||||
laddr.IP = net.IPv4(127, 0, 0, 1)
|
|
||||||
}
|
}
|
||||||
rootUrl := url.URL{
|
rootUrl := url.URL{
|
||||||
Scheme: "http",
|
Scheme: "http",
|
||||||
|
Loading…
Reference in New Issue
Block a user