From e0b5ecf88ff4503a83e5eb5e9c19ccd18387127d Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Wed, 18 Dec 2024 15:55:47 -0500 Subject: [PATCH 1/9] Recast this as a node/baker/DAL tutorial --- docs/architecture/nodes.md | 2 ++ docs/tutorials/join-dal-baker.md | 21 +++++++++++++++---- docs/tutorials/join-dal-baker/run-baker.md | 5 +++-- docs/tutorials/join-dal-baker/run-dal-node.md | 3 ++- docs/tutorials/join-dal-baker/run-node.md | 2 +- sidebars.js | 2 +- 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/docs/architecture/nodes.md b/docs/architecture/nodes.md index c792c633f..f079555e9 100644 --- a/docs/architecture/nodes.md +++ b/docs/architecture/nodes.md @@ -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: diff --git a/docs/tutorials/join-dal-baker.md b/docs/tutorials/join-dal-baker.md index 4bb317620..53d2be2db 100644 --- a/docs/tutorials/join-dal-baker.md +++ b/docs/tutorials/join-dal-baker.md @@ -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 + +## 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. diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index a84784c1b..3bdbdd305 100644 --- a/docs/tutorials/join-dal-baker/run-baker.md +++ b/docs/tutorials/join-dal-baker/run-baker.md @@ -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: diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index 3327cbdf0..7e74aab24 100644 --- a/docs/tutorials/join-dal-baker/run-dal-node.md +++ b/docs/tutorials/join-dal-baker/run-dal-node.md @@ -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: 18 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. diff --git a/docs/tutorials/join-dal-baker/run-node.md b/docs/tutorials/join-dal-baker/run-node.md index f7657e04f..f11fa512f 100644 --- a/docs/tutorials/join-dal-baker/run-node.md +++ b/docs/tutorials/join-dal-baker/run-node.md @@ -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 diff --git a/sidebars.js b/sidebars.js index cdfba51ec..b44e10a63 100644 --- a/sidebars.js +++ b/sidebars.js @@ -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', From 52f1aec942a39a607f5e4f6abbaeb2f6e1f164df Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Wed, 18 Dec 2024 16:07:07 -0500 Subject: [PATCH 2/9] Make systemd service files consistent --- docs/tutorials/join-dal-baker/run-baker.md | 24 +++++++++++++++++++ docs/tutorials/join-dal-baker/run-dal-node.md | 10 ++++---- docs/tutorials/join-dal-baker/run-node.md | 23 ++++++++++++++++++ 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index 3bdbdd305..037d5b332 100644 --- a/docs/tutorials/join-dal-baker/run-baker.md +++ b/docs/tutorials/join-dal-baker/run-baker.md @@ -20,6 +20,30 @@ If you already have a baking daemon, you can restart it to connect to the DAL no 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 + After = network-online.target + Requires = octez-node.service + + [Install] + WantedBy = multi-user.target + + [Service] + Type=simple + User=mybaker + 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 diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index 7e74aab24..d0fbdd44f 100644 --- a/docs/tutorials/join-dal-baker/run-dal-node.md +++ b/docs/tutorials/join-dal-baker/run-dal-node.md @@ -118,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 + ExecStart=/usr/bin/octez-dal-node run --data-dir /opt/dal-node + WorkingDirectory=/opt/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 ``` diff --git a/docs/tutorials/join-dal-baker/run-node.md b/docs/tutorials/join-dal-baker/run-node.md index f11fa512f..b1209f048 100644 --- a/docs/tutorials/join-dal-baker/run-node.md +++ b/docs/tutorials/join-dal-baker/run-node.md @@ -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=mybaker + 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. From b5683f5290dfbc6540ee208909d0a74972e58d83 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Thu, 19 Dec 2024 11:07:46 -0500 Subject: [PATCH 3/9] Use default directory like the others --- docs/tutorials/join-dal-baker/run-dal-node.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index d0fbdd44f..32b47a2f3 100644 --- a/docs/tutorials/join-dal-baker/run-dal-node.md +++ b/docs/tutorials/join-dal-baker/run-dal-node.md @@ -2,7 +2,7 @@ title: "Step 3: Run an Octez DAL node" authors: Tezos core developers, Tim McMackin last_update: - date: 18 December 2024 + date: 19 December 2024 --- The DAL node is responsible for temporarily storing data and providing it to bakers and Smart Rollups. @@ -124,8 +124,8 @@ You can also refer to [Setting up Octez Services](https://tezos.gitlab.io/introd [Service] Type=simple User=mybaker - ExecStart=/usr/bin/octez-dal-node run --data-dir /opt/dal-node - WorkingDirectory=/opt/dal-node + 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/octez-dal-node.log From 025d1849217261c8b2353f04f9f63317c0593fe1 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Thu, 19 Dec 2024 11:18:17 -0500 Subject: [PATCH 4/9] Use the tezos user by default --- docs/tutorials/join-dal-baker/run-baker.md | 2 +- docs/tutorials/join-dal-baker/run-dal-node.md | 2 +- docs/tutorials/join-dal-baker/run-node.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index 037d5b332..5c2839ddc 100644 --- a/docs/tutorials/join-dal-baker/run-baker.md +++ b/docs/tutorials/join-dal-baker/run-baker.md @@ -34,7 +34,7 @@ You can also refer to [Run a persistent baking node](https://opentezos.com/node- [Service] Type=simple - User=mybaker + 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 diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index 32b47a2f3..8dcee65fb 100644 --- a/docs/tutorials/join-dal-baker/run-dal-node.md +++ b/docs/tutorials/join-dal-baker/run-dal-node.md @@ -123,7 +123,7 @@ You can also refer to [Setting up Octez Services](https://tezos.gitlab.io/introd [Service] Type=simple - User=mybaker + User=tezos ExecStart=/usr/bin/octez-dal-node run --data-dir $HOME/.tezos-dal-node WorkingDirectory=$HOME/.tezos-dal-node Restart=on-failure diff --git a/docs/tutorials/join-dal-baker/run-node.md b/docs/tutorials/join-dal-baker/run-node.md index b1209f048..b332819ee 100644 --- a/docs/tutorials/join-dal-baker/run-node.md +++ b/docs/tutorials/join-dal-baker/run-node.md @@ -115,7 +115,7 @@ You can also refer to [Run a persistent baking node](https://opentezos.com/node- [Service] Type=simple - User=mybaker + 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 From 879228b6ea79730b9383aee08743c3fbdb42b713 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Thu, 19 Dec 2024 15:08:53 -0500 Subject: [PATCH 5/9] Abbreviate DAL Co-authored-by: NicNomadic <148877430+NicNomadic@users.noreply.github.com> --- docs/tutorials/join-dal-baker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/join-dal-baker.md b/docs/tutorials/join-dal-baker.md index 53d2be2db..1586f7c6a 100644 --- a/docs/tutorials/join-dal-baker.md +++ b/docs/tutorials/join-dal-baker.md @@ -16,7 +16,7 @@ This tutorial covers setting up a Tezos node as a baker, which includes running - An Octez node, sometimes referred to as a Tezos node - A baker daemon -- A [Data Availability Layer](/architecture/data-availability-layer) node +- A [DAL](/architecture/data-availability-layer) node ## Why is a DAL node needed? From c9b4d49bf797228375007f1f623814efafb394f8 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Thu, 19 Dec 2024 15:10:03 -0500 Subject: [PATCH 6/9] Consistent spacing --- docs/tutorials/join-dal-baker/run-baker.md | 8 ++++---- docs/tutorials/join-dal-baker/run-dal-node.md | 10 +++++----- docs/tutorials/join-dal-baker/run-node.md | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index 5c2839ddc..3c96b1368 100644 --- a/docs/tutorials/join-dal-baker/run-baker.md +++ b/docs/tutorials/join-dal-baker/run-baker.md @@ -25,12 +25,12 @@ You can also refer to [Run a persistent baking node](https://opentezos.com/node- ```systemd [Unit] Description=Octez baker - Wants = network-online.target - After = network-online.target - Requires = octez-node.service + Wants=network-online.target + After=network-online.target + Requires=octez-node.service [Install] - WantedBy = multi-user.target + WantedBy=multi-user.target [Service] Type=simple diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index 8dcee65fb..1ad7fdd20 100644 --- a/docs/tutorials/join-dal-baker/run-dal-node.md +++ b/docs/tutorials/join-dal-baker/run-dal-node.md @@ -113,13 +113,13 @@ You can also refer to [Setting up Octez Services](https://tezos.gitlab.io/introd ```systemd [Unit] Description=Octez DAL node - Wants = network-online.target - After = network-online.target - Requires = octez-node.service + Wants=network-online.target + After=network-online.target + Requires=octez-node.service [Install] - WantedBy = multi-user.target - RequiredBy = octez-baker.service + WantedBy=multi-user.target + RequiredBy=octez-baker.service [Service] Type=simple diff --git a/docs/tutorials/join-dal-baker/run-node.md b/docs/tutorials/join-dal-baker/run-node.md index b332819ee..fb8a9ba08 100644 --- a/docs/tutorials/join-dal-baker/run-node.md +++ b/docs/tutorials/join-dal-baker/run-node.md @@ -107,11 +107,11 @@ You can also refer to [Run a persistent baking node](https://opentezos.com/node- ```systemd [Unit] Description=Octez node - Wants = network-online.target - After = network-online.target + Wants=network-online.target + After=network-online.target [Install] - WantedBy = multi-user.target + WantedBy=multi-user.target [Service] Type=simple From 03a58efa8f0306f35e4e5154c742cb95070e5dd1 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Thu, 19 Dec 2024 15:27:00 -0500 Subject: [PATCH 7/9] Command depends on protocol version --- docs/tutorials/join-dal-baker/run-baker.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index 3c96b1368..e9b7f2112 100644 --- a/docs/tutorials/join-dal-baker/run-baker.md +++ b/docs/tutorials/join-dal-baker/run-baker.md @@ -2,7 +2,7 @@ title: "Step 4: Run an Octez baking daemon" authors: Tezos core developers, Tim McMackin last_update: - date: 18 December 2024 + date: 19 December 2024 --- 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. @@ -14,6 +14,10 @@ If you already have a baking daemon, you can restart it to connect to the DAL no 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 ``` + Note that the command for the baker depends on the protocol version. + This example uses the ParisC protocol, so the command starts with `octez-baker-PsParisC`. + Check the current version of the protocol to see what command to run, and change this command when you upgrade to newer versions of the protocol. + You may append `>>"$HOME/octez-baker.log" 2>&1` to redirect its output in a log file. 1. Ensure that the baker runs persistently. From 658abdf45ecb2f7e11e53a3e9e3455e2cdba1b55 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Thu, 19 Dec 2024 15:27:09 -0500 Subject: [PATCH 8/9] Add accuser --- docs/tutorials/join-dal-baker/run-baker.md | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index e9b7f2112..c835cd6b1 100644 --- a/docs/tutorials/join-dal-baker/run-baker.md +++ b/docs/tutorials/join-dal-baker/run-baker.md @@ -128,3 +128,34 @@ Therefore, staking more tez brings more rewards but does not reduce the attestat - Attach DAL attestations: `ready to attach DAL attestation ...` Whether these messages appear or not after the attestation delay, proceed to [Step 5: Verifications](/tutorials/join-dal-baker/verify-rights). + +## Optional: Run an accuser + +The accuser is a daemon that monitors blocks and looks for problems, such as bakers who double-sign blocks or inject multiple attestations. +If it finds a problem, it posts a denunciation operation, which penalizes the baker. +You don't have to run an accuser, but if you do, you can receive some of the penalties when the accuser denounces a baker. + +Like the baker, the command for the accuser has the protocol name at the end. +For example, if your operating system uses the `systemd` software suite, the attester service file might look like this example: + +```systemd +[Unit] +Description=Octez accuser +Wants=network-online.target +After=network-online.target +Requires=octez-node.service + +[Install] +WantedBy=multi-user.target + +[Service] +Type=simple +User=tezos +ExecStart=octez-accuser-PsParisC run +WorkingDirectory=/opt/octez-accuser +Restart=on-failure +RestartSec=5 +StandardOutput=append:/opt/octez-accuser.log +StandardError=append:/opt/octez-accuser.log +SyslogIdentifier=%n +``` From ffc06ac28da42b909e535670af489a2a9b93dcae Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Thu, 19 Dec 2024 15:30:59 -0500 Subject: [PATCH 9/9] Add remote signer --- docs/tutorials/join-dal-baker/run-baker.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index c835cd6b1..600adae32 100644 --- a/docs/tutorials/join-dal-baker/run-baker.md +++ b/docs/tutorials/join-dal-baker/run-baker.md @@ -8,6 +8,8 @@ last_update: 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. Optional: Set up a remote signer to secure the keys that the baker uses as described in [Signer](https://tezos.gitlab.io/user/key-management.html#signer) in the Octez documentation. + 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: ```bash