How to join the Brubeck testnet
By: Henri Pihkala
Tags: Data, Web3, Streamr, Open Source, Technology

Make history and be one of the first people ever to run a Streamr node! Follow these instructions to join the Brubeck testnet and mine your share of the 2M DATA reward pool (worth around $300,000 at the moment).

Two ways to run your node

The software comes in two flavours of packaging: a Docker image and an npm package. Both approaches require you to run commands on the command line, so some technical skill or at least commendable bravery is required. :)

So which method should you choose? If you have either Docker or Node.js (14.x or newer) already installed, use the one you know. Otherwise, try the Docker approach first, which is less platform-dependent. If that doesn’t work for you, go for the npm approach.

Once you have either Docker or Node.js installed, the steps to download and start the node are very similar, regardless of whether you’re running Linux, macOS, or Windows (use PowerShell). You may need to adapt the commands for your platform or install OS-specific dependencies, if they are missing.

Matthew shows the steps needed to set up your node and join the testnet

The configuration wizard

As part of both approaches, we show how to run the configuration wizard to initialize your node’s config file, which will be saved on your disk. The wizard will let you either generate or import an Ethereum private key for your node, as well as ask which plugins you want to enable. If you only use your node for mining the testnet, you don’t need to enable any of them. If you plan to also use your node to connect applications to data streams in the testnet, see the section ‘Using your node for publishing and subscribing’ later in this blog post.

The Docker approach

If you don’t have Docker, get it here. Once installed, you can download, configure, and start the Streamr Broker.

Step 1: Set up a directory to be mounted into a running Docker container

You’ll need a place in the host OS where the Broker configuration file will be stored. This directory will be mounted into the running Docker container so that it persists and remains accessible outside of Docker.

Create the directory with the command:

mkdir ~/.streamrDocker

Step 2: Configure your node with Docker and Config Wizard

Start the config wizard with the below longish command. Docker will download the Broker image unless you have it already.

Linux / macOS

docker run -it -v $(cd ~/.streamrDocker; pwd):/root/.streamr streamr/broker-node:testnet bin/config-wizard

Windows PowerShell

cd ~/.streamrDocker docker run -it -v ${pwd}:/root/.streamr streamr/broker-node:testnet bin/config-wizard

Generate or Import Ethereum private key: generate one if you’re running this for the first time

Plugins to enable: press ‘a’ to select all and then ‘enter’

Select ports for plugins: press ‘enter’ for each one to use the defaults

Path to store the configuration: press ‘enter’ to use the default

Towards the end, the wizard asks if you would like it to display your Ethereum private key. From here you should copy-paste it to a safe place! You can also find it later in the configuration file, which is saved by default to .streamrDocker/broker-config.json under your home directory.

Step 3: Start the Broker Node using Docker

Start the node with the below command:

Linux / macOS

docker run -it -p 7170:7170 -p 7171:7171 -p 1883:1883 -v $(cd ~/.streamrDocker; pwd):/root/.streamr streamr/broker-node:testnet

Windows PowerShell

docker run -p 7170:7170 -p 7171:7171 -p 1883:1883 -it -v ${pwd}:/root/.streamr streamr/broker-node:testnet

You should start to see logging similar to this:

The npm approach

If you don’t have Node.js, install it using nvm or manually from the Node.js site. The Broker requires at least Node.js version 14.x. Once installed, you can download, configure, and start the Streamr Broker.

Step 1: Install the latest version using npm

Run npm install -g streamr-broker@testnet to download and install the package. You may need administrative access to run this command.

npm install -g streamr-broker@testnet

+ streamr-broker@29.0.0 updated 1 package in 10.623s

There can be plenty of output from npm. If the installation fails with an error, you should address it before continuing.

Step 2: Configure your node with streamr-broker-init

Run streamr-broker-init to generate a configuration file using a step-by-step wizard. Answer the questions by using arrow keys and ‘enter’ to navigate.

to generate a configuration file using a step-by-step wizard. Answer the questions by using arrow keys and ‘enter’ to navigate. Generate or Import Ethereum private key: generate one if you’re running this for the first time

Plugins to enable: press ‘a’ to select all and then ‘enter’

Select ports for plugins: press ‘enter’ for each one to use the defaults

Path to store the configuration: press ‘enter’ to use the default

Towards the end, the wizard asks if you would like it to display your Ethereum private key. From here, you should copy-paste it to a safe place! You can also find it later in the configuration file, which is saved by default to .streamr/broker-config.json under your home directory.

Step 3: Start the Broker node

Run streamr-broker to start the node!

Is my node connected to the network?

Once your node is running, it should appear in the Network Explorer. You can search for it using the address or mnemonic of your node, both of which are displayed when the node starts up.

Note that the locations shown on the map are guesstimates based on IP, and are not accurate! Nevertheless, if you are concerned about your privacy, you can edit your config file and input whatever coordinates you wish, and the Network Explorer will plot your node in that location.

Staying safe

The config file contains your node’s private key. If someone gets access to the private key, they can steal your rewards! If you lose your private key, you will lose your rewards!

Don’t share the private key with anyone! Streamr staff will never ask for your private key.

Don’t share the config file with anyone! Streamr staff will never ask you to send your config file or share its full contents.

Back up your private key. The config wizard will show you the private key, but you can also open the config file in a text editor and copy the private key to a safe place later on.

How do the rewards work?

The real tokenomics and incentivisation of the Streamr Network are only implemented in the next milestone (Tatum). To substitute for those at this stage, the Brubeck testnets use a centralized mining mockup that periodically checks which nodes are alive and participating in the preconfigured reward stream. For details on how this works, check out the previous two dev updates (here and here).

The amount of tokens you earn depends on your node’s uptime, the amount of other nodes in the network, and their uptime. To maximise your rewards, simply keep your node up and running during the reward periods of all the testnets. More uptime means more rewards!

Because the reward pool grows as new nodes join, and your earnings depend on how well you’re doing compared to others, the amount of tokens your node will receive can only be computed after all the testnets are concluded. However, during the testnets you will be able to see your node’s uptime and other stats. The reward tokens will be distributed at a later time to your node’s Ethereum address, so keep that private key safe!

There will be some additional bonus rewards and surprises available during the testnets, including a contest to find the most exotic, interesting, and best looking testnet nodes. We’ll have more to share on this soon.

Using your node for publishing and subscribing

You can do more with your node than just mine the testnet incentives! Now that you have a Streamr node up and running, why not also build applications that publish or subscribe to data streams in the network? You can create streams using the Core UI, then connect your application to your node over websocket, HTTP, or MQTT. Learn more about how to interface with the protocol plugins. Note that the data you publish in the testnet will only be available in the testnet, so the data won’t show up in the Core UI.

Troubleshooting

Everyone’s setup is a little bit different, so please understand that we can not test or even anticipate all the different combinations of OS, hardware, NAT type, and so on.

That being said, the software has been successfully run on at least Ubuntu 20, macOS Big Sur (x86 and M1), and Windows 10, using both Node.js and Docker. We also tried running on Raspberry Pi, and it worked. You can help by testing more platforms and letting us know how it went!

If you’re having trouble getting your node up and running, or it prints errors after starting, make sure to join the #testnet-troubleshooting channel on Streamr Discord. There will be team members and community members there to help, as well a #testnet-faq channel, which we will continue to update.

Happy hunting, and thanks for pioneering real-time data in Web 3.0 by helping us build and test the Streamr Network at a global scale!