Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Status node instructions #40

Closed
hesterbruikman opened this issue Oct 22, 2019 · 58 comments
Closed

Design Status node instructions #40

hesterbruikman opened this issue Oct 22, 2019 · 58 comments

Comments

@hesterbruikman
Copy link
Contributor

hesterbruikman commented Oct 22, 2019

Project

Objectives

  • Make it easy for anyone with a dedicated computer and Internet connection to set up and run a Status node
  • Inform people of technical requirements to run a node
  • Inform people of any risks or benefits
    • Equipment costs
    • Bandwidth (network and storage)
    • Power
    • Regulations
  • Nice to have: Design incentives for people to run a Whisper bootnode and/or Mailserver

Deliverables

UPDATE: It's important that all deliverables are editable.

  • Research & specification
    • Detailed plain-text description of steps required to set up and run a node. This includes instructions or reference to instructions to set up prerequisites such as Linux installation and command line basics.
    • Set up your own Status node
  • Design
    • Page layout and content for status.network
      • Content can include screenshots, video recordings, etc. whichever is most effective in instructions. We imagine a well narrated video with screen recording would do, but are open to other solutions.
      • Content includes instructions for both the physical and digital set up
  • Communication
    • Doc of recommendations to Status core contributors on how to further improve the process for anyone to set up a node

Scope

Platforms

Linux system

Use cases

  1. Set up node
    * (nano)PC with Ethereum fullnode (can be LES, ULC)
  • (nano)PC without Ethereum fullnode
  1. Configure node (Mailserver, Whisper, Bootnode only)
  2. Run node
  3. Connect Status to node
  4. Review/monitor Logs

Target users

Anyone with a dedicated computer that can run Linux

  • May or may not know how to user command line interfaces
  • May or may not have experience setting up servers
  • May or may not have Linux installed

Background

Status currently hosts nodes that act as Whisper network bootnodes and Mailservers to enable its messaging functionality. These nodes are hosted in US, Asia and Europe and are paid for by Status. This introduces a dependency. There are several reasons why this is undesirable:

  • If Status as an organization forgets to pay the bill or you cannot access the network (send/receive messages).
  • If you can't access a node from your location, you can't access the network.
  • Using nodes run by Status requires trust. If you don't trust nodes run by Status or want more control over your privacy you will want to run your own node.

It's essential for the sustainability of the Status Network that more people are able to set up a node independently or with support of the community.

For more background info read this thread: https://discuss.status.im/t/increasing-bootstrap-node-diversity-kiss-edition/1138

Note 1: Status nodes are different from Ethereum bootnodes which people might already be running.
Note 2: Once set up a node can have different configurations: a) Mailserver mode - around 600 MB per month b) Whisper Network bootnode mode
In addition you can set up an Ethereum full node, this takes significantly more diskspace 160-180GB Setting up an Ethereum full node is outside of the scope of this bounty.

Contributor profile

To complete this bounty you ideally have the following skills and equipment:

Skills

  • Experience with requirements collection specification through stakeholder interviews and desk research
  • Experience with technical content writing
  • Theoretical understanding of instructional design
  • Portfolio that includes illustrations and/or multimedia design

Equipment

https://our.status.im/bulletproofing-against-chaos-unicorns-with-status-on-arm/

  • A dedicated computer that can run Linux, can be an old laptop
    • What are recommended cost-effective mini/micro computers that are sufficient for a Whisper network bootnode?
  • Internet connectivity (preferably over Ethernet)

Collaboration

Online communication with:

  • Technical marketing writer
  • Infrastructure engineer
  • UX research
@hesterbruikman
Copy link
Contributor Author

hesterbruikman commented Oct 22, 2019

  • Proposed bounty amount
    Not sure what units are used. @StatusSceptre can you advise based on estimate completion time?

  • Estimated time to completion
    32h

  • Estimated required experience level
    Anyone with mixed design/dev background

  • Why we’re outsourcing it
    Resource constraints / team focus on Product

cc for thumbs and rockets 🤗 @andmironov @oskarth @rachelhamlin @DanBigM

@hesterbruikman
Copy link
Contributor Author

hesterbruikman commented Oct 28, 2019

Ping @rachelhamlin @DanBigM @andmironov @StatusSceptre

@corpetty
Copy link

corpetty commented Nov 5, 2019

This will be helpful, it is a WIP of my log so far with my node (it is a bit outdated as geth 1.9 came out:
https://notes.status.im/3Y__B0rAStqKLUOu__hBvw#

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 500.0 DAI (500.0 USD @ $1.0/DAI) attached to it.

@rachelhamlin
Copy link

@hesterbruikman I can't edit this repo - could you please add this to the Bounty Tracker project board? 🙏 (It's for accounting)

@hesterbruikman
Copy link
Contributor Author

@rachelhamlin added 👍

@luisberns
Copy link

Hello everyone, I recently started working on this issue, until now I have all the process documented following instructions from this blog post, a bootnode configured on my Linux machine (Ubuntu 19.04) and am planning some research with users.

For the research process, I intend to use initial documentation following similar steps as the blog post on the link above, but I have some questions about the process:

  • Would be possible for the user to have an easier tool for the build process? The process now is to clone a Git repository and make a new build, then move this build to a root folder, it would be great if the user could skip this step with an easier tool.
  • Is there any plan to make an interface available for the configurations file? Also, in the blog post and the Status.im documentation I have the details about the statusgo config files, but no for the bootnode, is there any documentation on this topic?

I intend to do user testing through the whole creation process, from the raw documentation to the site content with the UI design applied.

Thank you.

@rachelhamlin
Copy link

Hey @luisberns! Let me think of who can help you with this. Potentially @oskarth - do you think you could weigh in on this one?

afaik there aren't any improvements planned to this build process.

@oskarth
Copy link

oskarth commented Nov 25, 2019

Thanks Luis!

Some initial work on this was done before, don't know where to find this off the top of my head. Best person would probably be @adambabik @jakubgs or @andremedeiros (Igor was doing some work on this). IIRC we had some Dappnode integration/instructions before as well.

As for improving this in general, I would love to see it done. Realistically it is up to Core and its priorities, but some things are likely to be low hanging fruit.

@luisberns
Copy link

Thanks for the replies!

I understand that implementing new improvements could be hard due to the priorities.

In respect of the documentation for the config files for the Status bootnode, is there any reference in that area? Or the config files are only necessary for the statusgo installation?

Cheers.

@jakubgs
Copy link
Member

jakubgs commented Nov 26, 2019

Currently there's several run-* targets in our Makefile:
https://github.com/status-im/status-go/blob/464c30a4/Makefile#L301-L314
You're probably most interested in run-bootnode-docker, but that is the most neglected one as far as I know. It essentially just runs targets from this Makefile:
https://github.com/status-im/status-go/blob/develop/_assets/compose/bootnode/Makefile
And it almost mirrors the setup in:
https://github.com/status-im/status-go/blob/develop/_assets/compose/mailserver/Makefile
They both use docker-compose to configure a container with the right settings.

Currently there exist an alternative that doesn't use Docker for mailservers which is here:
https://github.com/status-im/status-go/blob/464c30a4/Makefile#L304-L305
And allows user to run the mailserver as a systemd service, which is preferable for most.
This is documented here:

You can use these as a starting point. I should probably add a systemd one for bootnodes too tho.

@jakubgs
Copy link
Member

jakubgs commented Nov 26, 2019

The reference for the configuration is the code itself:
https://github.com/status-im/status-go/blob/develop/params/config.go

@luisberns
Copy link

Thank you @jakubgs I'll check those links!

@jakubgs
Copy link
Member

jakubgs commented Nov 29, 2019

I've implemented a way to run a bootnode via systemd in: status-im/status-go#1709

Please check out the run-bootnode-systemd branch and see how the Makefile located under _assets/systemd/bootnode works for you. Please report any issues in that PR.

@jakubgs
Copy link
Member

jakubgs commented Dec 4, 2019

@luisberns I have merged status-im/status-go#1709 so you can base your work off of those changes. The BOOTNODE.md file should be the starting point.

@luisberns
Copy link

Hello, @jakubgs I spend this weekend working with the systemd installation file that you included in the repository.

I found that using the systemd method could make the flow way easier for the user, thank you for that!

How I got to run the bootnode in my machine

Even with the problems that I'll describe bellow I could get to run the bootnode in my machine, I changed the SERVICE_DIR variable to the system folder and removed the --user flag from the systemctl commands in the Makefile.

This would be enough to understand the installation process and proceed with the documentation and site design, but I thought it would be important to share the information about the errors that I encountered.

What problems I encountered

I found some problems trying to run the command sudo make run-bootnode-systemd, I'll describe here and I can make a PR further if necessary. I'm not an experienced developer so I'm sorry for any misinterpretation and please correct me if you think it is needed.

First, different directory for register the service

The systemd Makefile considers this variable to be the directory for storing/registering the service that will be called by the systemctl command export SERVICE_DIR ?= $(HOME)/.config/systemd/user/

When trying to run the service from this directory the service is not recognized by the systemctl.

Second, the systemctl uses the --user flag

When using the user flag the systemctl is directing for the user services and not the system services, but I was getting an error Failed to connect to bus. I didn't find any clear information about this error, but I supposed that this second point is directly connected to the first where the service is registered in a user-related folder.

@jakubgs
Copy link
Member

jakubgs commented Dec 9, 2019

I'm not sure why you are trying to run that with sudo. None of the instructions I wrote indicate that it should be run with sudo. I intentionally made it run as a user service under systemd to make the setup simpler. What reason do you have to run it as a system service rather than a user one?

Also, you said that:

When trying to run the service from this directory the service is not recognized by the systemctl.

What does that mean? Service isn't running from that directory, the current working directory of the service is defined by the WorkingDirectory setting in the service definition(see service.template file), which by default is set to $DATA_PATH, not $SERVICE_DIR. The $SERVICE_DIR variable - which should be set to ~/.config/systemd/user/ - is simply the location from where systemd loads service definitions.

And the Failed to connect to bus simply comes from you running it with sudo, which causes this line in the Makefile to fail:

STATUS    = $(shell systemctl --user is-active $(SERVICE_NAME))

@luisberns
Copy link

The reason why was running the process with sudo is, I'll state the steps that I followed to come to the actual moment:

  1. Made a pull from Git to update the code that you added in the repo. Tried to run make run-bootnode-systemd. Output:
Failed to connect to bus: Connection refused
cat: /var/tmp/status-go-boot/nodeaddr: No such file or directory
/bin/sh: 1: cannot create /var/tmp/status-go-boot/nodeaddr: Permission denied
  1. Tried again, but this time with with sudo, sudo make run-bootnode. Output:
Failed to connect to bus: No such file or directory
cat: /var/tmp/status-go-boot/nodeaddr: No such file or directory
CRIT [12-09|18:37:34.556] Failed to load ecdsa key from            file=/var/tmp/status-go-boot/nodekey error="open /var/tmp/status-go-boot/nodekey: no such file or directory"
  1. Added genkey to the all: task in the Makefile (I don't know if this is the correct way to go, I was just trying to fix the errors that I was getting with the installation). Output:
Failed to connect to bus: No such file or directory
INFO [12-09|18:38:39.277] Generating key file                      path=/var/tmp/status-go-boot/nodekey
* Generating 'bootnode' service...
* Enabling 'bootnode' service...
systemctl --user enable bootnode
Failed to connect to bus: No such file or directory
  1. Removed the --user flag from systemctl command and changed the SERVICE_DIR (that by your previous comment doesn't make a difference because if I understand right the DATA_PATH that sets the directory). Output (I'm omitting the enode/ip addresses):
Failed to connect to bus: No such file or directory
* Generating 'bootnode' service...
* Enabling 'bootnode' service...
systemctl enable bootnode
* Restarting 'bootnode' service...
systemctl restart bootnode
* Your bootnode is listening on: <ip:port>
* Make sure that IP and TCP port are available from the internet!
Your enode address is: <enode@ip:port>

Can you help me to understand what would be the correct way to go? Thank you!

@jakubgs
Copy link
Member

jakubgs commented Dec 9, 2019

You're right, the genkey target was missing from all. Good catch, fixed in: status-im/status-go#1728

But don't use it with sudo. Clean it up with make clean in the folder and try again.

@luisberns
Copy link

luisberns commented Dec 11, 2019

@jakubgs I was trying to redo the process without sudo but once again I was getting permissions errors so I installed a new Ubuntu 16.04 LTS on a Virtual Machine for doing the process from a clean state.

I want to confirm with you some things:

  • Can I do this process in a virtual machine like this?
  • What are the other distros that I could use and that will be needed in the documentation?

Also, I'm getting an error with the setup, I'll explain my process below.


New distro for a bootnode:

Install the requirements and clone the repo

# Install systemd for a new installation of Ubuntu distro
$ sudo apt-get install systemd

# Install golang-go following this process https://github.com/golang/go/wiki/Ubuntu
$ sudo add-apt-repository ppa:longsleep/golang-backports
$ sudo apt-get update
$ sudo apt-get install golang-go

# Install and setup git for cloning the repository
$ sudo apt-get install git
$ git config --global user.name "username"
$ git config --global user.email "useremail"

# Clone the status-go git repository
$ git clone https://github.com/status-im/status-go $HOME/status-go
$ cd status-go

# Define GOPATH env variable
$ GOPATH=$HOME/status-go
$ echo $GOPATH
// [$HOME]/status-go

Make a bootnode using systemd process

# Still inside the status-go folder where was cloned
$ make run-bootnode-systemd

I'm getting the following output:

make[1]: Entering directory '/home/louis/status-go/_assets/systemd/bootnode'
cat: /var/tmp/status-go-boot/nodeaddr: No such file or directory
* Building bootnode binary...
make[2]: Entering directory '/home/louis/status-go'
go build -i -o /home/louis/status-go/build/bin/bootnode -v -tags '' -ldflags ' -X main.buildStamp=2019-12-11.16:17:13 -X github.com/status-im/status-go/params.Version=0.38.0 -X github.com/status-im/status-go/params.GitCommit=58fc7e4 -X github.com/status-im/status-go/vendor/github.com/ethereum/go-ethereum/metrics.EnabledStr=true' ./cmd/bootnode/
cmd/bootnode/main.go:12:2: cannot find package "github.com/ethereum/go-ethereum/crypto" in any of:
	/usr/lib/go-1.6/src/github.com/ethereum/go-ethereum/crypto (from $GOROOT)
	($GOPATH not set)
cmd/bootnode/main.go:13:2: cannot find package "github.com/ethereum/go-ethereum/log" in any of:
	/usr/lib/go-1.6/src/github.com/ethereum/go-ethereum/log (from $GOROOT)
	($GOPATH not set)
cmd/bootnode/main.go:14:2: cannot find package "github.com/ethereum/go-ethereum/p2p/discv5" in any of:
	/usr/lib/go-1.6/src/github.com/ethereum/go-ethereum/p2p/discv5 (from $GOROOT)
	($GOPATH not set)
Makefile:82: recipe for target 'bootnode' failed
make[2]: *** [bootnode] Error 1
make[2]: Leaving directory '/home/louis/status-go'
Makefile:96: recipe for target '/home/louis/status-go/build/bin/bootnode' failed
make[1]: *** [/home/louis/status-go/build/bin/bootnode] Error 2
make[1]: Leaving directory '/home/louis/status-go/_assets/systemd/bootnode'
Makefile:302: recipe for target 'run-bootnode-systemd' failed
make: *** [run-bootnode-systemd] Error 2

It seems that the GOPATH is not defined, but I did define it and check before trying to create the bootnode, what I'm doing wrong in this process?

Thank you!

@jakubgs
Copy link
Member

jakubgs commented Dec 12, 2019

$ GOPATH=$HOME/status-go

Wrong.

The GOPATH environment variable is used to specify directories outside of $GOROOT that contain the source for Go projects and their binaries.
https://github.com/golang/go/wiki/GOPATH

Each directory listed in GOPATH must have a prescribed structure:

The src directory holds source code. The path below src determines the import path or executable name.
https://golang.org/cmd/go/#hdr-GOPATH_environment_variable

By default the GOPATH is set to ~/go and does not need to be changed:

 $ go env | grep GOPATH
GOPATH="/home/myuser/go"

And package sources are expected to be available under src, so if your package is from:
https://github.com/status-im/status-go
Then running this:

go get github.com/status-im/status-go

Should get you:

 $ cat ~/go/src/github.com/status-im/status-go/VERSION   
0.37.3

@jakubgs
Copy link
Member

jakubgs commented Dec 12, 2019

cat: /var/tmp/status-go-boot/nodeaddr: No such file or directory

This is just a warning caused by this line in the Makefile, because before you run the setup process for the first time the /var/tmp/status-go-boot doesn't exist yet. That can be ignored. Although I might want to look at suppressing it. It's using = which is "lazy" assignment, which means it should happen only when the variable is needed.

@jakubgs
Copy link
Member

jakubgs commented Dec 12, 2019

Can I do this process in a virtual machine like this?

Why not? If it has either Docker or systemd it shouldn't matter. Part of the point of virtual machines is that on the inside they seem like a normal host on normal hardware.

What are the other distros that I could use and that will be needed in the documentation?

Ones that have either Docker or systemd.

@hesterbruikman
Copy link
Contributor Author

@jakubgs @luisberns thank you both for all the progress on this issue! Per @luisberns suggestion, shall we have a call to go over the first version of documentation?

Related development: a survey among core contributors showed that obtaining a static IP address from an ISP is a potential blocker for a number of people to run a node. Therefore, as a starting point, it would be great to complete a manual to send/receive _your own messages_ first.

I suggest we use the call to go over steps in the manual that are required for different node configurations.

@luisberns
Copy link

luisberns commented Dec 16, 2019

@jakubgs Thank you for your replies and recommendations!

When I started working with the bounty I was using this Status blog article as a reference where changing the GOPATH was one of the steps for running a bootnode was to redefine the GOPATH to the status-go folder.

I repeated the installation process without changing the default GOPATH and this time I performed the process trying to use both methods systemd and Docker and running in two different Ubuntu versions (16.04 and 18.04, both LTS).

I'm still having some errors with the process so I'll describe my process and outputs bellow. As the errors are the same for both versions of Ubuntu I'll be running in the 18.04 version for the log bellow.

Run a Status Bootnode

Install required software and clone the git repository

# Install required software
$ sudo apt-get install \
        golang-go \
	systemd \
	make \
	curl \
        git

# Config git and clone the status-go repository
$ git config --global user.name "username"
$ git config --global user.email "useremail"
$ git clone https://github.com/status-im/status-go $HOME/status-go
$ cd status-go

Running a bootnode

Systemd method

# Use make to run the setup process
$ make run-bootnode-systemd

My output:

make[1]: Entering directory '/home/louis/status-go/_assets/systemd/bootnode'
cat: /var/tmp/status-go-boot/nodeaddr: No such file or directory
* Building bootnode binary...
make[2]: Entering directory '/home/louis/status-go'
go build -i -o /home/louis/status-go/build/bin/bootnode -v -tags '' -ldflags ' -X main.buildStamp=2019-12-15.23:42:40 -X github.com/status-im/status-go/params.Version=0.38.0 -X github.com/status-im/status-go/params.GitCommit=52dd8356 -X github.com/status-im/status-go/vendor/github.com/ethereum/go-ethereum/metrics.EnabledStr=true' ./cmd/bootnode/
cmd/bootnode/main.go:12:2: cannot find package "github.com/ethereum/go-ethereum/crypto" in any of:
	/usr/lib/go-1.10/src/github.com/ethereum/go-ethereum/crypto (from $GOROOT)
	/home/louis/go/src/github.com/ethereum/go-ethereum/crypto (from $GOPATH)
cmd/bootnode/main.go:13:2: cannot find package "github.com/ethereum/go-ethereum/log" in any of:
	/usr/lib/go-1.10/src/github.com/ethereum/go-ethereum/log (from $GOROOT)
	/home/louis/go/src/github.com/ethereum/go-ethereum/log (from $GOPATH)
cmd/bootnode/main.go:14:2: cannot find package "github.com/ethereum/go-ethereum/p2p/discv5" in any of:
	/usr/lib/go-1.10/src/github.com/ethereum/go-ethereum/p2p/discv5 (from $GOROOT)
	/home/louis/go/src/github.com/ethereum/go-ethereum/p2p/discv5 (from $GOPATH)
Makefile:82: recipe for target 'bootnode' failed
make[2]: *** [bootnode] Error 1
make[2]: Leaving directory '/home/louis/status-go'
Makefile:96: recipe for target '/home/louis/status-go/build/bin/bootnode' failed
make[1]: *** [/home/louis/status-go/build/bin/bootnode] Error 2
make[1]: Leaving directory '/home/louis/status-go/_assets/systemd/bootnode'
Makefile:302: recipe for target 'run-bootnode-systemd' failed
make: *** [run-bootnode-systemd] Error 2

Docker method

# Use make to run the setup process
$ make run-bootnode-docker

My output:

make[1]: Entering directory '/home/louis/status-go/_assets/compose/bootnode'
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
Makefile:59: recipe for target 'keys/nodekey' failed
make[1]: *** [keys/nodekey] Error 126
make[1]: Leaving directory '/home/louis/status-go/_assets/compose/bootnode'
Makefile:305: recipe for target 'run-bootnode-docker' failed
make: *** [run-bootnode-docker] Error 2

@jakubgs
Copy link
Member

jakubgs commented Dec 16, 2019

I think you are using old go version. And your user is not in the docker group.

@luisberns
Copy link

luisberns commented Dec 16, 2019

I made a mistake in the process above that the git repository was cloned to the $HOME path. I corrected it using this orientation in the following way:

$ go get github.com/status-im/status-go
$ cd $HOME/go/src/github.com/status-im/status-go/
$ make run-bootnode-systemd

Success, now I got to run the Status Bootnode with systemd! 🎉

I'll update the steps for installation and post here on the issue as well.


For the docker installation I create the docker group following this doc and was able to run without a permission issue, but got this output:

make[1]: Entering directory '/home/louis/go/src/github.com/status-im/status-go/_assets/compose/bootnode'
Unable to find image 'statusteam/bootnode:latest' locally
latest: Pulling from statusteam/bootnode
8e3ba11ec2a2: Pull complete 
bd7c8273c1bf: Pull complete 
5b11a42c09d3: Pull complete 
Digest: sha256:[key-ommited]
Status: Downloaded newer image for statusteam/bootnode:latest
flag provided but not defined: -genkey
Usage of bootnode:
  -addr string
    	listen address (default ":30301")
  -keydata string
    	hex encoded private key
  -n value
    	These nodes are used to connect to the network if the table is empty and there are no known nodes in the database.
  -nodekey string
    	private key filename
  -verbosity int
    	log verbosity (0-9) (default 3)
  -vmodule string
    	log verbosity pattern
Makefile:59: recipe for target 'keys/nodekey' failed
make[1]: *** [keys/nodekey] Error 2
make[1]: Leaving directory '/home/louis/go/src/github.com/status-im/status-go/_assets/compose/bootnode'
Makefile:305: recipe for target 'run-bootnode-docker' failed
make: *** [run-bootnode-docker] Error 2

@luisberns
Copy link

@jakubgs the problem that I comment previously it was indeed the port problem. I stopped the Docker container and restarted the Bootnode service and it was activated properly.

@jakubgs
Copy link
Member

jakubgs commented Dec 24, 2019

You can setup the service on a different port by setting the LISTEN_PORT variable, which by default is set to 30303 for both:

make LISTEN_PORT=12345

@jakubgs
Copy link
Member

jakubgs commented Dec 24, 2019

it wasn't clear for these users that docs presented two ways to install and one of them was optional

Weird, because I thought the docs made it pretty clear, from MAILSERVER.md:

This document describes the two easiest ways to start a Status Mailserver:

Maybe it should be:

This document describes the two alternative ways to start a Status Mailserver:

@jakubgs
Copy link
Member

jakubgs commented Dec 24, 2019

Updated the wording in status-im/status-go#1755 which also allows for running the systemd service as a system rather than user service.

@hesterbruikman
Copy link
Contributor Author

Great work @luisberns !

I went into the notes doc :

  • Added a general intro
  • Made some grammatical edits.
  • Replaced the reference to Bootnode with node and occasionally Status node, with the intro explaining there are different types of nodes in layman's terms.
  • Added high level steps (1. Get the recommended device, 2. Install required software, 3. Install node, 4. Configure node, 5. Set Status app to use your node)

3 open points/questions @jakubgs , helpful if you can weigh in here as well:

  1. What is the benefit of using systemd? I noticed running directly in your machine., but I'm not sure what that means. Right now, it's a bit hard to determine which option to go for.
  2. I'm missing the connection to step 4 Configure node and step 5 Set Status app to use your node. At the step Check if your node is active. Does the output provide an address that can be copied into Status? For reference, I'm looking for what to enter on the screen below. Still love the QR code idea, but happy to let that be for now.
  3. The recommended device is this nanoPC with extended memory and storage. What would be needed to interface with this device? Can you plug it into your laptop or do you need a separate monitor and wired mouse and keyboard? (@corpetty as you have this exact device, how did you connect it?) Basically I want to make the table in this section as complete as possible so you don't get stuck half way.

Screenshot_20191230-154743_Status

Hope y'all are having a wonderful Christmas/New Years break!

@jakubgs
Copy link
Member

jakubgs commented Dec 30, 2019

Replaced the reference to Bootnode with node and occasionally Status node, with the intro explaining there are different types of nodes in layman's terms.

Doesn't sound like a good change to me. Status node and a bootnode are different things. Normal users that just want a service to relay their messages don't need a bootnode at all.


What is the benefit of using systemd? I noticed running directly in your machine., but I'm not sure what that means. Right now, it's a bit hard to determine which option to go for.

There are 2 ways available. Docker container and systemd service:

  • systemd - This is what is called an init process which is the first process started at OS boot(hence why it has PID 1) and usually manages all the other processes started on the system. Having your service managed by systemd means that it runs alongside any other process in the system, usually with no special restrictions.
  • Docker - Is a way to run software under OS-level virtualization, which in case of Docker means that the process is constrained using various OS features like cgroups, namespaces, and union-capable filesystems to isolate the process as much as possible from the underlying system and its resources.

For example. When I run a History node(Mailserver) under systemd, I can see that the parent process of the node is systemd:

 $ make run-mailserver-systemd
 $ pstree -pTs $(pgrep statusd)
systemd(1)───systemd(2358)───statusd(2374)

But when I run the same History node(Mailserver) using Docker, I can see that the parent process is Docker:

 $ make clean-mailserver-systemd 
 $ make run-mailserver-docker
 $ pstree -pTs $(pgrep statusd)  
systemd(1)───dockerd(1358)───docker-containe(1783)───docker-containe(62395)───statusd(62410)

And in addition to being managed by Docker it is also limited by things like cgroups or namespaces.


At the step Check if your node is active. Does the output provide an address that can be copied into Status?

If you run make run-mailserver-* it does show you your enode address:

 $ make run-mailserver-systemd
* Generating 'statusd' config...
Generating config at: /var/tmp/status-go-mail/config.json
* Generating 'statusd' service...
* Enabling 'statusd' service...
systemctl --user enable statusd
Created symlink /home/sochan/.config/systemd/user/default.target.wants/statusd.service → /home/sochan/.config/systemd/user/statusd.service.
* Restarting 'statusd' service...
systemctl --user restart statusd
* Your mailserver is listening on: 93.105.176.182:30304
* Make sure that IP and TCP port are available from the internet!
Your enode address is:
enode://be87d447b217901ab7e4417c92f61c55f4f33cb9089a172088b55741ae024b07aad677466aa69aab19fc54b5bed8bd00ffbc27f3b3e0c7f8fd109562b68a1379@12.34.56.78:30303

Although I have thought that we could optionally provide a UTF QR code in the console, but that would require additional tools that most people wouldn't have installed.


The recommended device is this nanoPC with extended memory and storage. What would be needed to interface with this device?

The "nanoPC", as the name implies, is a nano... PC. It's a full fledged personal computer but slightly larger than a credit card when viewed from the top. It needs a screen, a keyboard, a mouse if you want GUI, and an ethernet or wifi connection to the internet, like any other PC would. Though it can be set up to just be accessible via SSH. See that it has an HDMI as well as USB and Ethernet:
nanoPC T4

And I don't know about it being "recommended", it should be capable of running statusd just fine with plenty of resources left and it's also cute as a button.

@jakubgs
Copy link
Member

jakubgs commented Dec 30, 2019

Oh yeah, and happy new year.

@hesterbruikman
Copy link
Contributor Author

Terminology

Doesn't sound like a good change to me. Status node and a bootnode are different things. Normal users that just want a service to relay their messages don't need a bootnode at all.

@jakubgs This is mostly why I want to remove the reference to bootnode I don't think it makes sense to beginners only wanting to fetch and send messages through their own node and get familiar. In this list of Small, Medium, Large, does either classify as a bootnode or is it a different category altogether?

SMALL - Messaging only, for personal use (a.k.a. Mailserver or History node) Send and receive messages messages with your own client on the same network.

MEDIUM - Messaging only, for yourself and others (a.k.a. Mailserver or History node) Send and receive messages messages with your own client as well as allowing others to do the same using your node.

LARGE - Messaging and transactions for yourself and others (a.k.a. Ethereum full node) Send and receive messages messages and transactions with your own client as well as allowing others to do the same using your node.


1. systemd vs docker explanation

There are 2 ways available. Docker container and systemd service:

Thanks for clarifying! Is it correct to state that you can run systemd on a dedicated device, but if you install the (boot)node on a multipurpose device (old PC or laptop on which you may be running a server or some IoT home trinkets), it's best to use Docker?


2. Configure node step

@luisberns could you add this as a separate step? Something like

  • Open Status app
  • Go to Profile > Settings > Sync Settings > Add mailserver [+]
    or
  • Go to Profile > Settings > Advanced > Bootnodes > Add bootnode [+]
  • Instructions to run make run-mailserver-*
  • copy enode uri into Status with example of what to look for:
    enode://be87d447b217901ab7e4417c92f61c55f4f33cb9089a172088b55741ae024b07aad677466aa69aab19fc54b5bed8bd00ffbc27f3b3e0c7f8fd109562b68a1379@12.34.56.78:30303

3. Recommended device

✅ updated the table to include Ethernet outlet and Cable as well as Keyboard, mouse, display, cables ass optional and added a commend that the Nano PC can also be used through SSH.

@jakubgs
Copy link
Member

jakubgs commented Jan 6, 2020

In this list of Small, Medium, Large, does either classify as a bootnode or is it a different category altogether?

I don't think so. The only purpose of a bootnode is letting nodes know about other nodes. It's a digital matchmaker if you will. I'd agree with not posting instructions about running it yet, since it can only confuse people.

And the LARGE option in that list doesn't make sense, because I don't believe our app has an option to use something else than Infura for transactions right now.

Is it correct to state that you can run systemd on a dedicated device, but if you install the (boot)node on a multipurpose device (old PC or laptop on which you may be running a server or some IoT home trinkets), it's best to use Docker?

Probably. Dedicated devices have less resources, and avoiding additional layers like Docker can reduce the overhard for the software running, so in that sense yes. But in general the way you run a process is up to you and your operating system. If you look at systemd adoption you'll see that most major Linux distributions use it as their Init process, so it's the most sensible choice for most users. Using Docker requires installing additional packages, while for most using systemd doesn't.

@hesterbruikman
Copy link
Contributor Author

hesterbruikman commented Jan 6, 2020

I don't think so. The only purpose of a bootnode is letting nodes know about other nodes. It's a digital matchmaker if you will. I'd agree with not posting instructions about running it yet, since it can only confuse people.

Added it to the Types of nodes and the comparison table. for context. Assuming a bootnode needs a static IP, router configuration, stabel internet connection, but no significant storage space.

And the LARGE option in that list doesn't make sense, because I don't believe our app has an option to use something else than Infura for transactions right now.

Added a note: LARGE is currently not usable with Status until the number of available Large nodes reaches a critical mass to support the Status client in the number and frequency of transaction updates.*

Probably. Dedicated devices have less resources, and avoiding additional layers like Docker can reduce the overhard for the software running, so in that sense yes. But in general the way you run a process is up to you and your operating system. If you look at systemd adoption you'll see that most major Linux distributions use it as their Init process, so it's the most sensible choice for most users. Using Docker requires installing additional packages, while for most using systemd doesn't.

@jakubgs Assuming that people order the NanoPC, use it only to run a node, is systemd the recommended option in that case?

@hesterbruikman
Copy link
Contributor Author

fyi: added a reference to https://discuss.status.im/c/messaging-network as a forum to discuss issues during installation.

@luisberns
Copy link

Happy new year y'all!


@hesterbruikman I added the instructions for adding the ENODE address in Status app. I think we could add some screenshots to make easier for people to configure the Bootnode on the app. But the most important thing on this process is the ENODE address, is it possible to collect the ENODE address besides when is logged on the terminal in the installation process?

Also, I made a small adjustment on this summary:

How to run your own node

  1. Get the recommended device
  2. Install required
  3. Install and configure node
  4. Set Status app to use your node

@hesterbruikman
Copy link
Contributor Author

Thanks for these updates @luisberns @jakubgs should the enode address be added to both Profile > Settings > Advanced > Bootnode as well as Profile > Settings > Sync settings > Mailserver

I'm assuming that setting it as bootnode only makes sense if you have a static IP address, and else it's best left disabled in bootnode settings, is that right?

@jakubgs
Copy link
Member

jakubgs commented Jan 10, 2020

Bootnode should go to Bootnodes and Mailserver(History node) should go to Mailservers.

But as I said, normal users should never have to run a bootnode. We really should stop talking about that.

@hesterbruikman
Copy link
Contributor Author

fyi @luisberns trial of the documentation is underway while we smooth over the above details: https://discuss.status.im/t/get-your-node-running/1488/3?u=hester

@hesterbruikman hesterbruikman changed the title Design Status bootnode instructions Design Status node instructions Jan 14, 2020
@hesterbruikman
Copy link
Contributor Author

@luisberns can you please check if there's any additional information in this notes doc that's worthwhile to incorporate or link to? https://notes.status.im/A0VSe1h2SD2ED_95Zy6AEA?view#Installing-Status

Other than that I think we're as ready as can be to add the manual to status.im. @jakubgs do you think this could be an update of https://github.com/status-im/status.im/blob/develop/source/technical/run_status_node.md or rather a new file?

I believe this was the workflow:

@jakubgs
Copy link
Member

jakubgs commented Jan 21, 2020

Yeah, the run_status_node.md is probably the right place for this. No need to rename it.

@luisberns
Copy link

@hesterbruikman for our doc, as we also instruct how to add the ENODE addr in the Status app, I think would be interesting to add how to obtain aswell.

I updated the content in the notes, can you check? - https://notes.status.im/WJqu-tZoRtqVRO61Ic4NxQ?view#Obtain-your-ENODE-address0

@jakubgs
Copy link
Member

jakubgs commented Jan 23, 2020

I think would be interesting to add how to obtain as well.

 $ cd _assets/systemd/mailserver
 $ make enode
enode://123qweASD@12.34.56.78:30303

Or even simpler:

 $ _assets/scripts/get_enode.sh
enode://123qweASD@12.34.56.78:30303

It should show up right after setup too. Though now that I think about it we should include the password in the enode address. Here's the change: status-im/status-go#1811
Also added showing as QR code if qrencode is available in that PR.

@luisberns
Copy link

@jakubgs I was waiting for the PR to be accepted before updating the docs. I just updated the description of how to generate the ENODE address as well as the QR Code.

@hesterbruikman
Copy link
Contributor Author

Thanks @luisberns ! Walked through the process over the weekend and the option to generate a QR code will make such a difference. Copying manually is a really error sensitive approach:S

Cross-posting here what I wrote on our discuss forum. https://discuss.status.im/t/get-your-node-running/1488/19?u=hester

I ran into issues at the last step and I think it has to do with setting a password, which is not included in the steps. Does either of you @jakubgs @luisberns have any thoughts on if, when this should happen?
Alternatively it could be that I made a mistake when copying the enode uri. I triple checked, but well... it's manual. Still doesn't change the fact that a password is required when entering the enode in Status.

@hesterbruikman
Copy link
Contributor Author

Latest version of the manual posted here for visibility: https://discuss.status.im/t/get-your-node-running/1488/22?u=hester

Made a great step forwards in making it more accessible for the average user to set up a node. @luisberns Thanks for your work on this, and your patience! This issue spanned way beyond the Dec/Jan timeframe I had in mind due to shifting priorities.

@rachelhamlin can you support in bounty payout? Sorry, I can't tag @StatusSceptre in here :/

@gitcoinbot
Copy link

⚡️ A tip worth 500.00000 SAI (500.0 USD @ $1.0/SAI) has been granted to @luisberns for this issue from @StatusSceptre. ⚡️

Nice work @luisberns! To redeem your tip, login to Gitcoin at https://gitcoin.co/explorer and select 'Claim Tip' from dropdown menu in the top right, or check your email for a link to the tip redemption page.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This Bounty has been completed.

Additional Tips for this Bounty:

  • StatusSceptre tipped 500.0000 SAI worth 500.0 USD to luisberns.

@luisberns
Copy link

Thank you @hesterbruikman, it was nice doing this bounty and I'm available in case of other opportunities!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants