Comment on page

Run a Stratum Proxy


Here, we'll be installing go-quai-stratum, the Go implementation of the stratum proxy on Quai Network. This tutorial is focused for Linux Distributions and MacOS systems.
Running go-quai-stratum on Windows or WSL2 is not currently supported.
Prefer a video tutorial? Check out a video walkthrough on setting up a stratum proxy here:

Common Troubleshooting Resources

Environment Setup

For the simplest installation process, we recommend installing and running go-quai-stratum on the same computer that you're running go-quai. Running go-quai-stratum on a separate computer is for advanced users as it requires additional networking configuration.

Install Dependencies

To run an instance of go-quai-stratum, you'll need to install a few dependencies. You can install dependencies with your favorite package manager (apt, brew, etc.).
If you've already installed go-quai, you already have all the necessary dependencies to run go-quai-stratum.

Go v1.21.0+

Snap Install (snapd is not installed by default on all Linux Distros):
# install snapd if you don't have it already
sudo apt install snapd
# install go
sudo snap install go --classic
MacOS Install:
brew install go
If you're not on Ubuntu or MacOS, instructions on how to install go directly can be found on the golang installation page.

Git & Make

Linux install:
sudo apt install git make
MacOS install:
brew install git make

Install go-quai-stratum

Now that you've installed the base dependencies, we can go ahead and clone the go-quai-stratum repo.
To clone the go-quai-stratum repo and navigate to it, run the following commands:
git clone
cd go-quai-stratum
This command installs the main branch to your local machine. Unless you intend to develop, you must checkout the latest release.
You can find the latest release on the go-quai-stratum releases page. Then, check out the latest release with:
git checkout put-latest-release-here
For example (this not the latest release, check the releases page for the latest release number)
git checkout v01.2.3-rc.4


To run the Quai stratum proxy, you'll need to do some minor configuration. Start by copying the example configuration file to a local configuration file.
cp config/config.example.json config/config.json
Within the config.json file, you'll be able to configure networking settings and other relevant variables.

Running the Proxy


Before running the proxy, we need to build the source. You can build via Makefile by running the following command:
make quai-stratum


Now that we've built the source, we can start our proxy We recommend using a process manager like tmux or screen to run the proxy.
To run the proxy, you'll need to select a shard to run against. More information on how and why to select shards can be found in our FAQ.
Start the proxy by passing either the corresponding web socket ports or chain names for the region and zone you've selected to run. Run with chain names using this command:
./build/bin/quai-stratum --region=REGION-NAME --zone=ZONE-NAME
Or to run with ports use:
./build/bin/quai-stratum --region=REGION-WS-PORT --zone=ZONE-WS-PORT
Running the proxy will only work for chains your node is validating state for. Global nodes validate state for all chains, whereas slice nodes only validate state for the chains you specify.
Available options for REGION-NAME, ZONE-NAME, REGION-PORT, and ZONE-PORT can be found below. You must select a corresponding region and zone, i.e. paxos and paxos3 or hydra and hydra2.
If you're running a version of go-quai-stratum prior to v0.9.0-rc.0, you'll need to pass in the corresponding web socket ports as chain names are not supported prior to this version.
Chain Index
Web Socket Port
[0 0]
[0 1]
[0 2]
[1 0]
[1 1]
[1 2]
[2 0]
[2 1]
[2 2]
Do not open the above web socket ports except in the specific case where your miner is on a different network than your node/stratum (and even then, be sure to only open the port to the necessary machine). You may be putting your local network security at risk.
The proxy by default listens for miner connections on the 3333 port. You can change the port the proxy listens on by passing it in with the --stratum flag in the run command if you'd like.
./build/bin/quai-stratum --region=REGION-NAME --zone=ZONE-NAME --stratum=LISTENING-PORT
Changing the proxy listening port is useful for running multiple proxies on a single full node. If you're only mining on a single shard, there is no need to change the listening port.
The proxy should begin streaming logs to the terminal that look similar to below.
WARN[0000] One ethash cache must always be in memory requested=0
2023/09/06 13:47:17 main.go:45: Loading config: 0x14000032970
2023/09/06 13:47:17 main.go:84: Running with 4 threads
2023/09/06 13:47:17 policy.go:80: Set policy stats reset every 1h0m0s
2023/09/06 13:47:17 policy.go:84: Set policy state refresh every 1m0s
2023/09/06 13:47:17 policy.go:100: Running with 8 policy workers
WARN[0000] One ethash cache must always be in memory requested=0
2023/09/06 13:47:17 proxy.go:104: Set block refresh every 120ms
2023/09/06 13:47:17 stratum.go:38: Stratum listening on
2023/09/06 13:47:17 proxy.go:294: New block to mine on Zone at height [1 1 1]
2023/09/06 13:47:17 proxy.go:295: Sealhash: 0xc4a31a763af09272a5da7f237978f5e0ead1e409c1e19a034ff8e40e7d727561
2023/09/06 13:47:17 proxy.go:228: Starting proxy on
2023/09/06 13:47:17 stratum.go:280: Broadcasting new job to 0 stratum miners
To stop the proxy, use CTRL+C in your terminal.
After configuring and pointing your proxy at a shard, you're now ready to point a GPU miner at it and start mining.