Skip to content

Commit

Permalink
fix: op-node maybe is nil,modify some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
eric committed Aug 1, 2023
1 parent 02e0dd5 commit 63aa589
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion op-node/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func RollupNodeMain(ctx *cli.Context) error {
if err != nil {
log.Error("Unable to create the rollup node", "error", err)
stateFile := ctx.String(flags.RPCAdminPersistence.Name)
if stateFile == "" {
if stateFile != "" {
//Modify admin_status does not depend on other business
log.Info("start abnormal_api because create the rollup node error ")
if err := n.InitAbnormalRPCServer(context.Background(), cfg); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion op-node/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var (
Usage: "Enable the admin API (experimental)",
EnvVar: prefixEnvVar("RPC_ENABLE_ADMIN"),
}
RPCAdminPersistence = &cli.StringFlag{
RPCAdminPersistence = cli.StringFlag{
Name: "rpc.admin-state",
Usage: "File path used to persist state changes made via the admin API so they persist across restarts. Disabled if not set.",
EnvVar: prefixEnvVar("RPC_ADMIN_STATE"),
Expand Down
6 changes: 3 additions & 3 deletions op-node/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func New(ctx context.Context, cfg *Config, log log.Logger, snapshotLog log.Logge
if closeErr := n.Close(); closeErr != nil {
return nil, multierror.Append(err, closeErr)
}
return nil, err
return n, err
}
return n, nil
}
Expand Down Expand Up @@ -249,9 +249,9 @@ func (n *OpNode) InitAbnormalRPCServer(ctx context.Context, cfg *Config) error {
server.EnableAbnormalAPI(NewAbnormalAPI(cfg.ConfigPersistence))
n.log.Info("Admin RPC enabled")
}
n.log.Info("Starting JSON-RPC server")
n.log.Info("Starting abnormal JSON-RPC server")
if err := server.Start(); err != nil {
return fmt.Errorf("unable to start RPC server: %w", err)
return fmt.Errorf("unable to start abnormal RPC server: %w", err)
}
n.server = server
return nil
Expand Down
1 change: 1 addition & 0 deletions ops-bedrock/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ services:
--rollup.config=/rollup.json
--rpc.addr=0.0.0.0
--rpc.port=8545
--rpc.admin-state=/op_log/admin-state.log
--p2p.listen.ip=0.0.0.0
--p2p.listen.tcp=9003
--p2p.listen.udp=9003
Expand Down

0 comments on commit 63aa589

Please sign in to comment.