beam_bvm_interface

Crates.iobeam_bvm_interface
lib.rsbeam_bvm_interface
version
sourcesrc
created_at2022-09-18 05:47:28.32553
updated_at2022-10-03 03:35:43.322684
descriptionA direct interface to the Beam Virtual Machine functions and data structures
homepage
repositoryhttps://github.com/NewDark90/beam-bvm-interface
max_upload_size
id668493
size0
Zachary Dow (NewDark90)

documentation

README

beam-bvm-interface

A rust crate for referencing all of the Beam Virtual Machine methods and structs for dapps

What to expect

All of the code here has been auto generated with bindgen. The goal of this package is to be the lowest level direct interface with the Beam Virtual Machine.

Documentation of the methods usable within the BVM can be found at the BeamMW Shader-SDK wiki

Installation

Install with cargo:

cargo install beam_bvm_interface

Compiling

This crate is not going to delve into the specifics of compiling for the BVM. The steps needed in order to compile at all are here for you though. This assumes a workspace with a contract package, app package, and optional shared code in a common package.

  1. Install rustup on your system. See rust installation instructions here.
  2. Install rust toolchain: $ rustup toolchain install stable
  3. Add wasm32-wasi target $ rustup target add wasm32-wasi
  4. Compile the project $ cargo build --target wasm32-wasi -r
  5. Compiled wasm files will be in ./target/wasm32-wasi/release directory

After that you can use app.wasm and contract.wasm files in the same way you use it in Beam's contracts (see https://github.com/BeamMW/shader-sdk/wiki/Running-Beam-Shaders-using-CLI-Wallet).

An example project can be used as a starter here: https://github.com/NewDark90/beam-bvm-starter

Commit count: 14

cargo fmt