Skip to main content

Beacon

The beacon node acts as a touchpoint for nodes to discover relay nodes in the cluster.

Using marlinctl2

Usage

$ sudo ./marlinctl beacon create --help
NAME:
marlinctl beacon create - create a new beacon

USAGE:
marlinctl beacon create [command options] [arguments...]

OPTIONS:
--program value --program <NAME> (default: "beacon")
--discovery-addr value --discovery-addr <IP:PORT> (default: 127.0.0.1:8002)
--heartbeat-addr value --heartbeat-addr <IP:PORT> (default: 127.0.0.1:8003)
--bootstrap-addr value, --beacon-addr value --bootstrap-addr <IP:PORT>
--version value --version <NUMBER> (default: "latest")
--help, -h show help (default: false)

Run

$ sudo ./marlinctl beacon create

Manually

Build

The beacon executable is built as part of OpenWeaver. See the README for build instructions.

Usage

$ ./beacon/beacon --help

USAGE: beacon [OPTIONS]

OPTIONS:
-d, --discovery-addr <discovery_addr>
-h, --heartbeat-addr <heartbeat_addr>
-b, --beacon-addr <beacon_addr>
-h, --help <help>
-v, --version <version>

Run

$ ./beacon/beacon

Discussion

The beacon executable supports two optional command-line arguments to set the discovery and heartbeat listener addresses. The discovery address enables nodes to discover the nodes in its registry and the heartbeat address enables nodes to add themselves to the registry.

By default, discovery-addr is set to 127.0.0.1:8002 and heartbeat-addr is set to 127.0.0.1:8003 to make it secure by default. This means that the beacon node can only be reached from localhost by default. To make it available for other nodes not on localhost, it needs to listen on external interfaces as well - usually using 0.0.0.0 to bind to all interfaces:

# Using marlinctl
$ sudo ./marlinctl beacon create --discovery-addr "0.0.0.0:8002" --heartbeat-addr "0.0.0.0:8003"
# Manually
$ ./beacon/beacon --discovery-addr "0.0.0.0:8002" --heartbeat-addr "0.0.0.0:8003"

In addition, the beacon node supports a --beacon-addr parameter to register the cluster with the wider Marlin Relay network.