From 07b40198593ddd1c8c669a030b8833e35c2e5c8e Mon Sep 17 00:00:00 2001 From: Nic Volanschi Date: Fri, 29 Nov 2024 15:55:10 +0100 Subject: [PATCH 01/12] a few fixes after following the tutorial --- docs/tutorials/join-dal-baker/run-baker.md | 2 +- docs/tutorials/join-dal-baker/run-dal-node.md | 6 ++++-- docs/tutorials/join-dal-baker/run-node.md | 3 ++- docs/tutorials/join-dal-baker/verify-rights.md | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index ab3961a24..223400a6b 100644 --- a/docs/tutorials/join-dal-baker/run-baker.md +++ b/docs/tutorials/join-dal-baker/run-baker.md @@ -36,7 +36,7 @@ You can also refer to [Run a persistent baking node](https://opentezos.com/node- This command returns all of the topics that the baker is subscribed to in the format `{"slot_index":,"pkh":"
"}` where `index` varies between `0` included and the number of slot indexes excluded. - You can also look at the baker logs to see if it injects the expected operations. At each level, the baker is expected to: + You can also look at the baker logs to see if it injects the expected operations. At each level, the baker is expected to do a subset of these operations: - Receive a block proposal (log message: "received new proposal ... at level ..., round ...") - Inject a preattestation for it (log message: "injected preattestation ... for my_baker (<address>) for level ..., round ...") diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index 551d82001..f5ddcf5ac 100644 --- a/docs/tutorials/join-dal-baker/run-dal-node.md +++ b/docs/tutorials/join-dal-baker/run-dal-node.md @@ -7,7 +7,7 @@ last_update: The DAL node is responsible for temporarily storing data and providing it to bakers and Smart Rollups. -1. Ensure that the port that the DAL node runs on is accessible from outside its system. +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. For more information, see [Running a DAL attester node](https://tezos.gitlab.io/shell/dal_run.html) in the Octez documentation. @@ -16,7 +16,7 @@ For example, this command initializes the DAL node with the address of a local ` ```bash octez-dal-node config init --endpoint http://127.0.0.1:8732 \ - --attester-profiles=tz1QCVQinE8iVj1H2fckqx6oiM85CNJSK9Sx + --attester-profiles=tz1... ``` You cannot use the `my_baker` alias from the Octez client as in the previous section, so you must specify the address of your baker's account explicitly. @@ -38,6 +38,8 @@ For example, this command initializes the DAL node with the address of a local ` curl http://localhost:10732/p2p/points/info ``` + where ``10732`` is the port on which the DAL node serves RPC calls. + The response lists the network connections that the DAL node has, as in this example: ```json diff --git a/docs/tutorials/join-dal-baker/run-node.md b/docs/tutorials/join-dal-baker/run-node.md index 610afa90f..a7c84328e 100644 --- a/docs/tutorials/join-dal-baker/run-node.md +++ b/docs/tutorials/join-dal-baker/run-node.md @@ -44,9 +44,10 @@ For example, to initialize it for Ghostnet, run this command: ``` By default, the node stores its data in the folder `$HOME/.tezos-node`. + If this directory is not empty, you may have need to rename it (to keep its data) or remove it. 1. Download a rolling snapshot of the network from https://snapshot.tzinit.org based on the instructions on that site. -For example, the command to download a Ghostnet snapshot from the EU servers might look like this: +For example, the command to download a Ghostnet snapshot from the European servers might look like this: ```bash wget -O snapshot_file https://snapshots.eu.tzinit.org/ghostnet/rolling diff --git a/docs/tutorials/join-dal-baker/verify-rights.md b/docs/tutorials/join-dal-baker/verify-rights.md index 26344a765..69dcb8c27 100644 --- a/docs/tutorials/join-dal-baker/verify-rights.md +++ b/docs/tutorials/join-dal-baker/verify-rights.md @@ -18,7 +18,7 @@ Follow these steps to verify that your DAL node is receiving attestation rights: 1. Run this command to get the attestation rights for the baker in the current cycle: ```bash - octez-client rpc get /chains/main/blocks/head/helpers/attestation_rights?delegate="$MY_BAKER" + octez-client rpc get "/chains/main/blocks/head/helpers/attestation_rights?delegate=$MY_BAKER" ``` If the baker has no rights, the command returns an empty array: `[]`. From 95b506396b540fdaabf705399614ab2ae644fea0 Mon Sep 17 00:00:00 2001 From: Nic Volanschi Date: Fri, 29 Nov 2024 18:42:51 +0100 Subject: [PATCH 02/12] remove double backticks --- docs/tutorials/join-dal-baker/run-dal-node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index f5ddcf5ac..fc700f061 100644 --- a/docs/tutorials/join-dal-baker/run-dal-node.md +++ b/docs/tutorials/join-dal-baker/run-dal-node.md @@ -38,7 +38,7 @@ For example, this command initializes the DAL node with the address of a local ` curl http://localhost:10732/p2p/points/info ``` - where ``10732`` is the port on which the DAL node serves RPC calls. + where `10732` is the port on which the DAL node serves RPC calls. The response lists the network connections that the DAL node has, as in this example: From 65604f77dc777c20c0be577fcf28e0d6daf970d5 Mon Sep 17 00:00:00 2001 From: NicNomadic <148877430+NicNomadic@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:30:50 +0100 Subject: [PATCH 03/12] Update docs/tutorials/join-dal-baker/verify-rights.md fix command for checking rights for the current cycle --- docs/tutorials/join-dal-baker/verify-rights.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/tutorials/join-dal-baker/verify-rights.md b/docs/tutorials/join-dal-baker/verify-rights.md index 69dcb8c27..1b6d22080 100644 --- a/docs/tutorials/join-dal-baker/verify-rights.md +++ b/docs/tutorials/join-dal-baker/verify-rights.md @@ -18,7 +18,8 @@ Follow these steps to verify that your DAL node is receiving attestation rights: 1. Run this command to get the attestation rights for the baker in the current cycle: ```bash - octez-client rpc get "/chains/main/blocks/head/helpers/attestation_rights?delegate=$MY_BAKER" + octez-client rpc get "/chains/main/blocks/head" | jq '.metadata.level_info.cycle' + octez-client rpc get "/chains/main/blocks/head/helpers/attestation_rights?delegate=$MY_BAKER&cycle=" ``` If the baker has no rights, the command returns an empty array: `[]`. From 39a89738714572c00732a7106ab1b20f4dadb9a8 Mon Sep 17 00:00:00 2001 From: Nic Volanschi Date: Mon, 2 Dec 2024 14:46:45 +0100 Subject: [PATCH 04/12] various fixes --- docs/tutorials/join-dal-baker/run-baker.md | 4 +- docs/tutorials/join-dal-baker/run-dal-node.md | 4 +- docs/tutorials/join-dal-baker/run-node.md | 6 ++- .../tutorials/join-dal-baker/verify-rights.md | 46 ++++++++----------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index 223400a6b..f8100cfb2 100644 --- a/docs/tutorials/join-dal-baker/run-baker.md +++ b/docs/tutorials/join-dal-baker/run-baker.md @@ -10,9 +10,11 @@ Now that you have a DAL node, you can run a baking daemon that can attest to DAL 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 - 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 >> "$HOME/octez-baker.log" 2>&1 + 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 ``` + You may append `>>"$HOME/octez-baker.log" 2>&1` to redirect its output in a log file. + 1. Ensure that the baker runs persistently. 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. diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index fc700f061..06bc2f47f 100644 --- a/docs/tutorials/join-dal-baker/run-dal-node.md +++ b/docs/tutorials/join-dal-baker/run-dal-node.md @@ -24,9 +24,11 @@ For example, this command initializes the DAL node with the address of a local ` 1. Start the DAL node by running this command: ```bash - octez-dal-node run >> "$HOME/octez-dal-node.log" 2>&1 + octez-dal-node run ``` + You may append `>>"$HOME/octez-dal-node.log" 2>&1` to redirect its output in a log file. + This, too, may take some time to launch the first time because it needs to generate a new identity file, this time for the DAL network. If you need to change the address or port that the DAL node listens for connections to other nodes on, pass the `--public-addr` argument. diff --git a/docs/tutorials/join-dal-baker/run-node.md b/docs/tutorials/join-dal-baker/run-node.md index a7c84328e..2ba990a7b 100644 --- a/docs/tutorials/join-dal-baker/run-node.md +++ b/docs/tutorials/join-dal-baker/run-node.md @@ -64,16 +64,18 @@ For example, the command to download a Ghostnet snapshot from the European serve 1. Start the node: ``` - octez-node run --rpc-addr 127.0.0.1:8732 --log-output="$HOME/octez-node.log" + octez-node run --rpc-addr 127.0.0.1:8732 ``` + You may add option `--log-output="$HOME/octez-node.log"` to redirect its output in a log file. + At first launch, the node generates a fresh identity file used to identify itself on the network. Then it bootstraps the chain, which takes a variable amount of time depending on how many blocks need to be loaded. You don't need to wait for the node to bootstrap now. 1. Ensure that the node runs persistently. 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. +You can also refer to [Setting up Octez Services](https://tezos.gitlab.io/introduction/services.html) in the Octez documentation. 1. Optional: When the node has bootstrapped and caught up with the current head block, you can delete the snapshot file to save space. diff --git a/docs/tutorials/join-dal-baker/verify-rights.md b/docs/tutorials/join-dal-baker/verify-rights.md index 1b6d22080..400c360e0 100644 --- a/docs/tutorials/join-dal-baker/verify-rights.md +++ b/docs/tutorials/join-dal-baker/verify-rights.md @@ -15,10 +15,10 @@ Follow these steps to verify that your DAL node is receiving attestation rights: MY_BAKER="$(octez-client show address my_baker | head -n 1 | cut -d ' ' -f 2)" ``` -1. Run this command to get the attestation rights for the baker in the current cycle: +1. Run thes commands to get the attestation rights for the baker in the current cycle (beware, the last command may take several minutes to finish if the list of rights is long): ```bash - octez-client rpc get "/chains/main/blocks/head" | jq '.metadata.level_info.cycle' + octez-client rpc get /chains/main/blocks/head | jq | grep '"cycle"' octez-client rpc get "/chains/main/blocks/head/helpers/attestation_rights?delegate=$MY_BAKER&cycle=" ``` @@ -31,12 +31,12 @@ Follow these steps to verify that your DAL node is receiving attestation rights: "delegates": [ { "delegate": "tz1Zs6zjxtLxmff51tK2AVgvm4PNmdNhLcHE", "first_slot": 280, "attestation_power": 58, - "consensus_key": "tz1Zs6zjxtLxmff51tK2AVgvm4PNmdNhLcHE" } ] } ] + "consensus_key": "tz1Zs6zjxtLxmff51tK2AVgvm4PNmdNhLcHE" } ] } + ... + ] ``` - If the command returns an empty array (`[]`), the delay may not be over. - - If the delay has expired and you still haven't received attestation rights, try these troubleshooting steps: + If the command returns an empty array (`[]`), the delay may not be over or there may be other problems. Try these troubleshooting steps: - Make sure that your node and baker are running. @@ -47,26 +47,18 @@ Follow these steps to verify that your DAL node is receiving attestation rights: Ensure that you are registered as a delegate and stake more tez, retaining a small amount for transaction fees. If necessary you can get more from the faucet. - - Check to see if you will receive rights two cycles in the future: - - 1. Run this command to get the current cycle: + - Check to see if you will receive rights two cycles in the future, using commands similar to those above for the current cycle. - ```bash - octez-client rpc get /chains/main/blocks/head | jq | grep '"cycle"' - ``` + If this returns a list of future attestation rights for your account, the delay has not expired yet and you must wait for that cycle to arrive. - 1. Add two to the cycle and run this command to see what rights your account will have in that cycle. - For example, if the current cycle is 149, run this command to get its rights in cycle 151: - - ```bash - octez-client rpc get /chains/main/blocks/head/helpers/baking_rights\?cycle=151\&delegate=$MY_BAKER\&max_round=2 - ``` + Find when the next cycles will start by going to a block explorer such as https://ghostnet.tzkt.io. + For example, this drop-down shows that the next cycle starts in 29 minutes: - If this command returns a list of future attestation rights for your account, the delay has not expired yet and you must wait for that cycle to arrive. + The TZKT block explorer, showing information about the current cycle - Check to see if you are active and re-register as a delegate if necessary: - 1. Run this command to see if your account is active: + 1. Run this command to see if your account is marked as inactive: ```bash octez-client rpc get /chains/main/blocks/head/context/delegates/$MY_BAKER/deactivated @@ -80,15 +72,17 @@ Follow these steps to verify that your DAL node is receiving attestation rights: octez-client register key my_baker as delegate ``` - 1. Find when the next cycle will start by going to a block explorer such as https://ghostnet.tzkt.io. - For example, this drop-down shows that the next cycle starts in 29 minutes: + Find when the next cycle will start by going to a block explorer such as https://ghostnet.tzkt.io or by executing these commands: - The TZKT block explorer, showing information about the current cycle + ```bash + octez-client rpc get "/chains/main/blocks/head/helpers/levels_in_current_cycle" + octez-client rpc get "/chains/main/blocks/head/helpers/attestation_rights?level=" | grep '"estimated_time"' + ``` - When this cycle starts, Tezos calculates attestation rights for a certain number of cycles in the future and includes your baker. - The number of cycles is the `consensus_rights_delay` network parameter. + When the next cycle starts, Tezos calculates attestation rights for a certain number of cycles in the future and includes your baker. + The number of cycles is the `consensus_rights_delay` network parameter. - 1. Wait for your baker to receive attestation rights. + Wait for your baker to receive attestation rights. 1. When your baker receives attestation rights as determined by the `/chains/main/blocks/head/helpers/attestation_rights` RPC call, run this command to get the shards that are assigned to your DAL node: From 9db6febb410b2edeacee8a2ceb63b45366deda93 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Mon, 2 Dec 2024 15:10:26 -0500 Subject: [PATCH 05/12] Clarify commands to get rights in future cycles and get when cycles will start --- .../tutorials/join-dal-baker/verify-rights.md | 57 ++++++++++++------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/docs/tutorials/join-dal-baker/verify-rights.md b/docs/tutorials/join-dal-baker/verify-rights.md index 400c360e0..d65aa3e6d 100644 --- a/docs/tutorials/join-dal-baker/verify-rights.md +++ b/docs/tutorials/join-dal-baker/verify-rights.md @@ -15,12 +15,20 @@ Follow these steps to verify that your DAL node is receiving attestation rights: MY_BAKER="$(octez-client show address my_baker | head -n 1 | cut -d ' ' -f 2)" ``` -1. Run thes commands to get the attestation rights for the baker in the current cycle (beware, the last command may take several minutes to finish if the list of rights is long): +1. Run these commands to get the attestation rights for the baker in the current cycle: - ```bash - octez-client rpc get /chains/main/blocks/head | jq | grep '"cycle"' - octez-client rpc get "/chains/main/blocks/head/helpers/attestation_rights?delegate=$MY_BAKER&cycle=" - ``` + 1. Get the current cycle by running this command: + + ```bash + octez-client rpc get /chains/main/blocks/head | jq | grep '"cycle"' + ``` + + 1. Use the current cycle as the `` parameter in this command. + Beware, this command may take several minutes to finish if the list of rights is long: + + ```bash + octez-client rpc get "/chains/main/blocks/head/helpers/attestation_rights?delegate=$MY_BAKER&cycle=" + ``` If the baker has no rights, the command returns an empty array: `[]`. @@ -48,13 +56,34 @@ Follow these steps to verify that your DAL node is receiving attestation rights: If necessary you can get more from the faucet. - Check to see if you will receive rights two cycles in the future, using commands similar to those above for the current cycle. + You can see who will receive rights no farther than two cycles in the future. + This number of cycles is set by the `consensus_rights_delay` network parameter. If this returns a list of future attestation rights for your account, the delay has not expired yet and you must wait for that cycle to arrive. - Find when the next cycles will start by going to a block explorer such as https://ghostnet.tzkt.io. - For example, this drop-down shows that the next cycle starts in 29 minutes: + You can find when the next cycle will start by running these commands: + + 1. Find the last level of the current cycle by running this command: + + ```bash + octez-client rpc get "/chains/main/blocks/head/helpers/levels_in_current_cycle" + ``` + + 1. Pass the last level of the cycle as the `` parameter in this command: + + ```bash + octez-client rpc get "/chains/main/blocks/head/helpers/attestation_rights?level=" | grep '"estimated_time"' + ``` + + The response shows the estimated time when the cycle will end. - The TZKT block explorer, showing information about the current cycle + + You can also find when the next cycle will start by going to a block explorer such as https://ghostnet.tzkt.io. + For example, this drop-down shows that the next cycle starts in 29 minutes: + + The TZKT block explorer, showing information about the current cycle + + Wait for your baker to receive attestation rights. - Check to see if you are active and re-register as a delegate if necessary: @@ -72,18 +101,6 @@ Follow these steps to verify that your DAL node is receiving attestation rights: octez-client register key my_baker as delegate ``` - Find when the next cycle will start by going to a block explorer such as https://ghostnet.tzkt.io or by executing these commands: - - ```bash - octez-client rpc get "/chains/main/blocks/head/helpers/levels_in_current_cycle" - octez-client rpc get "/chains/main/blocks/head/helpers/attestation_rights?level=" | grep '"estimated_time"' - ``` - - When the next cycle starts, Tezos calculates attestation rights for a certain number of cycles in the future and includes your baker. - The number of cycles is the `consensus_rights_delay` network parameter. - - Wait for your baker to receive attestation rights. - 1. When your baker receives attestation rights as determined by the `/chains/main/blocks/head/helpers/attestation_rights` RPC call, run this command to get the shards that are assigned to your DAL node: ```bash From e2f49c16752aa6cb72b4996c15606ff7ae7a3281 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Mon, 2 Dec 2024 15:13:11 -0500 Subject: [PATCH 06/12] Remove redundant step --- docs/tutorials/join-dal-baker/verify-rights.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/join-dal-baker/verify-rights.md b/docs/tutorials/join-dal-baker/verify-rights.md index d65aa3e6d..0c2ca4b51 100644 --- a/docs/tutorials/join-dal-baker/verify-rights.md +++ b/docs/tutorials/join-dal-baker/verify-rights.md @@ -30,8 +30,6 @@ Follow these steps to verify that your DAL node is receiving attestation rights: octez-client rpc get "/chains/main/blocks/head/helpers/attestation_rights?delegate=$MY_BAKER&cycle=" ``` - If the baker has no rights, the command returns an empty array: `[]`. - When the baker has attestation rights, the command returns information about them, as in this example: ```json @@ -44,7 +42,9 @@ Follow these steps to verify that your DAL node is receiving attestation rights: ] ``` - If the command returns an empty array (`[]`), the delay may not be over or there may be other problems. Try these troubleshooting steps: + If the command returns an empty array (`[]`), the baker has no rights in the specified cycle. + In this case, the delay may not be over or there may be other problems. + Try these troubleshooting steps: - Make sure that your node and baker are running. From 24dadc811f49d128bd100fcdb19ca2b8d9f5f5d4 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Mon, 2 Dec 2024 15:23:26 -0500 Subject: [PATCH 07/12] Add --rpc-addr to change port --- docs/tutorials/join-dal-baker/run-dal-node.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index 06bc2f47f..2f0882429 100644 --- a/docs/tutorials/join-dal-baker/run-dal-node.md +++ b/docs/tutorials/join-dal-baker/run-dal-node.md @@ -41,6 +41,7 @@ For example, this command initializes the DAL node with the address of a local ` ``` where `10732` is the port on which the DAL node serves RPC calls. + The default port is 10732, but you can override it with the `--rpc-addr` argument. The response lists the network connections that the DAL node has, as in this example: From 2298eb1ecf0f53705f02c683f884179e3b37d943 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Mon, 2 Dec 2024 15:25:03 -0500 Subject: [PATCH 08/12] Update updated date --- 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 +- docs/tutorials/join-dal-baker/verify-rights.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index f8100cfb2..616b9b30a 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: 27 August 2024 + date: 2 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. diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index 2f0882429..d8dbcfca8 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: 27 November 2024 + date: 2 December 2024 --- The DAL node is responsible for temporarily storing data and providing it to bakers and Smart Rollups. diff --git a/docs/tutorials/join-dal-baker/run-node.md b/docs/tutorials/join-dal-baker/run-node.md index 2ba990a7b..eeb14236e 100644 --- a/docs/tutorials/join-dal-baker/run-node.md +++ b/docs/tutorials/join-dal-baker/run-node.md @@ -2,7 +2,7 @@ title: "Step 1: Run an Octez node" authors: Tezos core developers, Tim McMackin last_update: - date: 21 October 2024 + 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. diff --git a/docs/tutorials/join-dal-baker/verify-rights.md b/docs/tutorials/join-dal-baker/verify-rights.md index 0c2ca4b51..676248fd7 100644 --- a/docs/tutorials/join-dal-baker/verify-rights.md +++ b/docs/tutorials/join-dal-baker/verify-rights.md @@ -2,7 +2,7 @@ title: "Step 5: Verify attestation rights" authors: Tezos core developers, Tim McMackin last_update: - date: 18 October 2024 + date: 2 December 2024 --- After the delay that you calculated in [Step 4: Run an Octez baking daemon](/tutorials/join-dal-baker/run-baker), the baker starts receiving attestation rights, including the rights to attest that DAL data is available. From e02e2570e0db72e6fe4bc5837e060679981f0ab6 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Tue, 3 Dec 2024 08:22:04 -0500 Subject: [PATCH 09/12] You can override it with Co-authored-by: GuillaumeGen --- docs/tutorials/join-dal-baker/run-dal-node.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index d8dbcfca8..4170e5c65 100644 --- a/docs/tutorials/join-dal-baker/run-dal-node.md +++ b/docs/tutorials/join-dal-baker/run-dal-node.md @@ -40,8 +40,8 @@ For example, this command initializes the DAL node with the address of a local ` curl http://localhost:10732/p2p/points/info ``` - where `10732` is the port on which the DAL node serves RPC calls. - The default port is 10732, but you can override it with the `--rpc-addr` argument. + where `10732` is the default port on which the DAL node serves RPC calls. + You can override it with the `--rpc-addr` argument. The response lists the network connections that the DAL node has, as in this example: From 61a86f79f313d6891fd131ab918fde4578cc1205 Mon Sep 17 00:00:00 2001 From: Nic Volanschi Date: Thu, 5 Dec 2024 11:48:24 +0100 Subject: [PATCH 10/12] rewrite verify_rights --- docs/tutorials/join-dal-baker/run-baker.md | 8 ++ .../tutorials/join-dal-baker/verify-rights.md | 77 ++++++++++--------- 2 files changed, 47 insertions(+), 38 deletions(-) diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index 616b9b30a..bc74174ca 100644 --- a/docs/tutorials/join-dal-baker/run-baker.md +++ b/docs/tutorials/join-dal-baker/run-baker.md @@ -93,3 +93,11 @@ The amount of tez that the account stakes determines how often it is called on t Therefore, staking more tez brings more rewards but does not reduce the attestation delay. ::: + +## Checking for (pre-)attestations + +After the delay computed above has passed, **the baker log** (not the Octez node log, neither the DAL node log) should contain lines about: + +- Consensus pre-attestations: `injected preattestation ...` +- Consensus attestations: `injected attestation ...` +- Attach DAL attestations: `ready to attach DAL attestation ...` diff --git a/docs/tutorials/join-dal-baker/verify-rights.md b/docs/tutorials/join-dal-baker/verify-rights.md index 676248fd7..0aae40d03 100644 --- a/docs/tutorials/join-dal-baker/verify-rights.md +++ b/docs/tutorials/join-dal-baker/verify-rights.md @@ -1,13 +1,11 @@ --- -title: "Step 5: Verify attestation rights" +title: "Step 5: Troubleshooting" authors: Tezos core developers, Tim McMackin last_update: date: 2 December 2024 --- -After the delay that you calculated in [Step 4: Run an Octez baking daemon](/tutorials/join-dal-baker/run-baker), the baker starts receiving attestation rights, including the rights to attest that DAL data is available. - -Follow these steps to verify that your DAL node is receiving attestation rights: +If after the delay that you calculated in [Step 4: Run an Octez baking daemon](/tutorials/join-dal-baker/run-baker), the baker does not starts inserting consensus (pre-)attestations and DAL attestations, follow these instructions to diagnose and fix the issue. 1. Record the address of your baker account in an environment variable so you can use it for commands that cannot get addresses by their Octez client aliases: @@ -15,7 +13,7 @@ Follow these steps to verify that your DAL node is receiving attestation rights: MY_BAKER="$(octez-client show address my_baker | head -n 1 | cut -d ' ' -f 2)" ``` -1. Run these commands to get the attestation rights for the baker in the current cycle: +1. Run these commands to get the (consensus) attestation rights for the baker in the current cycle: 1. Get the current cycle by running this command: @@ -43,25 +41,39 @@ Follow these steps to verify that your DAL node is receiving attestation rights: ``` If the command returns an empty array (`[]`), the baker has no rights in the specified cycle. - In this case, the delay may not be over or there may be other problems. - Try these troubleshooting steps: - - Make sure that your node and baker are running. + - Check to see if you will receive rights two cycles in the future, using commands similar to those above for the current cycle. + You can see who will receive rights no farther than two cycles in the future. + This number of cycles is set by the `consensus_rights_delay` network parameter. + + If this returns a list of future attestation rights for your account, you must wait for that cycle to arrive. - - Verify that your DAL node is connected to the network by following the instructions in [Troubleshooting](https://tezos.gitlab.io/shell/dal_run.html#troubleshooting) in the Octez documentation. + - Otherwise, make sure that your node and baker are running. - Verify that the staked balance of your account is at least 6,000 tez by running the command `octez-client get staked balance for my_baker`. If the response is less than 6,000 tez, you have not staked enough. Ensure that you are registered as a delegate and stake more tez, retaining a small amount for transaction fees. If necessary you can get more from the faucet. - - Check to see if you will receive rights two cycles in the future, using commands similar to those above for the current cycle. - You can see who will receive rights no farther than two cycles in the future. - This number of cycles is set by the `consensus_rights_delay` network parameter. + - Check to see if you are active and re-register as a delegate if necessary: + + 1. Run this command to see if your account is marked as inactive: - If this returns a list of future attestation rights for your account, the delay has not expired yet and you must wait for that cycle to arrive. + ```bash + octez-client rpc get /chains/main/blocks/head/context/delegates/$MY_BAKER/deactivated + ``` + + Baker accounts are deactivated when the baker is offline for a certain time. + + 1. If the value for the `deactivated` field is `true`, re-register as a baker by running this command: + + ```bash + octez-client register key my_baker as delegate + ``` - You can find when the next cycle will start by running these commands: + When the next cycle starts, Tezos calculates attestation rights for two cycles in the future and includes your baker. + + You can find when the next cycle will start by running these commands: 1. Find the last level of the current cycle by running this command: @@ -78,33 +90,15 @@ Follow these steps to verify that your DAL node is receiving attestation rights: The response shows the estimated time when the cycle will end. - You can also find when the next cycle will start by going to a block explorer such as https://ghostnet.tzkt.io. - For example, this drop-down shows that the next cycle starts in 29 minutes: + You can also find when the next cycle will start by going to a block explorer such as https://ghostnet.tzkt.io. + For example, this drop-down shows that the next cycle starts in 29 minutes: The TZKT block explorer, showing information about the current cycle - Wait for your baker to receive attestation rights. - - - Check to see if you are active and re-register as a delegate if necessary: - - 1. Run this command to see if your account is marked as inactive: - - ```bash - octez-client rpc get /chains/main/blocks/head/context/delegates/$MY_BAKER/deactivated - ``` - - Baker accounts are deactivated when the baker is offline for a certain time. - - 1. If the value for the `deactivated` field is `true`, re-register as a baker by running this command: - - ```bash - octez-client register key my_baker as delegate - ``` - -1. When your baker receives attestation rights as determined by the `/chains/main/blocks/head/helpers/attestation_rights` RPC call, run this command to get the shards that are assigned to your DAL node: +1. When your baker receives attestation rights as determined by the `/chains/main/blocks/head/helpers/attestation_rights` RPC call, run this command to get the shards that are assigned to your DAL node for the next block: ```bash - octez-client rpc get /chains/main/blocks/head/context/dal/shards?delegates=$MY_BAKER + octez-client rpc get "/chains/main/blocks/head/context/dal/shards?delegates=$MY_BAKER" ``` The response includes your account's address and a list of shards, as in this example: @@ -116,6 +110,9 @@ Follow these steps to verify that your DAL node is receiving attestation rights: These shards are pieces of data that the baker is assigned to attest. + Note that you have to potentially execute the command above during many block levels in order to find a block where you have some shards assigned. + Unfortunately, there is currently no simple command line to get all your DAL rights for a whole cycle, for example. + 1. Verify the baker's activity on the Explorus block explorer by going to the Consensus Ops page at https://explorus.io/consensus_ops, selecting Ghostnet, and searching for your address. For example, this screenshot shows consensus operations that include DAL attestations, indicated by a number in the "DAL attestation bitset" column. @@ -125,8 +122,12 @@ Follow these steps to verify that your DAL node is receiving attestation rights: If there is no DAL attestation, the block explorer shows a document icon with an X in it: ![](/img/tutorials/dal-explorus-no-attestation-icon.png). This icon can appear before the bakers complete attestations and then turn into a binary number when they attest. -Now you have a complete DAL baking setup. -Your baker is attesting to the availability of DAL data and the DAL node is sharing it to Smart Rollups across the network. + If you see the rights, you will see the attestations in the baker's log when scheduled. Now you have a complete DAL baking setup. + Your baker is attesting to the availability of DAL data and the DAL node is sharing it to Smart Rollups across the network. + +If you don't see DAL attestation rights: + + - Verify that your DAL node is connected to the network by following the instructions in [Troubleshooting](https://tezos.gitlab.io/shell/dal_run.html#troubleshooting) in the Octez documentation. ## Optional: Unstaking your tez and receiving your baking rewards From cf269e7ab98fef5acc07fac0338f53f37d08f618 Mon Sep 17 00:00:00 2001 From: Nic Volanschi Date: Fri, 13 Dec 2024 15:29:13 +0100 Subject: [PATCH 11/12] add loop on DAL rights --- docs/tutorials/join-dal-baker/verify-rights.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/join-dal-baker/verify-rights.md b/docs/tutorials/join-dal-baker/verify-rights.md index 0aae40d03..9e38f803f 100644 --- a/docs/tutorials/join-dal-baker/verify-rights.md +++ b/docs/tutorials/join-dal-baker/verify-rights.md @@ -5,7 +5,7 @@ last_update: date: 2 December 2024 --- -If after the delay that you calculated in [Step 4: Run an Octez baking daemon](/tutorials/join-dal-baker/run-baker), the baker does not starts inserting consensus (pre-)attestations and DAL attestations, follow these instructions to diagnose and fix the issue. +If after the delay that you calculated in [Step 4: Run an Octez baking daemon](/tutorials/join-dal-baker/run-baker), the baker does not start inserting consensus (pre-)attestations and DAL attestations, follow these instructions to diagnose and fix the issue. 1. Record the address of your baker account in an environment variable so you can use it for commands that cannot get addresses by their Octez client aliases: @@ -111,9 +111,20 @@ If after the delay that you calculated in [Step 4: Run an Octez baking daemon](/ These shards are pieces of data that the baker is assigned to attest. Note that you have to potentially execute the command above during many block levels in order to find a block where you have some shards assigned. - Unfortunately, there is currently no simple command line to get all your DAL rights for a whole cycle, for example. + There is currently no simple command line to get all your DAL rights for a whole cycle, but you can call it in a loop for future levels until you see some shards. + First, get the current level: -1. Verify the baker's activity on the Explorus block explorer by going to the Consensus Ops page at https://explorus.io/consensus_ops, selecting Ghostnet, and searching for your address. + ```bash + octez-client rpc get /chains/main/blocks/head | jq '.header.level' + ``` + + and pass it as the `` parameter in this command: + + ```bash + l=; while true; echo $l; do octez-client rpc get "/chains/main/blocks/head/context/dal/shards?delegates=$MY_BAKER&level=$l"; l=$((l+1)); done + ``` + +1. Verify the baker's activity on the Explorus block explorer by going to the Consensus Ops page at https://explorus.io/consensus_ops, selecting Ghostnet, and searching for your address (only the first few characters). For example, this screenshot shows consensus operations that include DAL attestations, indicated by a number in the "DAL attestation bitset" column. From ceb2ac95c23ecbbb9576db2e1d2546259d73091f Mon Sep 17 00:00:00 2001 From: Nic Volanschi Date: Tue, 17 Dec 2024 12:13:07 +0100 Subject: [PATCH 12/12] move some steps in run-node and do other fixes --- .../join-dal-baker/prepare-account.md | 27 +---------------- docs/tutorials/join-dal-baker/run-baker.md | 8 ++--- docs/tutorials/join-dal-baker/run-dal-node.md | 2 +- docs/tutorials/join-dal-baker/run-node.md | 29 +++++++++++++++++-- .../tutorials/join-dal-baker/verify-rights.md | 4 +-- 5 files changed, 34 insertions(+), 36 deletions(-) diff --git a/docs/tutorials/join-dal-baker/prepare-account.md b/docs/tutorials/join-dal-baker/prepare-account.md index 8a5cd5405..93ace909b 100644 --- a/docs/tutorials/join-dal-baker/prepare-account.md +++ b/docs/tutorials/join-dal-baker/prepare-account.md @@ -8,32 +8,6 @@ last_update: The baker needs a user account that stakes tez. In this section, you use the Octez client to create an account, register it as a delegate, and stake tez with it. -1. Connect the Octez client to your node by running this command: - - ```bash - octez-client -E http://localhost:8732 config update - ``` - - If you see an error that says "Failed to acquire the protocol version from the node," ensure that your node is running and verify that the host name and port in the `config update` command are correct. - -1. Make sure that the installation of the Octez client is using your node by running this command: - - ```bash - octez-client bootstrapped - ``` - - The client waits until it is connected and the node is running at the current level. - When it is connected and the node is updated, the command prints the message `Node is bootstrapped`. - The time it takes depends on how many blocks the node must retrieve to catch up from the snapshot to the current head block. - -1. Optional: Hide the Octez client's network warning message by running this command: - - ```bash - export TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=y - ``` - - This command suppresses the message that your instance of the Octez client is not using Mainnet. - 1. Create or import an account in the Octez client. The simplest way to get an account is to use the Octez client to randomly generate an account. This command creates an account and associates it with the `my_baker` alias: @@ -60,6 +34,7 @@ This command creates an account and associates it with the `my_baker` alias: To get tez, use the Ghostnet faucet linked from https://teztnets.com/ghostnet-about to send tez to the baker account. Running a baker requires staking at least 6,000 tez, but the more tez it stakes, the more rights it gets and the less time it has to wait to produce blocks and make attestations. + However, be aware that, for protecting abuses of the faucet, getting such amounts of tez from the faucet may take a long time (e.g. more than one hour). Consequently, some individual requests may occasionally time out or fail and need to be relaunched. 1. Verify that the faucet sent the tez to the account with the same `get balance` command: diff --git a/docs/tutorials/join-dal-baker/run-baker.md b/docs/tutorials/join-dal-baker/run-baker.md index bc74174ca..a84784c1b 100644 --- a/docs/tutorials/join-dal-baker/run-baker.md +++ b/docs/tutorials/join-dal-baker/run-baker.md @@ -85,8 +85,6 @@ For example, if the delay is 307,200 seconds, that time is about 3.5 days. The exact time depends on what time in the current cycle the account staked its tez. -1. Wait for the attestation delay to be over and then proceed to [Step 5: Verify attestation rights](/tutorials/join-dal-baker/verify-rights). - :::note The amount of tez that the account stakes determines how often it is called on to make attestations, not how quickly it receives rights. @@ -94,10 +92,10 @@ Therefore, staking more tez brings more rewards but does not reduce the attestat ::: -## Checking for (pre-)attestations - -After the delay computed above has passed, **the baker log** (not the Octez node log, neither the DAL node log) should contain lines about: +1. After the delay computed above has passed, **the baker log** (not the Octez node log, neither the DAL node log) should contain lines about: - Consensus pre-attestations: `injected preattestation ...` - Consensus attestations: `injected attestation ...` - 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). diff --git a/docs/tutorials/join-dal-baker/run-dal-node.md b/docs/tutorials/join-dal-baker/run-dal-node.md index 4170e5c65..3327cbdf0 100644 --- a/docs/tutorials/join-dal-baker/run-dal-node.md +++ b/docs/tutorials/join-dal-baker/run-dal-node.md @@ -105,7 +105,7 @@ For example, this command initializes the DAL node with the address of a local ` 1. Ensure that the DAL node runs persistently. 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. +You can also refer to [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: diff --git a/docs/tutorials/join-dal-baker/run-node.md b/docs/tutorials/join-dal-baker/run-node.md index eeb14236e..f7657e04f 100644 --- a/docs/tutorials/join-dal-baker/run-node.md +++ b/docs/tutorials/join-dal-baker/run-node.md @@ -71,11 +71,36 @@ For example, the command to download a Ghostnet snapshot from the European serve At first launch, the node generates a fresh identity file used to identify itself on the network. Then it bootstraps the chain, which takes a variable amount of time depending on how many blocks need to be loaded. - You don't need to wait for the node to bootstrap now. + +1. Make sure the Octez client uses your node by running this command: + + ```bash + octez-client -E http://localhost:8732 config update + ``` + + If you see an error that says "Failed to acquire the protocol version from the node," ensure that your node is running and verify that the host name and port in the `config update` command are correct. + +1. Wait for your node to bootstrap by running this command: + + ```bash + octez-client bootstrapped + ``` + + The client waits until it is connected and the node is running at the current level. + When it is connected and the node is updated, the command prints the message `Node is bootstrapped`. + The time it takes depends on how many blocks the node must retrieve to catch up from the snapshot to the current head block. + +1. Optional: Hide the Octez client's network warning message by running this command: + + ```bash + export TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=y + ``` + + This command suppresses the message that your instance of the Octez client is not using Mainnet. 1. Ensure that the node runs persistently. Look up how to run programs persistently in the documentation for your operating system. -You can also refer to [Setting up Octez Services](https://tezos.gitlab.io/introduction/services.html) in the Octez documentation. +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. 1. Optional: When the node has bootstrapped and caught up with the current head block, you can delete the snapshot file to save space. diff --git a/docs/tutorials/join-dal-baker/verify-rights.md b/docs/tutorials/join-dal-baker/verify-rights.md index 9e38f803f..ec3134b51 100644 --- a/docs/tutorials/join-dal-baker/verify-rights.md +++ b/docs/tutorials/join-dal-baker/verify-rights.md @@ -1,11 +1,11 @@ --- -title: "Step 5: Troubleshooting" +title: "Step 5: Verifications" authors: Tezos core developers, Tim McMackin last_update: date: 2 December 2024 --- -If after the delay that you calculated in [Step 4: Run an Octez baking daemon](/tutorials/join-dal-baker/run-baker), the baker does not start inserting consensus (pre-)attestations and DAL attestations, follow these instructions to diagnose and fix the issue. +After the delay that you calculated in [Step 4: Run an Octez baking daemon](/tutorials/join-dal-baker/run-baker), follow these instructions to verify the activity or diagnose and fix issues. 1. Record the address of your baker account in an environment variable so you can use it for commands that cannot get addresses by their Octez client aliases: