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

Running a sequencer #227

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
--chain=dancebox \
--name=INSERT_YOUR_TANSSI_NODE_NAME \
--sync=warp \
--base-path=/data/para \
--name=INSERT_YOUR_SEQUENCER_NODE_NAME \
--base-path=/data/container \
--telemetry-url='wss://telemetry.polkadot.io/submit/ 0' \
--database=paritydb \
--rpc-port=9944 \
--prometheus-port=9615 \
--prometheus-external \
--listen-addr=/ip4/0.0.0.0/tcp/30333 \
--state-pruning=2000 \
--blocks-pruning=2000 \
--db-cache=1024 \
--trie-cache-size=1073741824 \
--rpc-cors=all \
--unsafe-rpc-external \
--collator \
--telemetry-url='wss://telemetry.polkadot.io/submit/ 0' \
--database paritydb \
--node-key-file /data/node-key \
--in-peers=100 \
--detailed-log-output \
-- \
--name=INSERT_YOUR_BLOCK_PRODUCER_NODE_NAME \
--base-path=/data/container \
--telemetry-url='wss://telemetry.polkadot.io/submit/ 0' \
-- \
--chain=westend_moonbase_relay_testnet \
--name=INSERT_YOUR_RELAY_NODE_NAME \
--chain=/chain-network/relay-raw-no-bootnodes-specs.json \
--name=INSERT_YOUR_TANSSI_NODE_NAME \
--sync=fast \
--base-path=/data/relay \
--base-path=/data/relay \
--rpc-port=9945 \
--prometheus-port=9616 \
--prometheus-external \
--listen-addr=/ip4/0.0.0.0/tcp/30334 \
--pool-limit=0 \
--db-cache=128 \
--rpc-cors=all \
--rpc-methods=safe \
--out-peers=15 \
--state-pruning=2000 \
--blocks-pruning=2000 \
--telemetry-url='wss://telemetry.polkadot.io/submit/ 0' \
--database paritydb
--database=paritydb \
--bootnodes=/dns4/fraa-stagelight-rpc-0.a.stagenet.tanssi.network/tcp/30334/p2p/12D3KooWCUwf99GjNKtDJ7SnuGPaecdiugiWJ3pr9JdoH27BW2tZ \
--bootnodes=/dns4/fraa-stagelight-rpc-1.a.stagenet.tanssi.network/tcp/30334/p2p/12D3KooWHRQfPBf82SUU39CFh5jcUT1TL2ZvvTWvnbtghxqqNQwa
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Starting from [runtime 700 release](https://github.com/moondance-labs/tanssi/releases/tag/runtime-700){target=\_blank}, Tanssi block producer nodes don't generate the session keys automatically on start-up. To generate and store on disk the session keys that will be referenced on the start-up command, run the following command:
Starting from [runtime 700 release](https://github.com/moondance-labs/tanssi/releases/tag/runtime-700){target=\_blank}, Tanssi sequencer nodes don't generate the session keys automatically on start-up. To generate and store on disk the session keys that will be referenced on the start-up command, run the following command:
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
One of Tanssi's core propositions is that it provides decentralized and trustless block production for its networks. Tanssi's runtime handles sequencer assignments to all the active networks in the Tanssi ecosystem.

Each time, the assignment algorithm distributes the available block producers per session, assigning them to a random chain. Consequently, they would be producing blocks for the same network only for a relatively short period, increasing the overall security of the ecosystem.
Each time, the assignment algorithm distributes the available set of sequencers per session, assigning them to a random chain. Consequently, they would be producing blocks for the same network only for a relatively short period, increasing the overall security of the ecosystem.

To this end, Tanssi's binary file (the software used to run nodes) already has an embedded mechanism to switch block production automatically to the assigned chain without requiring the node operator to make any changes. The binary includes the logic to sync the new chain and produce blocks when the session changes. Consequently, sequencers need to run the Tanssi binary file, and not that of the networks (like full nodes).
2 changes: 1 addition & 1 deletion node-operators/sequencers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ template: index-page.html

# Tanssi Sequencers

Becoming a sequencer is a critical role in maintaining the security and efficiency of the Tanssi ecosystem. Sequencers are responsible for producing blocks, validating transactions, and ensuring the smooth operation of the network. This section provides everything you need to get started, from initial setup to operational best practices and account management.
Sequencers play a critical role in maintaining the liveness and performance of the Tanssi ecosystem. Sequencers are responsible for producing blocks, executing transactions, and ensuring the smooth operation of the network. This section provides everything you need to get started, from initial setup to operational best practices and account management.

## Explore This Section

Expand Down
50 changes: 25 additions & 25 deletions node-operators/sequencers/offboarding/account.md

Large diffs are not rendered by default.

62 changes: 30 additions & 32 deletions node-operators/sequencers/onboarding/account-setup.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions node-operators/sequencers/onboarding/index.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
title: Onboard to Run a Sequencer Node
description: Learn how to get started to run a sequencer (also known as producer nodes) using Docker or Systemd to participate in the protocol.
description: Learn how to get started to run a sequencer using Docker or Systemd to participate in the protocol, provide block production services, and earn rewards.
icon: octicons-arrow-up-right-24
template: index-page.html
---

# Onboarding

Starting your journey as a sequencer begins here. This section covers the foundational steps to set up your node and prepare your account for active participation in the Tanssi network.
Your journey as a sequencer begins here. This section covers the foundational steps to set up your node and prepare your account for active participation in the Tanssi network.

Use the following resources to get started as a sequencer:

- [**Hardware requirements**](/node-operators/sequencers/onboarding/run-a-sequencer/#hardware-requirements) - understand the recommended hardware specifications to ensure optimal performance of your sequencer node
- [**Port configuration**](/node-operators/sequencers/onboarding/run-a-sequencer/#required-network-ports) - learn which network ports need to be open to facilitate proper communication within the Tanssi ecosystem
- **Session keys setup** - detailed instructions on [generating](/node-operators/sequencers/onboarding/account-setup/#map-account) and [managing](/node-operators/sequencers/onboarding/account-setup/#map-session-keys) session keys, a vital step for enabling block production capabilities
- **Node deployment** - choose between [Docker](/node-operators/sequencers/onboarding/run-a-sequencer/sequencers-docker/) and [systemd](/node-operators/sequencers/onboarding/run-a-sequencer/sequencers-systemd/) for deploying your node, with step-by-step guides tailored for each method
- **Node deployment** - choose between [Docker](/node-operators/sequencers/onboarding/run-a-sequencer/sequencers-docker/) and [systemd](/node-operators/sequencers/onboarding/run-a-sequencer/sequencers-systemd/) for running your node, with step-by-step guides tailored for each method

## Explore This Section

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Run a Sequencer
description: Learn how to set up and run sequencer node (also known as block producers or collators) using Docker or Systemd to participate in the protocol.
description: Learn how to set up and run a sequencer node using Docker or Systemd to participate in the protocol, providing block production services and earning rewards.
icon: octicons-server-24
template: index-page.html
---

# Run a Sequencer Node

Setting up a sequencer node is an important step to participate in the Tanssi network. You have two options for configuration: using _Docker_ or _Systemd._ Whichever path you choose, we provide step-by-step tutorials to guide you through the process and ensure your node meets the necessary requirements to produce blocks and maintain a secure connection to the network.
Setting up a sequencer node is an important step to participate in the Tanssi network. You have two options: _Docker_ or _Systemd_. Whichever path you choose, we provide step-by-step tutorials to guide you through the process and ensure your node meets the necessary requirements to produce blocks and maintain a secure connection to the network.

### Hardware Requirements

Expand All @@ -24,12 +24,11 @@ Recommended Hardware:

### Required Network Ports

For successful block production, your node must synchronize and interact with three peer-to-peer (P2P) networks. To ensure proper communication within the Tanssi ecosystem, make sure the following ports are open for incoming:
For successful block production, your node must synchronize and interact with two peer-to-peer (P2P) networks. To ensure proper communication within the Tanssi ecosystem, make sure the following ports are open for incoming:

| Network | Port |
|------------------|-------------|
| Tanssi Chain | 30333 (TCP) |
| Relay Chain | 30334 (TCP) |
| Assigned Network | 30335 (TCP) |

## Explore This Section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ description: Learn how to set up and run a sequencer (aka block producer) for Ta
icon: simple-docker
---

# Run a Block Producer in Tanssi Using Docker
# Run a Sequencer in Tanssi Using Docker

## Introduction {: #introduction }

--8<-- 'text/node-operators/sequencers/onboarding/run-a-sequencer/intro.md'

In this guide, you'll learn how to spin up a Tanssi block producer to be part of the shared pool of sequencers using [Docker](https://www.docker.com){target=\_blank} on a Linux computer. However, it can be adapted to other operating systems.
In this guide, you'll learn how to spin up a Tanssi sequencer to be part of the shared pool of sequencers using [Docker](https://www.docker.com){target=\_blank} on a Linux computer. However, it can be adapted to other operating systems.

## Checking Prerequisites {: #checking-prerequisites }

--8<-- 'text/node-operators/installing-docker.md'

### Pulling the Docker Image {: #pulling-docker-image }

A Docker image is built and published in every release, containing all the necessary dependencies a Tanssi block producer requires and the binary file itself.
A Docker image is built and published in every release, containing all the necessary dependencies a Tanssi sequencer requires and the binary file itself.

A Docker image combines the binary corresponding to the latest stable release of the [client node](/learn/framework/architecture/#architecture){target=\_blank}, along with the Tanssi orchestrator specification file.

Expand All @@ -34,9 +34,9 @@ The command will download and extract the image and show the status upon executi

### Setup the Data Directory {: #setup-data-directory }

Running a block producer requires syncing with three chains: the relay chain, the Tanssi chain, and the network it has been assigned to.
Running a sequencer requires syncing with two chains: the Tanssi chain and the network it has been assigned to.

Run the following command to create the directory where your block producer will store the databases containing blocks and chain states:
Run the following command to create the directory where your sequencer will store the databases containing blocks and chain states:

```bash
mkdir /var/lib/dancebox
Expand All @@ -48,7 +48,7 @@ Set the folder's ownership to the account that will run the Docker image to ensu
chown INSERT_DOCKER_USER /var/lib/dancebox
```

Or run the following command if you want to run the block producer with the current logged-in user:
Or run the following command if you want to run the sequencer with the current logged-in user:

```bash
sudo chown -R $(id -u):$(id -g) /var/lib/dancebox
Expand All @@ -73,13 +73,12 @@ moondancelabs/tanssi key generate-node-key --file /data/node-key

To spin up your node, you must run the Docker image with the `docker run` command.

Note that the command contains three sections, divided by `-- \`:
Note that the command contains two sections, divided by `-- \`:

- **Tanssi protocol section** - it contains the flags to run the Tanssi node
- **Block producer section** - it contains the flags to run the block producer node. It is abstract enough to be dynamically adapted in runtime to the specific chain the node will serve
- **Relay chain section** - contains the flag to run the relay chain node
- **Sequencer section** - it contains the flags to run the sequencer node. It is abstract enough to be dynamically adapted in runtime to the specific chain the node will serve

Name each of the sections with a human-readable name by replacing the `INSERT_YOUR_TANSSI_NODE_NAME`, `INSERT_YOUR_BLOCK_PRODUCER_NODE_NAME`, and `INSERT_YOUR_RELAY_NODE_NAME` tags in the `--name` flags. These names will come in handy for connecting the log entries and metrics with the node that generates them.
Name each of the sections with a human-readable name by replacing the `INSERT_YOUR_TANSSI_NODE_NAME` and `INSERT_YOUR_SEQUENCER_NODE_NAME` tags in the `--name` flags. These names will come in handy for connecting the log entries and metrics with the node that generates them.

--8<-- 'text/node-operators/optimized-binaries-note.md'

Expand All @@ -88,7 +87,7 @@ Name each of the sections with a human-readable name by replacing the `INSERT_YO
```bash
docker run --network="host" -v "/var/lib/dancebox:/data" \
-u $(id -u ${USER}):$(id -g ${USER}) \
moondancelabs/tanssi \
moondancelabs/tanssi solo-chain \
--8<-- 'code/node-operators/sequencers/onboarding/run-a-sequencer/sequencers-docker/docker-command.md'
```

Expand All @@ -97,7 +96,7 @@ Name each of the sections with a human-readable name by replacing the `INSERT_YO
```bash
docker run --network="host" -v "/var/lib/dancebox:/data" \
-u $(id -u ${USER}):$(id -g ${USER}) \
--entrypoint "/tanssi/tanssi-node-skylake" \
--entrypoint "/tanssi/tanssi-node-skylake solo-chain" \
moondancelabs/tanssi \
--8<-- 'code/node-operators/sequencers/onboarding/run-a-sequencer/sequencers-docker/docker-command.md'
```
Expand All @@ -106,7 +105,7 @@ Name each of the sections with a human-readable name by replacing the `INSERT_YO
```bash
docker run --network="host" -v "/var/lib/dancebox:/data" \
-u $(id -u ${USER}):$(id -g ${USER}) \
--entrypoint "/tanssi/tanssi-node-znver3" \
--entrypoint "/tanssi/tanssi-node-znver3 solo-chain" \
moondancelabs/tanssi \
--8<-- 'code/node-operators/sequencers/onboarding/run-a-sequencer/sequencers-docker/docker-command.md'
```
Expand All @@ -118,13 +117,13 @@ The flags used in the `docker run` command can be adjusted according to your pre
--8<-- 'text/node-operators/network-node/run-flags.md'

```bash
docker run -ti moondancelabs/tanssi --help
docker run -ti moondancelabs/tanssi-node --help
```

## Syncing Your Node {: #syncing-your-node }

The first time your node spins up, the syncing process displays lots of log information from the node configuration, the relay chain, and the node itself. Some errors are expected to be displayed at the beginning of the process, disappearing once the chain gets synced to the last block.
The first time your node spins up, the syncing process displays lots of log information from the node configuration and the node itself. Some errors are expected to be displayed at the beginning of the process, disappearing once the chain gets synced to the last block.

--8<-- 'code/node-operators/terminal/syncing-process.md'

When the syncing with the relay chain and the Tanssi orchestrator is finished, the node will still need to sync with the network it has been assigned to. The syncing with the chain served by the block producer node will happen every time the block producer is rotated.
When the syncing with the Tanssi orchestrator is finished, the node will still need to sync with the network it has been assigned to. The syncing with the chain served by the sequencer node will happen every time the sequencer is rotated.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ description: Learn how to set up and run a sequencer (block producer) node for T
icon: simple-linux
---

# Run a Block Producer Node Using Systemd
# Run a Sequencer Node Using Systemd

## Introduction {: #introduction }

--8<-- 'text/node-operators/sequencers/onboarding/run-a-sequencer/intro.md'

In this guide, you'll learn how to spin up a Tanssi block producer to be part of the shared pool of sequencers using the latest stable binary file release and managing the service with [Systemd](https://systemd.io){target=\_blank} on Linux systems.
In this guide, you'll learn how to spin up a Tanssi sequencer to be part of the shared pool of sequencers using the latest stable binary file release and managing the service with [Systemd](https://systemd.io){target=\_blank} on Linux systems.

The article follows the good practice of running the service with its own non-root account and granting that account write access to a specific directory. However, you can adapt this article's steps and instructions to your infrastructure configuration, preferences, and security policies.

Expand Down Expand Up @@ -97,7 +97,7 @@ You can create the file by running the following command:
sudo touch /etc/systemd/system/tanssi.service
```

Now you can open the file using your favorite text editor (vim, emacs, nano, etc) and add the configuration for the service, replacing the `INSERT_YOUR_TANSSI_NODE_NAME` and `INSERT_YOUR_RELAY_NODE_NAME` tags with a human-readable text in the `--name` flags. These names will come in handy for connecting the log entries and metrics with the node that generates them.
Now you can open the file using your favorite text editor (vim, emacs, nano, etc) and add the configuration for the service, replacing the `INSERT_YOUR_TANSSI_NODE_NAME` and `INSERT_YOUR_SEQUENCER_NODE_NAME` tags with a human-readable text in the `--name` flags. These names will come in handy for connecting the log entries and metrics with the node that generates them.

```bash
[Unit]
Expand All @@ -113,30 +113,44 @@ User=tanssi_service
SyslogIdentifier=tanssi
SyslogFacility=local7
KillSignal=SIGHUP
ExecStart=/var/lib/tanssi-data/tanssi-node \
--chain=dancebox \
--name=INSERT_YOUR_TANSSI_NODE_NAME \
--sync=warp \
--base-path=/var/lib/tanssi-data/para \
ExecStart=/var/lib/tanssi-data/tanssi-node solo-chain \
--name=INSERT_YOUR_SEQUENCER_NODE_NAME \
--base-path=/data/container \
--telemetry-url='wss://telemetry.polkadot.io/submit/ 0' \
--database=paritydb \
--rpc-port=9944 \
--prometheus-port=9615 \
--prometheus-external \
--listen-addr=/ip4/0.0.0.0/tcp/30333 \
--state-pruning=2000 \
--blocks-pruning=2000 \
--db-cache=1024 \
--trie-cache-size=1073741824 \
--rpc-cors=all \
--unsafe-rpc-external \
--collator \
--database paritydb \
--telemetry-url='wss://telemetry.polkadot.io/submit/ 0' \
--node-key-file /var/lib/tanssi-data/node-key \
--in-peers=100 \
--detailed-log-output \
-- \
--name=INSERT_YOUR_BLOCK_PRODUCER_NODE_NAME \
--base-path=/var/lib/tanssi-data/container \
--telemetry-url='wss://telemetry.polkadot.io/submit/ 0'
-- \
--chain=westend_moonbase_relay_testnet \
--name=INSERT_YOUR_RELAY_NODE_NAME \
--chain=/chain-network/relay-raw-no-bootnodes-specs.json \
--name=INSERT_YOUR_TANSSI_NODE_NAME \
--sync=fast \
--base-path=/var/lib/tanssi-data/relay \
--base-path=/data/relay \
--rpc-port=9945 \
--prometheus-port=9616 \
--prometheus-external \
--listen-addr=/ip4/0.0.0.0/tcp/30334 \
--pool-limit=0 \
--db-cache=128 \
--rpc-cors=all \
--rpc-methods=safe \
--out-peers=15 \
--state-pruning=2000 \
--blocks-pruning=2000 \
--database paritydb \
--telemetry-url='wss://telemetry.polkadot.io/submit/ 0'
--telemetry-url='wss://telemetry.polkadot.io/submit/ 0' \
--database=paritydb \
--bootnodes=/dns4/fraa-stagelight-rpc-0.a.stagenet.tanssi.network/tcp/30334/p2p/12D3KooWCUwf99GjNKtDJ7SnuGPaecdiugiWJ3pr9JdoH27BW2tZ \
--bootnodes=/dns4/fraa-stagelight-rpc-1.a.stagenet.tanssi.network/tcp/30334/p2p/12D3KooWHRQfPBf82SUU39CFh5jcUT1TL2ZvvTWvnbtghxqqNQwa

[Install]
WantedBy=multi-user.target
Expand Down
Loading