-
Notifications
You must be signed in to change notification settings - Fork 2
Home
These instructions were tested on Ubuntu 17.04.
First install dependencies
apt-get install -y wget gcc ocaml opam libzarith-ocaml-dev m4 pkg-config zlib1g-dev
opam init -y
eval $(opam config env)
opam install cryptokit
Then go to the interpreter directory of the repo
cd interpreter
make
This should generate the executable wasm in the interpreter directory.
./wasm -m ../test/core/fac.wast
If there are no errors, it means that the tests were passed.
./wasm -t -m ../test/core/fac.wast
This command will print the trace messages, it will basically output every instruction that the interpreter runs.
Outputting proofs:
./wasm -step 4 -m ../test/core/fac.wast
This will make a proof for step 4 in the computation. Because there are many test cases, it will output many proofs.
Install the test server. Testrpc seems to require a recent version of Node.js:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g ethereumjs-testrpc
Install Solidity compiler from https://github.com/ethereum/solidity/releases
Compiling instruction.sol to EVM bytecodes:
cd solidity
./test.sh
Starting up the test server:
testrpc
Copy one of the generated addresses, and this line in modify test.js
var base = "0xb29e66c60114e5ddc9a60e61e38e6b60a7448c25"
so that it has one of the generated addresses.
Change the line
var test = JSON.parse(fs.readFileSync("load.json"))
to test another proof.
Comment and uncomment the lines in the end of test.js to select which phase is tested.
Running the test:
npm install web3
node test.js
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).