This repository was archived by the owner on Apr 16, 2020. It is now read-only.
forked from ethereumjs/ethereumjs-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Running ganache with the modified VM
anvacaru edited this page May 24, 2019
·
6 revisions
- Node
- Npm
- Follow the instructions from the evm-semantics Readme.md and build the LLVM backend
- To build the
kevm-vm
use the following command in theevm-semantics
repo$ make build-node
Note: For more debug information, you need to build K
with the flag -Dproject.build.type=Debug
$ mvn package -Dproject.build.type=Debug -DskipTests
- Clone the required repositories and initialize them:
- ganache-cli
[email protected]:trufflesuite/ganache-cli.git
cd ganache-cli && npm install && cd ../
- ganache-core
[email protected]:trufflesuite/ganache-core.git
cd ganache-core && npm install && cd ../
- modified ethereumjs-vm
[email protected]:runtimeverification/ethereumjs-vm.git
cd ethereumjs-vm && npm install
- generate the protobuf file
$ protoc --js_out=import_style=commonjs,binary:. lib/proto/msg.proto
- ganache-cli
- Link together the repositories
$ cd ethereumjs-vm/ $ npm link $ cd ../ganache-core/ $ npm link ethereumjs-vm $ npm link $ cd ../ganache-cli/ $ npm link ganache-core
- Build the cli executable
$ cd ganache-cli $ npm build
-
clone openzeppelin-solidity repo
[email protected]:OpenZeppelin/openzeppelin-solidity.git
-
install the dependencies and compile the contracts
$ cd openzeppelin-solidity/ $ npm install $ node_modules/.bin/truffle compile
-
download and place this simplified test file anywhere in the
openzeppelin-solidity/test
folder (optional)
-
Open a terminal and launch the
cli.js
executable which was built earlier inganache-cli
-
Open a second terminal and launch the
kevm-vm
instance with the arguments for port8080
and address127.0.0.1
-
Open a third terminal in which you send a
truffle test
command$ cd openzeppelin-solidity/ $ node_modules/.bin/truffle test /path/to/test/file
If the following error is received while building the kevm-vm
/usr/lib/llvm-6.0/bin/ld.lld: error: undefined symbol: output_file
>>> referenced by finish_rewriting.ll
>>> /tmp/finish_rewriting-babbff.o:(finish_rewriting)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:243: recipe for target '.build/vm/kevm-vm' failed
make: *** [.build/vm/kevm-vm] Error 1
You have to:
- fetch the latest commit for the
llvm-backend
:$ cd k/llvm-backend/src/main/native/llvm-backend/ $ git fetch; git checkout vm
- rebuild
K
,evm-semantics
llvm build andkevm-vm