How (and why) pools (and all miners) should use the Relay Network

Posted on at


Many of you have likely seen the recent discussions on the P2Pool thread and the post on the foundation blog about the relay network.

It exists as a way for pool operators (and all miners, though not hashers) to get their blocks relayed quickly across a separate network both as a backup to the P2P network and as a quicker way to get the latest blocks as it skips relaying transactions which have already been seen. Thus, if you're a miner anywhere from a small p2pool miner to a large pool, you should be running one of the relay network clients.

You can see more information about its original goals and its original announcement here

Current connection information is as follows:

The relay network's domains are designed to be a bit aggressive to allow for future growth and are laid out by region. The regions are us-east, us-west, eu, sgp, au, jpy, and hk (ie North East US, West Coast US, Western Europe, Singapore, Australia, Japan and Hong Kong). Currently, several regions map to the same set of nodes (all of the asian ones are currently hosted in Singapore), but in the future hopefully things will be more distributed so that you can get nodes closest to your bitcoinds.

You should use the Java relay network client available at https://github.com/TheBlueMatt/RelayNode/raw/master/client/RelayNodeClient.jar or the C++ client at https://github.com/TheBlueMatt/RelayNode/tree/master/client. This will connect using a specialized protocol which will skip relaying transactions which you have already heard about, saving significant bandwidth (and time).

Note that a version of p2pool with a python client integrated directly is available at https://github.com/TheBlueMatt/p2pool

To connect to the relay nodes, you should run RelayNetworkClient.jar or relaynetworkclient with the parameters public.REGION.relay.mattcorallo.com followed by your local bitcoind's address.

eg
$ java -jar ./RelayNodeClient.jar public.us-east.relay.mattcorallo.com 127.0.0.1:8333
or
$ ./relaynetworkclient public.us-east.relay.mattcorallo.com 127.0.0.1 8333


If you are a large pool, you should go to https://docs.google.com/forms/d/1UL82QdcXXEhZwSHJAK04Sk_cWg4zLOu8a216nO7Mt8c/viewform to sign up to get a private token which will be used in case of DoS, allowing the relay network to split into private and public parts.

Further details:
 * The relay nodes do some data verification to prevent DoS, but in order to keep relay fast, they do not fully verify the data they are
relaying, thus YOU SHOULD NEVER mine a block building on top of a relayed block without fully checking it with your own bitcoin validator (as you would any other block relayed from the P2P network).
 * The relay nodes all relay among themselves very quickly, so there is no advantage to peering with more than one, in fact, the increased incoming bandwidth during block relay spikes may result in higher latency for your nodes. Please only connect to relay nodes in your region (with multiple peers, one per bitcoind, if you have bitcoinds in multiple regions).
 * The relay nodes are NOT designed to ensure that you never miss data, and may fail to relay some transactions. The relay nodes are NOT a replacement for having peers on the standard P2P network.

You can find the source for the relay nodes at https://github.com/TheBlueMatt/RelayNode

If you have any comments/concerns/suggestions, please do not hesitate to ping me on IRC (BlueMatt on freenode).



About the author

160