Skip to content

Commit

Permalink
fixed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
fengtality committed Apr 22, 2019
2 parents afb6f94 + d7bf0b8 commit 4e48c75
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/hummingbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
Coroutine
)

# This init_logging() call is important, to skip over the missing config
# warnings.
from hummingbot import init_logging; init_logging("hummingbot_logs.yml")

from hummingbot import init_logging
from hummingbot.cli.hummingbot_application import HummingbotApplication
from hummingbot.cli.settings import (
global_config_map,
Expand All @@ -53,6 +50,10 @@ def detect_available_port(starting_port: int) -> int:

async def main():
await create_yml_files()

# This init_logging() call is important, to skip over the missing config warnings.
init_logging("hummingbot_logs.yml")

read_configs_from_yml()

hb = HummingbotApplication()
Expand Down
Binary file added documentation/docs/assets/img/debug1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/docs/assets/img/debug2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/docs/assets/img/debug3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/docs/assets/img/debug4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/docs/assets/img/debug5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions documentation/docs/operation/debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
The debug console is a powerful tool for Hummingbot developers to inspect and modify the live states in Hummingbot while it's running. It gives access to a live Python console living in the same process as Hummingbot. It can be thought of as similar to the developer console found in most modern browsers.

## Activating the debug console

The debug console is disabled by default. You need to enable it by setting `debug_console: true` in `conf/conf_global.yml`.

![Enabling debug console in global config](/assets/img/debug1.png)

## Entering the debug console

When you start Hummingbot with debug console enabled, it will print out a "Started debug console" log message at start.

![Started debug console logm essage](/assets/img/debug2.png)

Note the port number printed in the debug message (port 8211 in the example above), you can use `telnet` or `nc` to access the debug console by connecting to the TCP port described in the log message.

![Entering the debug console](/assets/img/debug3.png)

## Accesing Python modules and exposed objects

Once you've entered the debug console, you have access to a fully featured Python interpreter living in the Hummingbot process.

You can access all the exposed properties under the `HummingbotApplication` class via the `hb` object.

Here are some of the exposed properties you can access from the debug console:

- `hb.strategy`: The currently active strategy object
- `hb.markets`: A dictionary of active market connectors
- `hb.acct`: The currently active Ethereum wallet object
- `hb.clock`: The clock object that's driving all the Hummingbot components

![Some exposed variables under 'hb'](/assets/img/debug4.png)

## Some examples

Below is an example where a developer queries the currently active bids/asks under the strategy, and the current best ask price on DDEX.

![Example](/assets/img/debug5.png)

You should refer to the source code of the exposed objects to see what properties you can inspect and modify inside the debug console.
1 change: 1 addition & 0 deletions documentation/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ nav:
- Running bots: operation/running-bots.md
- Logging: operation/logging.md
- Exchange rates: operation/exchange-rates.md
- Debug console: operation/debug.md
- Connectors:
- Connectors: connectors.md
- Binance: connectors/binance.md
Expand Down

0 comments on commit 4e48c75

Please sign in to comment.