Skip to content

Commit

Permalink
docs: add debug mode doc
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-vagabond committed Apr 29, 2024
1 parent e0d83ac commit cb1627e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
8 changes: 8 additions & 0 deletions scripts/upgrade-assure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,11 @@ Run the following command to start the nodes manually:
```bash
go run ./scripts/upgrade-assure/... /tmp/snapshot.tar.lz4 ~/go/bin/elysd ~/go/bin/elysd --only-start-with-new-binary
```

**Debug Mode**

By default the nodes run in `info` mode. To enable debug mode, add the following flag to the command:

```bash
LOG_LEVEL=debug go run ./scripts/upgrade-assure/... /tmp/snapshot.tar.lz4 ~/go/bin/elysd ~/go/bin/elysd --only-start-with-new-binary
```
8 changes: 7 additions & 1 deletion scripts/upgrade-assure/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ func (cw PromptWriter) Write(data []byte) (int, error) {
}

func start(cmdPath, homePath, rpc, p2p, pprof, api, moniker, successColor, errorColor string) *exec.Cmd {
// Set the log level
logLevel := "info"
if os.Getenv("LOG_LEVEL") != "" {
logLevel = os.Getenv("LOG_LEVEL")
}

// Command and arguments
args := []string{"start", "--home", homePath, "--rpc.laddr", rpc, "--p2p.laddr", p2p, "--rpc.pprof_laddr", pprof, "--api.address", api}
args := []string{"start", "--home", homePath, "--rpc.laddr", rpc, "--p2p.laddr", p2p, "--rpc.pprof_laddr", pprof, "--api.address", api, "--log_level", logLevel}

// Set up the command
cmd := exec.Command(cmdPath, args...)
Expand Down
4 changes: 2 additions & 2 deletions x/epochs/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ func (k Keeper) BeginBlocker(ctx sdk.Context) {
case shouldInitialEpochStart:
epochInfo.StartInitialEpoch()

logger.Info("starting epoch", "identifier", epochInfo.Identifier)
logger.Debug("starting epoch", "identifier", epochInfo.Identifier)
case shouldEpochEnd:
epochInfo.EndEpoch()

logger.Info("ending epoch", "identifier", epochInfo.Identifier)
logger.Debug("ending epoch", "identifier", epochInfo.Identifier)

ctx.EventManager().EmitEvent(
sdk.NewEvent(
Expand Down
3 changes: 0 additions & 3 deletions x/leveragelp/keeper/position_close.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ func (k Keeper) ForceCloseLong(ctx sdk.Context, position types.Position, pool ty
}

repayAmount := debt.Borrowed.Add(debt.InterestStacked).Sub(debt.InterestPaid).Mul(lpAmount).Quo(position.LeveragedLpAmount)
if err != nil {
return sdk.ZeroInt(), err
}

err = k.stableKeeper.Repay(ctx, position.GetPositionAddress(), sdk.NewCoin(position.Collateral.Denom, repayAmount))
if err != nil {
Expand Down

0 comments on commit cb1627e

Please sign in to comment.