Now that the Kernel Gallery has been introduced, it’s time to build and originate one of the example.
This blog post will assume that you have access to the octez-smart-rollup-client-PtMumbai
and the octez-client
binaries, you can install them by following this documentation.
Building the Kernel Gallery
The Kernel Gallery is a set of kernels written in Rust, so you will need to install Rust on your computer:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Then you can clone the Kernel Gallery on your computer.
$ git clone git@gitlab.com:tezos/kernel-gallery.git
You will notice a file rust-toolchain
that forces the rust to use the version 1.66.0. To make sure you have the correct installed Rust version you can use this command:
$ rustup --version
> rustup 1.26.0 (5af9b9484 2023-04-05)
> info: This is the version for the rustup toolchain manager, not the rustc compiler.
> info: The currently active `rustc` version is `rustc 1.66.0 (69f9c33d7 2022-12-12)
The kernels are compile to Wasm, to compile some Rust code to Wasm you need to add the wasm32-unknown-unknown
to the Rust compiler
$ rustup target add wasm32-unknown-unknown
> info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
> info: installing component 'rust-std' for 'wasm32-unknown-unknown'
To make sure everything is working you can compile all the kernel of the Kernel Gallery:
$ cargo build --target wasm32-unknown-unknown
> ...
> Finished dev [unoptimized + debuginfo] target(s) in 8.61s
On Macos you may have some troubles when compiling the Kernel Gallery, so we added a section in the readme of the Kernel Gallery to help you solve the issue
Originate a small Smart Rollup
Let’s try to originate the debug kernel that only display “Hello from kernel!” on each new Tezos block level.
This kernel is simple to originate because when built, its size is smaller than 24KB.
First step: let’s build it.
If you want to learn more about this announcement, please read our blog post on Marigold website
Originating a Smart Rollup