Bytecode emulator with per-step state proof. It can be used to generate challenge proof of optimistic rollup, and other scenarios in blockchain which need state proof.
Could emulate program built with:
- Arch: MIPS32
- OS: Linux
- Executable File Format: ELF 32-bit MSB
May support more in the future.
The project contains two Rust crates:
./omo
: main entrypoint of the OMO emulator../rust-mips-example
: example crate. It is configured to build into a linux mips binary, which can be run byomo
.
- Add mips-unknown-linux-musl supports:
rustup target add mips-unknown-linux-musl
- Download musl toolchain from musl.cc: mips-linux-musl-cross
Compile rust-mips-example
:
cd ./rust-mips-example
cross build --target mips-unknown-linux-musl --release -v
# the compiled mips binary will be ./target/mips-unknown-linux-musl/release/rust-mips-example
file target/mips-unknown-linux-musl/release/rust-mips-example
If using MUSL tools:
- Set
linker = "mips-linux-musl-gcc"
in cargo config
cargo build --target mips-unknown-linux-musl --release --no-default-features
Compile OMO
:
cargo build --release
Run:
cd ./omo
cargo run -- --config config.toml.example --env E1=a --env E2=b ../rust-mips-example/target/mips-unknown-linux-musl/release/rust-mips-example E1 E2
Output:
Run ../rust-mips-example/target/mips-unknown-linux-musl/release/rust-mips-example
E1=a
E2=b
Distributed under the Apache License 2.0. See LICENSE for more information.