All Projects → xuperchain → Wavm

xuperchain / Wavm

Licence: other
A High Performance XuperChain WASM Virtual Machine based on WAVM

Projects that are alternatives of or similar to Wavm

Markdown Wasm
Markdown parser and HTML generator implemented in WebAssembly, based on md4c
Stars: ✭ 833 (+4065%)
Mutual labels:  webassembly
Wasm Json Toolkit
[ORPHANED] A small toolkit for converting wasm binaries into json and back.
Stars: ✭ 23 (+15%)
Mutual labels:  webassembly
Schnorrkel Js
a Javascript wrapper for schnorrkel signatures on Ristretto using WebAssembly.
Stars: ✭ 14 (-30%)
Mutual labels:  webassembly
Gameboy
🎮 Game Boy emulator written in Rust
Stars: ✭ 17 (-15%)
Mutual labels:  webassembly
Gltfpp
glTF 2.0 loader for C++14
Stars: ✭ 22 (+10%)
Mutual labels:  webassembly
Nearcore
Reference client for NEAR Protocol
Stars: ✭ 840 (+4100%)
Mutual labels:  webassembly
Design
Ewasm Design Overview and Specification
Stars: ✭ 827 (+4035%)
Mutual labels:  webassembly
Wps Backend
Smart contract for the Worker Proposal System
Stars: ✭ 15 (-25%)
Mutual labels:  webassembly
Viper
[WIP] A Pythonesque language with a design that focuses on efficiency and expressiveness. Compiles to WebAssembly
Stars: ✭ 23 (+15%)
Mutual labels:  webassembly
Notecalc3
NoteCalc is a handy calculator trying to bring the advantages of Soulver to the web.
Stars: ✭ 879 (+4295%)
Mutual labels:  webassembly
Tungsten
Ricardian contract bond, claim, and arbitration management system
Stars: ✭ 17 (-15%)
Mutual labels:  webassembly
Yew Starter
A template for starting a Yew.
Stars: ✭ 22 (+10%)
Mutual labels:  webassembly
Webrtc
Pure Go implementation of the WebRTC API
Stars: ✭ 8,399 (+41895%)
Mutual labels:  webassembly
Awesome Wasm Zh
WebAssembly(wasm)资源精选
Stars: ✭ 838 (+4090%)
Mutual labels:  webassembly
Eosocial
Deprecated - 📝 Sample dApp of Votable SNS run by EOS Testnet.
Stars: ✭ 14 (-30%)
Mutual labels:  webassembly
Dapp Boilerplate
🌀 Decentralize application boilerplate with React Redux and Firebase integration.
Stars: ✭ 6 (-70%)
Mutual labels:  webassembly
Zemeroth
😠⚔️😈 A minimalistic 2D turn-based tactical game in Rust
Stars: ✭ 940 (+4600%)
Mutual labels:  webassembly
Slate
🌌 A new, strongly-typed, fast, and secure programming language made for WebAssembly.
Stars: ✭ 15 (-25%)
Mutual labels:  webassembly
Wagon
wagon, a WebAssembly-based Go interpreter, for Go.
Stars: ✭ 882 (+4310%)
Mutual labels:  webassembly
Csla
A home for your business logic in any .NET application.
Stars: ✭ 865 (+4225%)
Mutual labels:  webassembly

WAVM for XuperChain

This is a XuperChain WASM Virtual Machine based on WAVM/WAVM, most of the changes compared to the original repo are that we add gas metering to the wasm code and provide a golang wrapper. All the changes are not invasive to the original WAVM.

C/C++ code compiled with emscripten can run on WAVM without any other resolvers. For other languages it doesn't support yet.

Quick start

Requirements:

  • GCC 5.x
  • LLVM 8.0.0 (recommended)
  • XuperUnion v3.1

Standalone

If you try to test the new fetures like gas metering, just do as the original repository tells you : Building WAVM

we also provide a more unix-like way to build:

  1. install llvm and clang by here, assume your installation directory is ${llvm_install_dir}
  2. build
cd ${source-to-wavm}
CXX=${llvm_install_dir}/bin/clang++ CC=${llvm_install_dir}/bin/clang LLVMDIR=${llvm_install_dir}/lib/cmake/llvm make

Then run this command, you will get the gas used as the debug output.

./output/wavm-run -d ../Example/hello.wast

XuperChain

XuperChain is pluggable cause almost all the component included is pluggable, so is smart contract virtual machine. There are three steps to make it work.

  1. Compile WAVM.
cd ${source-to-wavm}
CXX=${llvm_install_dir}/bin/clang++ CC=${llvm_install_dir}/bin/clang LLVMDIR=${llvm_install_dir}/lib/cmake/llvm make
  1. cd ${source-to-wavm}, run make to build the plugin, copy it to the plugins directory, then add or update plugins.conf with
   "wasm":[{
   "subtype":"wavm",
   "path": "plugins/vm/wavm.so",
   "version": "1.0.0",
   "ondemand": false
 }]
  1. Add the configure to xchain.yaml:
wasm:
  driver: wavm
  external: true

external means it should be loaded as a plugin. Be careful that shim depends on xuperunion(which should be compiled by enabling GO111MODULE=on without -mod=vendor, remove the export GOFLAGS=-mod=vendor from xuperchain's Makefile), so make sure that shim requires the same version of xuperunion who load this plugin,

or an error as below maybe occur:

Warn: plugin open failed!" module=pluginmgr pluginname=wasm 
err="plugin.Open(\"plugins/wavm\"): plugin was built with a different version of package github.com/xuperchain/xuperunion/..."

FAQ

  1. libWAVM.so: cannot open shared object file: No such file or directory"

libWAVM.so is in the ${source-to-wavm}/WAVM/output by default. so if you intend to deploy wavm.so to other server, you can copy the libWAVM.so to any directory and set environment LD_LIBRARY_PATH to this directory.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].