All Projects → TrueBitFoundation → webasm-solidity

TrueBitFoundation / webasm-solidity

Licence: MIT license
[DEPRECATED] On-chain interpreter for WebAssembly written in Solidity

Programming Languages

solidity
1140 projects
javascript
184084 projects - #8 most used programming language
c
50402 projects - #5 most used programming language
HTML
75241 projects
shell
77523 projects
WebAssembly
147 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to webasm-solidity

ocaml-offchain
Fork of WebAssembly reference interpreter with support for generating proofs needed for blockchain verification
Stars: ✭ 42 (-35.38%)
Mutual labels:  interpreter, truebit
PDDL.jl
Julia parser, interpreter and compiler interface for the Planning Domain Definition Language (PDDL). Planners not included.
Stars: ✭ 52 (-20%)
Mutual labels:  interpreter
monkey-interpreter
Monkey programming language interpreter designed in "Writing An Interpreter In Go".
Stars: ✭ 26 (-60%)
Mutual labels:  interpreter
foxscheme
An R5RS Scheme in JavaScript.
Stars: ✭ 15 (-76.92%)
Mutual labels:  interpreter
foolang
A toy programming language.
Stars: ✭ 33 (-49.23%)
Mutual labels:  interpreter
pyccolo
Declarative instrumentation for Python.
Stars: ✭ 70 (+7.69%)
Mutual labels:  interpreter
chip8
CHIP-8 Emulator in Rust
Stars: ✭ 12 (-81.54%)
Mutual labels:  interpreter
AlchemyVM
WebAssembly Virtual Machine Built In Elixir
Stars: ✭ 184 (+183.08%)
Mutual labels:  interpreter
locks-py
Python implementation of locks, which is an imperative, dynamically typed, procedure oriented scripting language based on the lox programming language.
Stars: ✭ 29 (-55.38%)
Mutual labels:  interpreter
monkey
The Monkey Programming Language & Interpreter written in PHP.
Stars: ✭ 21 (-67.69%)
Mutual labels:  interpreter
JSchemeMin
A small scheme implementation in java
Stars: ✭ 22 (-66.15%)
Mutual labels:  interpreter
roda
Röda: A stream-oriented scripting language
Stars: ✭ 43 (-33.85%)
Mutual labels:  interpreter
jsish
Jsi is a small, C-embeddable javascript interpreter with tightly woven Web and DB support.
Stars: ✭ 32 (-50.77%)
Mutual labels:  interpreter
lunatic
lunatic: a toy lua interpreter
Stars: ✭ 16 (-75.38%)
Mutual labels:  interpreter
slox
Swift implementation of a Lox interpreter
Stars: ✭ 39 (-40%)
Mutual labels:  interpreter
Tiny-Basic
A tiny and basic TINY-BASIC interpreter
Stars: ✭ 33 (-49.23%)
Mutual labels:  interpreter
fastbasic
FastBasic - Fast BASIC interpreter for the Atari 8-bit computers
Stars: ✭ 108 (+66.15%)
Mutual labels:  interpreter
Dictu
Dictu is a high-level dynamically typed, multi-paradigm, interpreted programming language.
Stars: ✭ 191 (+193.85%)
Mutual labels:  interpreter
blade
A simple, fast, clean, and dynamic language that allows you to develop applications quickly.
Stars: ✭ 113 (+73.85%)
Mutual labels:  interpreter
HaxeVM
Prototype compiler/virtual machine in Haxe for Haxe
Stars: ✭ 24 (-63.08%)
Mutual labels:  interpreter

Build Status

On-chain interpreter

This project contains the code for the WASM onchain dispute resolution.

Usage

Install necessary dependencies:

npm install

Ensure you have a development blockchain you can use. For example:

npm install -g ganache-cli

ganache-cli

Or you can use parity:

Install Parity, then run it with

echo > passfile
parity --chain dev --unlock=0x00a329c0648769a73afac7f9381e08fb43dbea72 --reseal-min-period 0 --password passfile

If Parity complains about password or missing account, try

parity --chain dev --unlock=0x00a329c0648769a73afac7f9381e08fb43dbea72

and then exit Parity. Now it should have created the development account.

Then you need to compile the smart contracts. You will need solc already installed on your machine.

You will also need to download and install ocaml-offchain next to the webasm-solidity (ex: ../webasm-solidity)

chmod 755 ./scripts/compile.sh
npm run compile

Then deploy the smart contracts to the blockchain with:

npm run deploy

Now you can run the task lifecycle test

npm run test test/task-lifecycle.js

To test the solidity wasm interpreter run this

chmod 755 ./scripts/runtests.sh

If the test doesn't output an error, it should have passed. If the proof was wrong, then it will complain about invalid EVM opcode (this is how reverting the state is currently handled in the EVM).

Example Application

If you want to see the code in the context of an example application follow these instructions. This application uses ipfs so you'll have to make sure you install it. In a separate directory follow these installation instructions:

wget https://dist.ipfs.io/go-ipfs/v0.4.10/go-ipfs_v0.4.10_linux-amd64.tar.gz
tar xf go-ipfs_v0.4.10_linux-amd64.tar.gz
cd go-ipfs
./install.sh
ipfs init

And then the daemon can be started with:

ipfs daemon

Run the test node:

cd node/
node deploy-tasks.js > config.json
node app.js

For user interface, app.html and socketio.js have to be on a web server in the same machine as the test node is running.

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