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

Review the tutorial join-dal-as-baker #480

Merged
merged 12 commits into from
Dec 17, 2024
27 changes: 1 addition & 26 deletions docs/tutorials/join-dal-baker/prepare-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:

Expand Down
18 changes: 13 additions & 5 deletions docs/tutorials/join-dal-baker/run-baker.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
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.

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.
Expand All @@ -36,7 +38,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":<index>,"pkh":"<ADDRESS OF BAKER>"}` 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:
NicNomadic marked this conversation as resolved.
Show resolved Hide resolved

- Receive a block proposal (log message: "received new proposal ... at level ..., round ...")
- Inject a preattestation for it (log message: "injected preattestation ... for my_baker (&lt;address&gt;) for level ..., round ...")
Expand Down Expand Up @@ -83,11 +85,17 @@ 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.
Therefore, staking more tez brings more rewards but does not reduce the attestation delay.

:::

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).
15 changes: 10 additions & 5 deletions docs/tutorials/join-dal-baker/run-dal-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
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.

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.

Expand All @@ -16,17 +16,19 @@ 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.

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.
Expand All @@ -38,6 +40,9 @@ 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 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:

```json
Expand Down Expand Up @@ -100,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:

Expand Down
38 changes: 33 additions & 5 deletions docs/tutorials/join-dal-baker/run-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -63,16 +64,43 @@ For example, the command to download a Ghostnet snapshot from the EU servers mig
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. 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 [Run a persistent baking node](https://opentezos.com/node-baking/baking/persistent-baker/) on opentezos.com.
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.

Expand Down
Loading
Loading