Skip to content

Setup Instructions Mainnet

Chris edited this page Jan 2, 2020 · 20 revisions

You can use the following steps to setup Marconi on a machine you'd like to connect to the Marconi Mainnet.

If you'd like you explore the Marconi Testnet please refer to these instructions.

Minimum Requirements

Operating System

  • Ubuntu 16.04
  • Ubuntu 18.04
  • CentOS 7

Memory

  • 2GB of memory
  • It's possible to run Marconi with 1GB of memory, but a swapfile will be needed. Follow this guide to create a swapfile.

Set the firewall rules to open the following ports

Protocols Ports
TCP 24802
UDP 24800, 24801, 40000-47919

Procuring Machines

If you don't have machines that you'd like to connect or if you want some additional test machines the following hosting providers have been tested with Marconi:

Set Up Nodes

Step 0 - Install Prerequisites

CentOS 7 systems only:

yum install net-tools

Step 1 - Install Software

Create the directories for the Marconi components.

We recommend using a non-root user for the following steps. However, if you choose to use the "root" user you'll need to make sure you're always using "root" (or sudo with a non-"root" user) for the entire setup process AND every time you run mcli.

$ sudo mkdir -p /opt/marconi && sudo chown $USER:$USER /opt/marconi

Downloaded the binaries and untar them. (The URL is also available on the releases page.)

Ubuntu 16.04

$ cd /opt/marconi && curl -L https://marconi.download/mainnet/1.0.3/marconi-mcli-mainnet-v1.0.3-ubuntu.16.04.tar.gz | tar -xz

Ubuntu 18.04

$ cd /opt/marconi && curl -L https://marconi.download/mainnet/1.0.3/marconi-mcli-mainnet-v1.0.3-ubuntu.18.04.tar.gz | tar -xz

CentOS 7

$ cd /opt/marconi && curl -L https://marconi.download/mainnet/1.0.3/marconi-mcli-mainnet-v1.0.3-centos.7.6.tar.gz | tar -xz

Run mcli in upgrade mode to get all of the required components.

$ export PATH=$PATH:/opt/marconi/bin
$ mcli --mode=upgrade

Configure the setuid bit. See here for more information on why this is needed.

$ sudo chown root:root bin/marconid_linux_amd64
$ sudo chmod 4755 bin/marconid_linux_amd64

Step 2 - Create Account

Launch mcli

$ mcli

You're now in the home mode and will need to jump to the credential mode to create an account. Learn more about command line modes.

> j credential
> account create

This will display your account address. Make a note of this as it will be needed for tasks like creating a network.

WARNING: Remember the password used to create your account since it cannot be recovered if forgotten. It's good practice to create a backup if this isn't a test account.

FYI: If you are only interested in mining you can stop here and skip the Steps 3 & 4

Step 3 - Create Node ID

Generate a set of public and private keys for a node.

> key generate <0x_ACCOUNT_ADDRESS>

This will also output the nodeID. Note that NodeId's always start with "Nx" to help differentiate them from account addresses and network addresses. Make note of this as it will be used for tasks like adding a node to a network.

Step 4 - Run Components

Jump to the process mode to start all of the required components.

> j process

Start the Marconi components using the new account and nodeID.

> start gmeth
> start middleware
> start marconid

Step 5 - Fund Account

Network management actions will require Marconi tokens (marcos) to complete. If you're using the testnet go here to request marcos.

Once you have tokens you can now perform network actions like creating a network.

Create A Network

With Marconi it's simple to create a flat network across your nodes without requiring any additional bridges, routers or switches.

Step 0 - Setup Marconi

For this guide let's assume you have Node A, Node B and Node C and wish to connect them using Marconi.

Run through the setup instructions on each node. (You'll only need Marcos on Node A which we will use to manage the network.)

Make note of the NodeID for each node since you'll be referencing that later.

Step 1 - Create A Network (Node A)

On Node A:

Get the account address

$ mcli
> j credential
credential> account list

This will display a list of all the available accounts.

Unlock that account and then create a network. The account will automatically re-lock after thirty minutes.

> account unlock <0x_ACCOUNT_ADDRESS>
> j net
net> create use

Creating a network requires a block confirmation and can sometimes take over a minute.

This will output a network address. Make note of it since Node B and Node C will need to join this network later.

Step 2 - Add Nodes To The Network (Node A)

On Node A:

Use the NodeID's to create a relationship between all nodes in the network. Reminder: NodeID's always start with "Nx".

net> peer add_relation <Nx_NODEID_A> <Nx_NODEID_B>
net> peer add_relation <Nx_NODEID_B> <Nx_NODEID_C>
net> peer add_relation <Nx_NODEID_C> <Nx_NODEID_A>

Step 3 - Join Network (Node A, Node B & Node C)

On Node A, Node B and Node C:

Join the new network using the network address from Step 2

$ mcli
> j net
net> join <0x_NETWORK_ADDRESS>

Launch all Marconi components on Node A, Node B and Node C if they aren't already running from before.

$ mcli
> j process
process> start gmeth
process> start middleware
process> start marconid

It can take up to a minute or two for all of the mPipes to be established across the nodes.

Step 4 - Verify Connection

Without any additional hardware the Marconi Protocol created a flat network where each node peers with other nodes regardless of geographic location, cloud provider or underlying hardware (dedicated/cloud/container). Each node has a private IP and can talk to other nodes as if they were sitting next to each other in a data center. Many networking features that are typically blocked by the firewall rules used to secure a node (e.g. ICMP/ping) can run unimpeded on a Marconi Network. See the ping example below:

Ping

In a separate SSH session connect to Node A and check for the internal Marconi IP

$ ifconfig

Look for the interface named "mb42" and note the IP address. Marconi nodes use the 10.27.16.XXX IP address range. If you see a 10.42.0.XXX address please wait a little longer as this is just used for startup.

In a separate SSH session connect to Node B and ping internal Marconi IP for Node A

$ ping <IP address>

You can repeat this process with Node C.

Performance Testing with iperf3

If you want to go one step further, one tool that we use internally to evaluate network connections is iperf3. With this simple utility you can see performance metrics when sending both TCP and UDP traffic.

In a separate SSH session from where mcli is running on each node

  1. Install iperf on Node A and Node B

    $ sudo apt-get update
    $ sudo apt install iperf3
    
  2. On Node A set it as the iperf3 server

    $ iperf3 -s

  3. On Node B send traffic to Node A using iperf3

    For testing TCP traffic run

    $ iperf3 -c <NODE_A_MARCONI_IP>

    For testing UDP traffic run

    $ iperf3 -c <NODE_A_MARCONI_IP> -u

    When testing UDP traffic it's sometimes helpful to disable bandwidth limits

    $ iperf3 -c <NODE_A_MARCONI_IP> -u -b 0

Background Mode

For day to day use of the network it's not always practical to maintain open console sessions on each node. Now that the network is configured all of the Marconi components can be run in background mode.

It's possible run all of the Marconi components in background mode. This enables a Marconi network to persist without open console sessions on each node.

Once a node has been setup and has joined a Marconi network via mcli -console just run the following commands:

Start

$ ./bin/mcli -mode=daemon -start marconid
$ ./bin/mcli -mode=daemon -start middleware
$ ./bin/mcli -mode=daemon -start gmeth

Stop

$ ./bin/mcli -mode=daemon -stop marconid
$ ./bin/mcli -mode=daemon -stop middleware
$ ./bin/mcli -mode=daemon -stop gmeth

Restart

$ ./bin/mcli -mode=daemon -restart marconid
$ ./bin/mcli -mode=daemon -restart middleware
$ ./bin/mcli -mode=daemon -restart gmeth

To submit feedback or report technical issues, please email support@marconi.org

Clone this wiki locally