Skip to main content
This document is the entry point for developers who wish to work on the Parallax client. Developers are people who are interested to build, develop, debug, submit a bug report or pull request or otherwise contribute to the Parallax client source code. Please see Contributing for the Parallax client contribution guidelines.

Building and Testing

Developers should use a recent version of Go for building and testing. We use the go toolchain for development, which you can get from the Go downloads page. The Parallax client is a Go module, and uses the Go modules system to manage dependencies. Using GOPATH is not required to build the Parallax client.

Building Executables

Switch to the parallax repository root directory. All code can be built using the go tool, placing the resulting binary in $GOPATH/bin.
The Parallax executables can be built individually. To build just the Parallax client, use:
Cross compilation is not recommended, please build the Parallax client for the host architecture.

Testing

Testing a package:
Running an individual test:
Note: here all tests with prefix TestMethod will be run, so if TestMethod and TestMethod1 both exist then both tests will run.
Running benchmarks, eg.:
For more information, see the go test flags documentation.

Getting Stack Traces

A stack trace provides a very detailed look into the current state of the Parallax node. It helps us to debug issues easier as it contains information about what is currently done by the node. Stack traces can be created by running debug.stacks() in the Parallax client console. If the node was started without the console command or with a script in the background, the following command can be used to dump the stack trace into a file.
The Parallax client logs the location of the IPC endpoint on startup. It is typically under /home/user/.parallax/prlx.ipc or /tmp/prlx.ipc. debug.stacks() also takes an optional filter argument. Passing a package name or filepath to filter restricts the output to stack traces involving only that package/file. For example:
returns data that looks like:
and
returns data that looks like:
If the Parallax client is started with the --pprof option, a debugging HTTP server is made available on port 6060. Navigating to http://localhost:6060/debug/pprof displays the heap, running routines etc. By clicking “full goroutine stack dump” a trace can be generated that is useful for debugging. Note that if multiple instances of the Parallax client exist, port 6060 will only work for the first instance that was launched. To generate stacktraces for other instances, they should be started up with alternative pprof ports. Ensure stderr is being redirected to a logfile.
Alternatively to kill the clients (in case they hang or stalled syncing, etc) and have the stacktrace too, use the -QUIT signal with kill:
This will dump stack traces for each instance to their respective log file.

Where to go next

Read the remaining pages in the Parallax client developer section, and get building!