You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
Update DAL file server tutorial for Ghostnet (#424)
* WIP update tutorial for Ghostnet
* REmove weeklynet issue
* Clarify default port
* This needs to be "slots", not "slot"
* Complete update of tutorial for Ghostnet
* Update source command after Rust installation
* Some tweaks
* Typo
* root-relative links
* Updates to get it working
* Doesn't compile with Rust 1.81
* Install trusted setup
* Correct override command
* correct URL
* Bakers do the attesting
* Correct step numbering
* Clarify variables
* Some final tweaks
* Default port for node.
* Remove unnecessary ---endpoint arguments
Copy file name to clipboardExpand all lines: docs/tutorials/build-files-archive-with-dal.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
2
title: Implement a file archive with the DAL and a Smart Rollup
3
-
authors: 'Tezos Core Developers'
3
+
authors: Tezos Core Developers
4
4
last_update:
5
-
date: 10 June 2024
5
+
date: 27 January 2025
6
6
dependencies:
7
7
octez: 21.2
8
8
rust: 1.80.0
@@ -12,17 +12,16 @@ dependencies:
12
12
The Data Availability Layer (DAL) is a companion peer-to-peer network for the Tezos blockchain, designed to provide additional data bandwidth to Smart Rollups.
13
13
It allows users to share large amounts of data in a way that is decentralized and permissionless, because anyone can join the network and post and read data on it.
14
14
15
-
In this tutorial, you will set up a file archive that stores and retrieves files with the DAL.
15
+
This tutorial uses the Ghostnet test network, but you can use the information in it to work with other test networks or Tezos Mainnet.
16
+
17
+
In this tutorial, you set up a file archive that stores and retrieves files with the DAL.
16
18
You will learn:
17
19
18
20
- How data is organized and shared with the DAL and the reveal data channel
19
21
- How to read data from the DAL in a Smart Rollup
20
22
- How to host a DAL node
21
23
- How to publish data and files with the DAL
22
24
23
-
This tutorial uses the [Weeklynet test network](https://teztnets.com/weeklynet-about).
24
-
Weeklynet runs just like other Tezos networks like Mainnet and Ghostnet, with its own nodes, bakers, and accusers, so you don't need to run your own nodes and bakers.
25
-
26
25
See these links for more information about the DAL:
27
26
28
27
- For technical information about how the DAL works, see [Data Availability Layer](https://tezos.gitlab.io/shell/dal.html) in the Octez documentation.
@@ -33,18 +32,19 @@ See these links for more information about the DAL:
33
32
In this tutorial, you set up these components:
34
33
35
34
- The Octez client, which you use to manage a local wallet, deploy a Smart Rollup, and send data to the DAL
35
+
- A layer 1 node to provide a connection to Tezos and information about the state of layer 1, including metadata about what data is available on the DAL
36
36
- A Data Availability Layer node (not to be confused with a layer 1 node), which stores data temporarily and distributes it to Smart Rollups
37
37
- A Smart Rollup that listens for data published to the DAL, retrieves it from the DAL node, and stores it locally
38
38
- A Smart Rollup node that runs your Smart Rollup
39
39
40
-
For simplicity, you do not set up a layer 1 node or a baker, which are responsible for verifying that the data is available before Smart Rollups can access it.
41
-
Instead, you use the existing nodes and bakers that are running on Weeklynet.
40
+
For simplicity, you do not set up a baker, which is responsible for verifying and attesting that the data is available before Smart Rollups can access it.
41
+
For instructions on running a layer 1 node and baker with the DAL, see the tutorial [Join the DAL as a baker, in 5 steps](/tutorials/join-dal-baker).
42
42
43
43
## Tutorial diagram
44
44
45
45
Here is a diagram that shows the components that you set up in this tutorial in a light blue background:
46
46
47
-

47
+

For example, if a certificate is included in level 100 and the attestation lag is 4, bakers must attest that the data is available in level 104, along with their usual attestations that build on level 103.
94
94
95
95
If enough shards are attested in that level, the data becomes available to Smart Rollups at the end of layer 104.
96
-
If not enough shards are attested in that level, the certificate is considered bogus and the related data is dropped.
96
+
If not enough shards are attested in that level, the certificate is considered bogus, the related data is dropped, and Smart Rollups cannot access it.
97
97
98
98
1. The Smart Rollup node monitors the blocks and when it sees attested DAL data, it connects to a DAL node to request the data.
99
99
Smart Rollups must store the data if they need it because it is available on the DAL for only a short time.
Copy file name to clipboardExpand all lines: docs/tutorials/build-files-archive-with-dal/get-dal-params.md
+41-30Lines changed: 41 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
2
title: "Part 2: Getting the DAL parameters"
3
-
authors: 'Tezos Core Developers'
3
+
authors: Tezos core developers, Tim McMackin
4
4
last_update:
5
-
date: 14 February 2024
5
+
date: 27 Jan 2025
6
6
---
7
7
8
8
The Data Availability Layer stores information about the available data in layer 1 blocks.
@@ -27,7 +27,7 @@ Different networks can have different DAL parameters.
27
27
Future changes to the protocol may allow the DAL to resize dynamically based on usage.
28
28
29
29
Therefore, clients must get information about the DAL before sending data to it.
30
-
In these steps, you set up a simple Smart Rollup to get the current DAL parameters and print them to the log.
30
+
Smart contracts can't access the DAL; it is intended for Smart Rollups, so in these steps you set up a simple Smart Rollup to get the current DAL parameters and print them to the log.
31
31
32
32
## Prerequisites
33
33
@@ -52,10 +52,13 @@ To get the DAL parameters, you can use built-in functions in the Tezos [Rust SDK
52
52
tezos-smart-rollup = { version = "0.2.2", features = [ "proto-alpha" ] }
53
53
```
54
54
55
+
If you set up your Docker container with a connected folder on the host machine, you can create this file in the connected folder and it will appear in the Docker container.
56
+
55
57
As a reminder, the kernel of a Smart Rollup is a WASM program.
56
58
The `proto-alpha` feature is necessary to get access to the functions specific to the DAL because they are not yet released in the main version of the Smart Rollup toolkit.
57
59
58
60
If you need a text editor inside the Docker container, you can run `sudo apk add nano` to install the [Nano text editor](https://www.nano-editor.org/).
61
+
If you set up the container with a volume, you can use any editor on your host machine to edit the file and it appears in the linked folder in the container.
59
62
60
63
1. Create a file named `src/lib.rs` to be the kernel.
61
64
@@ -74,10 +77,15 @@ To get the DAL parameters, you can use built-in functions in the Tezos [Rust SDK
74
77
75
78
This function gets the DAL parameters of the currently connected network and prints them to the log.
76
79
77
-
1. From the folder that contains the `Cargo.toml` file, run these commands to build the kernel:
80
+
1. From the folder that contains the `Cargo.toml` file, run this command to build the kernel:
To use it, save it in a file with an `sh` extension, such as `deploy_smart_rollup.sh` and give it executable permission.
190
+
To use it, save it in a file with an `sh` extension, such as `deploy_smart_rollup.sh` and give it executable permission by running `chmod +x deploy_smart_rollup.sh`.
180
191
Then you can run it any tme you update the `lib.rs` or `Cargo.toml` files to deploy a new Smart Rollup by passing your account alias, as in this example:
181
192
182
193
```bash
183
-
./deploy_smart_rollup.sh $MY_ACCOUNT
194
+
./deploy_smart_rollup.sh my_wallet
184
195
```
185
196
186
197
If you run this script and see an error that says that the file was not found, update the first line of the script (the shebang) to the path to your shell interpreter.
187
-
For example, if you are using the Tezos Docker image, the path is `/bin/sh`, so the first line becomes`#!/bin/sh`.
188
-
Then try the command `./deploy_smart_rollup.sh $MY_ACCOUNT` again.
198
+
For example, if you are using the Tezos Docker image, the path is `/bin/sh`, so the first line is`#!/bin/sh`.
199
+
Then try the command `./deploy_smart_rollup.sh my_wallet` again.
189
200
190
201
In the next section, you will get information about the state of slots in the DAL.
191
202
See [Part 3: Getting slot information](/tutorials/build-files-archive-with-dal/get-slot-info).
Copy file name to clipboardExpand all lines: docs/tutorials/build-files-archive-with-dal/get-slot-info.md
+43-29Lines changed: 43 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
2
title: "Part 3: Getting slot information"
3
-
authors: 'Tezos Core Developers'
3
+
authors: Tezos core developers, Tim McMackin
4
4
last_update:
5
-
date: 14 February 2024
5
+
date: 11 September 2024
6
6
---
7
7
8
8
When clients send data to the DAL, they must choose which slot to put it in.
@@ -11,9 +11,8 @@ If more than one client tries to write to the same slot and a baker includes tho
11
11
The other operations fail and the clients must re-submit the data to be included in a future block.
12
12
13
13
For this reason, clients should check the status of slots to avoid conflicts.
14
-
For example, slots 0, 30, and 31 are often used for regression tests.
15
14
16
-
To see which slots are in use, you can use the Explorus indexer at https://explorus.io/dal and select Weeklynet.
15
+
To see which slots are in use, you can use the Explorus indexer at https://explorus.io/dal and select your network.
17
16
For example, this screenshot shows that slots 10 and 25 are in use:
18
17
19
18

@@ -24,16 +23,33 @@ Similarly, the protocol assigns bakers to monitor certain slots.
24
23
25
24
## Starting a DAL node
26
25
27
-
To run a DAL node, use the Octez `octez-dal-node` command and pass the slots to monitor in the `--producer-profiles` argument.
26
+
To run a DAL node, you must configure a set of cryptographic parameters for it and the use the Octez `octez-dal-node` command and pass the slots to monitor in the `--observer-profiles` argument:
28
27
29
-
Run this command to start a DAL node and monitor slot 0:
28
+
1. In a new terminal window in the Docker container, run this command to download the trusted setup scripts:
1. Run this command to make the scripts executable:
35
+
36
+
```bash
37
+
chmod +x install_dal_trusted_setup.sh version.sh
38
+
```
39
+
40
+
1. Run this command to install the trusted setup:
35
41
36
-
Leave this process running in terminal window.
42
+
```bash
43
+
./install_dal_trusted_setup.sh --legacy
44
+
```
45
+
46
+
1. Run this command to start a DAL node and monitor slot 0:
47
+
48
+
```bash
49
+
octez-dal-node run --observer-profiles=0 --data-dir _dal_node
50
+
```
51
+
52
+
Leave this process running in the terminal window.
37
53
38
54
## Accessing the slot data from a Smart Rollup
39
55
@@ -122,14 +138,13 @@ Follow these steps to update the Smart Rollup to access information about slot 0
122
138
tezos-smart-rollup-host = { version = "0.2.2", features = [ "proto-alpha" ] }
123
139
```
124
140
125
-
1. Stop the Smart Rollup process.
126
-
127
-
1. Run the commands to build and deploy the Smart Rollup and start the node.
141
+
1. Stop the process that is running the `octez-smart-rollup-node` program.
128
142
143
+
1. Run the commands to build and deploy the Smart Rollup and start the Smart Rollup node.
129
144
130
-
If you set up the deployment script as described in [Part 2: Getting the DAL parameters](/tutorials/build-files-archive-with-dal/get-dal-params), you can run `./deploy_smart_rollup.sh $MY_ACCOUNT`.
145
+
If you set up the deployment script as described in [Part 2: Getting the DAL parameters](/tutorials/build-files-archive-with-dal/get-dal-params), you can run `./deploy_smart_rollup.sh my_wallet`, where `my_wallet` is the Octez client alias of your address.
131
146
132
-
If not, run these commands, using your account alias for `MY_ACCOUNT`:
147
+
If not, run these commands, where `my_wallet` is the Octez client alias of your address:
133
148
134
149
```bash
135
150
rm -rf _rollup_node
@@ -139,12 +154,11 @@ Follow these steps to update the Smart Rollup to access information about slot 0
For the first 4 Tezos blocks produced after the origination of the Smart Rollup, the kernel will report that no slot has been attested for the targeted level, _even if Explorus states the opposite_.
181
+
For the first 8 Tezos blocks produced after the origination of the Smart Rollup, the kernel will report that no slot has been attested for the targeted level, _even if Explorus states the opposite_.
168
182
This is because, as of January, 2024, a Smart Rollup cannot fetch the content of a slot published before it is originated.
169
-
This is why you must wait for 4 blocks before seeing slot page contents being
183
+
This is why you must wait for 8 blocks before seeing slot page contents being
170
184
logged.
171
185
172
186
Now that you can see the state of the slots, you can find an unused slot and publish data to it.
173
-
When you are ready, continue to [Part 3: Publishing on the DAL](/tutorials/build-files-archive-with-dal/publishing-on-the-dal).
187
+
When you are ready, continue to [Part 4: Publishing on the DAL](/tutorials/build-files-archive-with-dal/publishing-on-the-dal).
0 commit comments