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
wasmtimewhich exposes genvm-sdk-wasi implementation and does all the sandboxing work - modules: Implementation of modules and manager
- runners: various "runners" available for contracts to use
- software floating point implementation
- python interpreter with built-in bindings to genlayer wasm module
- python standard library from genlayer
- ...
For "getting started" documentation please refer to GenLayer documentation
For more complex examples you can look into test suite
Required tools:
- git
- ruby (3.*)
- ninja
- rustup (cargo+rustc)
- (for runners) nix and x86_64 system
All of them (except for the git for obvious reasons) are provided by default shell in build-scripts/devenv/flake.nix (for direnv add use flake ./build-scripts/devenv)
Prelude:
./configure.rb
This command scraps and configures all targets (similar to CMake)ninjais an alternative tomake, it runs build commands- Output is located at
build/outas a "root" (bin,share)
cd $PROJECT_DIRgit submodule update --init --recursive --depth 1source env.sh(not needed if you used flake)git third-party update --all./configure.rbninja -C build(orninja -C build all/bin)- Get
genvm-runners.zipfrom github - merge
build/outandgenvm-runners.zip
WARNING: currently it is supported only on x86_64 linux hosts
cd $PROJECT_DIRnix build -o build/out-universal -v -L .#all-for-platform.universalnix build -o build/out-amd64-linux -v -L .#all-for-platform.amd64-linux- merge outputs
For contributing documentation see contributing page