Repository for the developer documentation of Linera hosted on https://linera.dev
cargo install [email protected] mdbook-linkcheck mdbook-mermaid mdbook-admonish
Because we override the default template, the exact version matters. To upgrade mdbook,
you will have to run mdbook init --theme and do a 3-way merge by hand.
git submodule update --init
To discard local changes to the submodule (the equivalent of git checkout -f HEAD for
files), use git submodule update.
To commit local changes, use git commit -a as usual.
IMPORTANT: The HEAD of linera-protocol should be a commit hash (not a branch name).
The complete workflow may look like this:
# Update the files `RELEASE_BRANCH` and `RELEASE_VERSION` to desired release branch and
# release version of linera-protocol:
# echo devnet_YYYY_MM_DD > RELEASE_BRANCH
# echo 0.M.N > RELEASE_VERSION
# cat RELEASE_BRANCH | sed 's/_/-/g' > RELEASE_DOMAIN
REMOTE_BRANCH="origin/$(cat RELEASE_BRANCH)"
cd linera-protocol
git fetch origin
git checkout $(git rev-parse $REMOTE_BRANCH)
cargo clean
cargo clippy --locked -p linera-sdk --features test,wasmer
DUPLICATE_LIBS=(target/debug/deps/libserde-* target/debug/deps/liblinera_sdk-*)
cargo build --locked -p linera-sdk --features test,wasmer
# mdbook test wants only one library but build dependencies can create duplicates.
rm "${DUPLICATE_LIBS[@]}"
cd ..
mdbook test -L linera-protocol/target/debug/deps
git commit -aNOTE: mdbook doesn't use rust-toolchain.toml. Make sure to set the appropriate version
of Rust with Rustup before calling mdbook test.
mdbook serve
Then, open the URL as instructed.
This repository is formatted with prettier. To install prettier run npm install -g prettier. To use prettier run prettier --write src. The repository is automatically
checked for formatting in CI.