Run a Stratum Proxy
A guide on configuring, starting, and running a Stratum Proxy.
Introduction
Here, we’ll be installing go-quai-stratum, the Go implementation of the stratum proxy on Quai Network. This tutorial is focused on Linux Distributions and MacOS systems.
Prefer a video tutorial? Check out a video walkthrough on setting up a stratum proxy here:
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 only recommended 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.).
Go v1.23.0+
Snap is not default installed on all Linux distros
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, and G++
Install git, make, and g++ with the following command:
go-quai-stratum
Now that you’ve installed the base dependencies, we can go ahead and clone the go-quai-stratum repo in the root directory.
To clone the go-quai-stratum repo and navigate to it, run the following commands:
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:
For example (this not the latest release, check the releases page for the latest release number):
Configuration
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:
This will copy the example config and create a new config file within the config directory.
Within the newly created config.json
file, you’ll be able to configure networking settings and other relevant variables:
Running the Proxy
Build
Before running the proxy, we need to build the source. You can build via Makefile by running the following command:
Run
Now that we’ve built the source, we can start our proxy. We recommend using a process manager like tmux to run the proxy as background service.
To run the proxy, you’ll need to select a shard to run against.
Start the proxy by changing REGION-NAME
and ZONE-NAME
to the corresponding or chain names for the region and zone your node is running.
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
and ZONE-NAME
can be found below. You must select a corresponding region and zone, e.g. cyprus and cyprus1.
Chain Name | Type | Chain Index | Websocket Port | Stratum Run Flags |
---|---|---|---|---|
Cyprus | Region | 8002 | --region=cyprus | |
Cyprus1 | Zone | [0 0] | 8220 | --region=cyprus --zone=cyprus1 |
Cyprus2 | Zone | [0 1] | 8221 | --region=cyprus --zone=cyprus2 |
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.
Changing the proxy listening port is useful for running multiple proxies on a single global 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.
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.
Was this page helpful?