diff --git a/protocol/daemons/bridge/client/client.go b/protocol/daemons/bridge/client/client.go index da16747809..2292b33903 100644 --- a/protocol/daemons/bridge/client/client.go +++ b/protocol/daemons/bridge/client/client.go @@ -12,7 +12,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/daemons/bridge/api" "github.com/dydxprotocol/v4-chain/protocol/daemons/bridge/client/types" "github.com/dydxprotocol/v4-chain/protocol/daemons/constants" - "github.com/dydxprotocol/v4-chain/protocol/daemons/flags" + daemonflags "github.com/dydxprotocol/v4-chain/protocol/daemons/flags" daemontypes "github.com/dydxprotocol/v4-chain/protocol/daemons/types" libeth "github.com/dydxprotocol/v4-chain/protocol/lib/eth" "github.com/dydxprotocol/v4-chain/protocol/lib/metrics" @@ -26,7 +26,7 @@ import ( // Start begins a job that periodically runs the RunBridgeDaemonTaskLoop function. func Start( ctx context.Context, - flags flags.DaemonFlags, + flags daemonflags.DaemonFlags, appFlags appflags.Flags, logger log.Logger, grpcClient daemontypes.GrpcClient, @@ -36,6 +36,10 @@ func Start( "Starting bridge daemon with flags", "BridgeFlags", flags.Bridge, ) + // Panic if EthRpcEndpoint is empty. + if flags.Bridge.EthRpcEndpoint == "" { + return fmt.Errorf("flag %s is not set", daemonflags.FlagBridgeDaemonEthRpcEndpoint) + } // Make a connection to the Cosmos gRPC query services. queryConn, err := grpcClient.NewTcpConnection(ctx, appFlags.GrpcAddress) diff --git a/protocol/daemons/flags/flags.go b/protocol/daemons/flags/flags.go index c49a4a050c..eebdf7e631 100644 --- a/protocol/daemons/flags/flags.go +++ b/protocol/daemons/flags/flags.go @@ -129,10 +129,6 @@ func AddDaemonFlagsToCmd( df.Bridge.EthRpcEndpoint, "Ethereum Node Rpc Endpoint", ) - // Require bridge daemon eth RPC endpoint flag. - if err := cmd.MarkFlagRequired(FlagBridgeDaemonEthRpcEndpoint); err != nil { - panic(err) - } // Liquidation Daemon. cmd.Flags().Bool(