Skip to content

Latest commit

 

History

History
81 lines (58 loc) · 1.99 KB

installing.md

File metadata and controls

81 lines (58 loc) · 1.99 KB

Installation

The NimPlay installation is currently managed through a simple Makefile. To use it, you shouldn't need anything else besides BASH, GNU Make, CMake and Python.

Obtaining Nim + Clang Docker

make get-nimclang-docker

Obtaining NLVM docker

To use NLVM instead of Nim + Clang use

make get-nlvm-docker
git submodule update --init
make get-wabt
make USE_NLVM=1 tools

Using NLVM docker

make USE_NLVM=1 examples

Using Nim + Clang Docker

make get-nimclang-docker 
git submodule update --init

Note: nimclang docker image contains tools & wabt.

Building the examples

This repo includes a number of examples such as the King of the Hill contract. To build them, use the following commands:

make examples

or

make USE_NLVM=1 examples

Deploying to EWASM Testnet

Nimplay ships with a deploy python script (requires web3py installed). This script key can be used to deploy a contract

Place 32 byte private key, hex encoded in .priv_key_hex

cat > .priv_key_hex
0x0000000000000000000000000000000000000000000000000000000000000000

To deploy a contract use:

./tools/deploy.py  examples/king_of_the_hill.wasm

The following enviroment variables are consumed by the deploy.py script

Varname Default (unset)
PRIVATE_KEY_FILE .priv_key_hex
RPC_URL http://ewasm.ethereum.org:8545
WAT2WASM ./tools/wabt/bin/wat2wasm
WASM2WAT ./tools/wabt/bin/wasm2wat

ModuleNotFoundError: No module named 'web3'

This means web3py is not installed, please install using pip:

pip install --user web3

Also see how to make a virtualenv if you want your packages isolated.