GenVM is the execution environment for Intelligent Contracts in the GenLayer protocol. It serves as the backbone for processing and managing contract operations within the GenLayer ecosystem.
GenVM's only purpose is to execute Intelligent Contracts, which can have non-deterministic code while maintaining blockchain security and consistency.
It is a monorepo for GenVM, which consists of the following sub-projects:
- executor core GenVM itself: modified
wasmtime
which exposes genvm-sdk-wasi implementation and does all the sandboxing work - sdk-rust: rust bindings for genvm-sdk-wasi, this library is autogenerated from witx
- runners: various "runners" available for contracts to use
- software floating point implementation
- python interpreter with built-in
sdk-rust
- python standard library from genlayer
- ...
For "getting started" documentation please refer to GenLayer documentation
For more complex examples you can look into this part of test suite
Prelude:
./tools/ya-build/ya-build config
This command scraps and configures all targets (similar to CMake)ninja
is an alternative tomake
, it runs build commands- Output is located at
build/out
as a "root" (bin
,lib
,share
)
Required tools:
- git
- ruby (3.*, otherwise it will be installed from a script)
- ... can be installed via scripts (see below)
cd $PROJECT_DIR
git submodule update --init --recursive --depth 1
./build-scripts/install/install-deps.rb --os --rust --genvm
source env.sh
git third-party update --all
ya-build config
(for release build pass--preload .ci/release-conf.rb
)ninja -C build genvm/executor/all
- Get
genvm-runners.zip
from github - merge
build/out
andgenvm-runners.zip
It will also require docker
and docker-buildx
cd $PROJECT_DIR
git submodule update --init --recursive --depth 1
./build-scripts/install/install-deps.rb --os --rust --genvm --runners
source env.sh
ya-build config
(for release build pass--preload .ci/release-conf.rb
)ninja -C build tags/all
- full genvm (including runners) is located at
build/out
For contributing documentation see contributing page