Binary numbers under magnifying glass

To debug a SubQuery project, the –inspect flag of the node command needs to be used.

The command is:

node --inspect-brk <path to subql-node> -f <path to subQuery project>

Eg:

node --inspect-brk /usr/local/bin/subql-node -f ~/Code/subQuery/projects/subql-helloworld/

This enables the node inspector. Note the small difference between –inspect and –inspect-brk. Then open up the Developer Tools in Chrome and you should see a green icon appear.

Clicking on the green icon will open up the DevTools.

From here, navigate to the “Filesystem” and add your project folder to the workspace. Then you can add breakpoints and step through your code just like any regular debugger.

Leave a Reply

Your email address will not be published. Required fields are marked *