-
Notifications
You must be signed in to change notification settings - Fork 16
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
Update and improve smart rollup tutorial #118
Changes from 35 commits
c70262e
59236e4
70e6c63
1ac78f7
0891661
112fd94
539cb1b
5aacfc5
ec9f3ea
b942440
dc6d15f
e74ea9e
d054789
781691f
07185dc
79fed44
aa0a55b
3153944
f371526
2b09d88
3121630
4bb6b83
08510d3
5f1b2d0
0e33475
b206696
3b55fc5
43c41b9
f57d8c6
36c698d
b62dc43
a5117fc
3248740
27e4668
96200f1
d4ddcaa
4f0931c
ca72efb
b25c283
4087c61
a73daf7
88dc0ea
95e19e2
933450e
8358bca
fcdd812
f4d24cd
e6eaa21
2a902a3
692abe1
bab62a2
2d7a614
ca631c0
8c852b2
eb04a17
eb6c4c5
70416da
62d8a70
c24be8b
7bb4e3e
a0310d5
2f73983
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
id: debug | ||
title: "Part 3: Running the kernel in debug mode" | ||
lastUpdated: 11th October 2023 | ||
--- | ||
|
||
Octez provides a command named `octez-smart-rollup-wasm-debugger` that runs smart rollups in debug mode to make it easier to test and observe them. | ||
Later, you will deploy the rollup to the sandbox, but running it in debug mode first verifies that it built correctly. | ||
|
||
1. In the second terminal window inside the Docker container, go to the `hello_world_kernel` folder. | ||
|
||
1. Run this command to start the rollup and pass an empty message inbox to it: | ||
|
||
```bash | ||
octez-smart-rollup-wasm-debugger --kernel target/wasm32-unknown-unknown/debug/hello_world_kernel.wasm --inputs empty_input.json | ||
``` | ||
|
||
The command prompt changes again to show that you are in debugging mode, which steps through commands. | ||
|
||
1. At the debugging prompt, run this command to send the message inbox to the kernel: | ||
|
||
```bash | ||
step inbox | ||
``` | ||
|
||
The response shows the logging information for the kernel, including these parts: | ||
|
||
- The message "Hello, kernel" from the `hello_kernel` function | ||
- The message "Got message: Internal(StartOfLevel)," which represents the start of the message inbox | ||
- The message "Got message: Internal(InfoPerLevel(InfoPerLevel ...," which provides the hash of the previous block | ||
timothymcmackin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- The message "Got message: Internal(EndOfLevel)," which represents the end of the message inbox | ||
|
||
Now you know that the kernel works. | ||
In the next section, you optimize and deploy it to the sandbox. | ||
|
||
1. Press Ctrl + C to end debugging mode. | ||
|
||
Now you know that the kernel works. | ||
In the next section, you optimize the kernel to be deployed to the sandbox. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
id: deploy | ||
title: "Part 5: Deploying (originating) the rollup" | ||
lastUpdated: 11th October 2023 | ||
--- | ||
|
||
Smart rollups are originated in a way similar to smart contracts. | ||
Instead of running the `octez-client originate contract` command, you run the `octez-client originate smart rollup` command. | ||
This command creates an address for the rollup and stores a small amount of data about it on layer 1. | ||
|
||
1. In the second terminal window, in the Docker container, in the `hello-world-kernel` folder, run this command to deploy the installer kernel to the Tezos sandbox: | ||
|
||
```bash | ||
octez-client originate smart rollup "test_smart_rollup" from "bootstrap1" of kind wasm_2_0_0 of type bytes with kernel file:hello_world_kernel_installer.hex --burn-cap 3 | ||
timothymcmackin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
If you need to open a new terminal window within the Docker container, run the command `docker exec -it octez-container /bin/sh`. | ||
|
||
Like the command to originate a smart contract, this command uses the `--burn-cap` argument to allow the transaction to take fees from the account. | ||
Also like deploying a smart contract, the response in the terminal shows information about the transaction and the address of the originated smart rollup, which starts with `sr1`. | ||
|
||
Now layer 1 is aware of the rollup and nodes can run the rollup kernel. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section is really short. You could potentially originate a very simple contract here, and call the rollup entrypoint? (To prove that Layer 1 really does know about it?). Maybe it would overcomplicate it though. Alternatively, if we used the debugger on the installer in the previous previous section, you could use it again here for the proper origination? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section is a bit longer now because it includes starting the sandbox. For calling the rollup from a smart contract, thank you for helping me work out how to do that. I'll get this PR pushed through and add that to the tutorial in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an error appeared when I try this command:
/bin/sh: step: not found
~/hello-world-kernel $ octez-smart-rollup-wasm-debugger \
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get that error when the .wasm file is not found. Are you sure you are in the hello_world_kernel folder and the path to the wasm file is correct?