Run SputnikVM in browser through wasm32-unknown-emscripten target.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
Cargo.lock
Cargo.toml
LICENSE
README.md
index.html
package.json
webpack.config.js

README.md

SputnikVM in Browser

This compiles the no_std version of SputnikVM and run it in browser, using Rust's wasm32-unknown-emscripten target.

Get Started

Installing a custom target for Rust is not yet an easy task so it is recommended to use rustup. The no_std version needs Rust nightly due to its use of alloc library.

rustup install nightly
rustup default nightly

After that, install the wasm32-unknown-emscripten target.

rustup target add wasm32-unknown-emscripten

You will need to install emscripten next. Note that the build can take quite a long time.

wget https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz
tar -xvf emsdk-portable.tar.gz
cd emsdk-portable
./emsdk update
./emsdk install sdk-incoming-64bit
source ./emsdk-env.sh

After that, you can compile this project.

npm run compile
npm run serve

Go to http://127.0.0.1:8080 and open the web console. The example will execute a sample EVM program using SputnikVM, and if no error is reported, you will see a 0 printed.