Skip to content

yeagerai/genvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GenVM

Discord Twitter

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.

About

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
    • ...

GenVM for users

For "getting started" documentation please refer to GenLayer documentation

For more complex examples you can look into this part of test suite

Building from source

Prelude:

  • ./tools/ya-build/ya-build config
    This command scraps and configures all targets (similar to CMake)
  • ninja is an alternative to make, 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)

Simple

  1. cd $PROJECT_DIR
  2. git submodule update --init --recursive --depth 1
  3. ./build-scripts/install/install-deps.rb --os --rust --genvm
  4. source env.sh
  5. git third-party update --all
  6. ya-build config (for release build pass --preload .ci/release-conf.rb)
  7. ninja -C build genvm/executor/all
  8. Get genvm-runners.zip from github
  9. merge build/out and genvm-runners.zip

Full

It will also require docker and docker-buildx

  1. cd $PROJECT_DIR
  2. git submodule update --init --recursive --depth 1
  3. ./build-scripts/install/install-deps.rb --os --rust --genvm --runners
  4. source env.sh
  5. ya-build config (for release build pass --preload .ci/release-conf.rb)
  6. ninja -C build tags/all
  7. full genvm (including runners) is located at build/out

Contributing

For contributing documentation see contributing page