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

Recast this as a node/baker/DAL tutorial #495

Merged
merged 11 commits into from
Dec 20, 2024
2 changes: 2 additions & 0 deletions docs/architecture/nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Nodes cooperate with clients and with each other through an [RPC interface](#the

The Octez suite, which is an implementation of the Tezos node and other executables, instantiates these principles in the [Octez software architecture](https://tezos.gitlab.io/shell/the_big_picture.html).

For instructions on running a node, see the tutorial [Run a Tezos node in 5 steps](/tutorials/join-dal-baker).

## Protocol and shell

The software that runs Tezos nodes is split into two main parts:
Expand Down
21 changes: 17 additions & 4 deletions docs/tutorials/join-dal-baker.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
---
title: Join the DAL as a baker in 5 steps
title: Run a Tezos node in 5 steps
authors: Tezos core developers, Tim McMackin
last_update:
date: 21 October 2024
date: 18 December 2024
---

As described in [Nodes](/architecutre/nodes), Tezos nodes are peer-to-peer programs that run the Tezos network.
Anyone can run a node, and they might do so for many different reasons, including:

- Running nodes makes the Tezos network resilient and secure
- Public nodes may have rate limits, so running your own node allows you to send unlimited requests to it to get information about Tezos or to send transactions from your dApps
- Running a node is part of being a baker and receiving the rewards for baking

This tutorial covers setting up a Tezos node as a baker, which includes running these processes:

- An Octez node, sometimes referred to as a Tezos node
- A baker daemon
- A [Data Availability Layer](/architecture/data-availability-layer) node
timothymcmackin marked this conversation as resolved.
Show resolved Hide resolved

## Why is a DAL node needed?

The Tezos data availability layer (DAL) is a peer-to-peer network that Tezos Smart Rollups can use to fetch data securely.
The DAL is a key component for the scalability and bandwidth of Tezos and it's important for bakers to run DAL nodes along with their layer 1 nodes.

## Why are DAL bakers needed?

When users and dApps submit data to the DAL, bakers use DAL nodes to verify that the data is available.
Then the bakers attest that the data is available.
Smart Rollup nodes can retrieve the data from DAL nodes only when enough bakers have attested that the data is available.
Expand Down
29 changes: 27 additions & 2 deletions docs/tutorials/join-dal-baker/run-baker.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
title: "Step 4: Run an Octez baking daemon"
authors: Tezos core developers, Tim McMackin
last_update:
date: 2 December 2024
date: 18 December 2024
---

Now that you have a DAL node, you can run a baking daemon that can attest to DAL data or restart an existing baking daemon to connect it to the DAL node.
Now that you have a layer 1 node and a DAL node, you can run a baking daemon that can create blocks and attests to DAL data.
If you already have a baking daemon, you can restart it to connect to the DAL node.

1. To run a baking daemon that connects to the DAL, start it as usual and pass the URL to your DAL node to it with the `--dal-node` argument:

Expand All @@ -19,6 +20,30 @@ Now that you have a DAL node, you can run a baking daemon that can attest to DAL
Look up how to run programs persistently in the documentation for your operating system.
You can also refer to [Run a persistent baking node](https://opentezos.com/node-baking/baking/persistent-baker/) on opentezos.com.

For example, if your operating system uses the `systemd` software suite, your service file might look like this example:

```systemd
[Unit]
Description=Octez baker
Wants = network-online.target
timothymcmackin marked this conversation as resolved.
Show resolved Hide resolved
After = network-online.target
Requires = octez-node.service

[Install]
WantedBy = multi-user.target

[Service]
Type=simple
User=tezos
ExecStart=octez-baker-PsParisC run with local node "$HOME/.tezos-node" my_baker --liquidity-baking-toggle-vote pass --adaptive-issuance-vote on --dal-node http://127.0.0.1:10732
WorkingDirectory=/opt/octez-baker
Restart=on-failure
RestartSec=5
StandardOutput=append:/opt/octez-baker.log
StandardError=append:/opt/octez-baker.log
SyslogIdentifier=%n
```

1. In the same terminal window, run this command:

```bash
Expand Down
15 changes: 8 additions & 7 deletions docs/tutorials/join-dal-baker/run-dal-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
title: "Step 3: Run an Octez DAL node"
authors: Tezos core developers, Tim McMackin
last_update:
date: 2 December 2024
date: 19 December 2024
---

The DAL node is responsible for temporarily storing data and providing it to bakers and Smart Rollups.
Follow these steps to run the DAL node:

1. Ensure that the port that the DAL node runs on (by default, 11732) is accessible from outside its system.
You may need to adapt your firewall rules or set up network address translation (NAT) to direct external traffic to the DAL node.
Expand Down Expand Up @@ -117,18 +118,18 @@ You can also refer to [Setting up Octez Services](https://tezos.gitlab.io/introd
Requires = octez-node.service

[Install]
WantedBy=multi-user.target
WantedBy = multi-user.target
RequiredBy = octez-baker.service

[Service]
Type=simple
User=mybaker
ExecStart=/usr/bin/octez-dal-node run --data-dir /opt/dal
WorkingDirectory=/opt/dal
User=tezos
ExecStart=/usr/bin/octez-dal-node run --data-dir $HOME/.tezos-dal-node
WorkingDirectory=$HOME/.tezos-dal-node
Restart=on-failure
RestartSec=5
StandardOutput=append:/opt/dal/octez-dal-node.log
StandardError=append:/opt/dal/octez-dal-node.log
StandardOutput=append:/opt/octez-dal-node.log
StandardError=append:/opt/octez-dal-node.log
SyslogIdentifier=%n
```

Expand Down
25 changes: 24 additions & 1 deletion docs/tutorials/join-dal-baker/run-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ last_update:
date: 2 December 2024
---

The first thing you need to run a baker and a DAL node is a Tezos layer 1 node, which is an instance of the `octez-node` program and part of the Octez suite of programs.
The first thing you need is a Tezos layer 1 node, which is an instance of the `octez-node` program and part of the Octez suite of programs.

## Installing Octez

Expand Down Expand Up @@ -102,6 +102,29 @@ For example, the command to download a Ghostnet snapshot from the European serve
Look up how to run programs persistently in the documentation for your operating system.
You can also refer to [Run a persistent baking node](https://opentezos.com/node-baking/baking/persistent-baker/) on opentezos.com or [Setting up Octez Services](https://tezos.gitlab.io/introduction/services.html) in the Octez documentation.

For example, if your operating system uses the `systemd` software suite, your service file might look like this example:

```systemd
[Unit]
Description=Octez node
Wants = network-online.target
After = network-online.target

[Install]
WantedBy = multi-user.target

[Service]
Type=simple
User=tezos
ExecStart=octez-node run --rpc-addr 127.0.0.1:8732 --data-dir $HOME/.tezos-node
WorkingDirectory=/opt/octez-node
Restart=on-failure
RestartSec=5
StandardOutput=append:/opt/octez-node.log
StandardError=append:/opt/octez-node.log
SyslogIdentifier=%n
```

1. Optional: When the node has bootstrapped and caught up with the current head block, you can delete the snapshot file to save space.

In the meantime, you can continue the baking infrastructure while the node is bootstrapping.
Expand Down
2 changes: 1 addition & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ const sidebars = {
'tutorials/create-an-nft/nft-tznft',
{
type: 'category',
label: 'Join the DAL as a baker',
label: 'Run a Tezos node in 5 steps',
link: {
type: 'doc',
id: 'tutorials/join-dal-baker',
Expand Down
Loading