Links

Contribute

To get started building on Quai Network, visit https://github.com/spruce-solutions/go-quai and follow the README instructions.

Debugging Information

Debugging go-quai is useful when there are specific events occurring within the codebase that need to be checked.

Steps to start debugging

  • Open VSCode and navigate to the debug panel on the left-hand side.
  • Click on the highlighted text to create launch.json file.
  • Copy and paste the below launch.json to run a Zone node.

Example launch.json

{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Prime",
"type": "go",
"request": "launch",
"mode": "exec",
"program": "${workspaceRoot}/build/bin/quai",
"env": {},
"args": [
"--ws",
"--http",
"--mine",
"--miner.threads=4",
"--miner.etherbase",
"0x00114a47a5d39ea2022dd4d864cb62cfd16879fc",
"--syncmode",
"full",
"--http.port",
"8546",
"--ws.port",
"8547",
"--port",
"30303",
"--allow-insecure-unlock",
"--verbosity",
"4",
],
"showLog": true,
},
]
}
  • Run make debug within the go-quai folder to create an executable that contains the proper compiler flags -gcflags=all="-N -l"
  • Navigate back to the VSCode debug panel which should look similar to this.
  • Click on the green arrow in the top left of the debug panel to launch the build executable and start your debugging session. You can set breakpoints and specify variables throughout the codebase.
For more information on debugging via VSCode visit the VSCode documentation.