aeternity / aepp-cli-js

Command line interface for the æternity blockchain
http://docs.aeternity.com/aepp-cli-js/
ISC License
7 stars 6 forks source link

introduce debug option #166

Open marc0olo opened 3 years ago

marc0olo commented 3 years ago

this is a feature request of Dincho as following command he used somehow got in stuck and he has no idea where:

➜  aepp-calldata-js git:(test_utils) ✗ aecli contract deploy --json -P $WALLET_PASS --networkId ae_uat $WALLET_PATH contracts/Test.aes "cb_KxFE1kQfP4oEp9E="
davidyuk commented 2 years ago

somehow got in stuck

aecli should not behave like this, we need a reproduction to fix this.

introduce debug option

I think it is too early to cover cli with an obvious console.logs enableable by a flag. Also, the issue may be in sdk, so console.logs would be needed there as well. I assume these logs need for cli developers to easily understand a possible bug, but as a cli developer, I don't need them yet.

I've tried to use integrated debugging capability of node and it looks not difficult to work with:

  1. $ node --inspect ./bin/aecli-chain.js status
  2. open chrome://inspect in Chrome and press 'inspect' for bin/aecli-chain.js in remote targets
  3. add bin folder in 'Sources' tab
  4. now you can add breakpoints (control script execution) and check variable values
davidyuk commented 8 months ago

depends on https://github.com/aeternity/aepp-sdk-js/issues/1966