nimplay/docs/installing.md

82 lines
2.0 KiB
Markdown
Raw Normal View History

2019-08-22 11:27:59 +00:00
# Installation
2019-08-22 11:27:59 +00:00
The NimPlay installation is currently managed through a simple [Makefile](https://github.com/status-im/nimplay/blob/master/Makefile).
To use it, you shouldn't need anything else besides _BASH_, _GNU Make_, _CMake_ and _Python_.
## Obtaining Nim + Clang Docker
```
2019-08-27 11:15:19 +00:00
make get-nimclang-docker
```
## Obtaining NLVM docker
To use NLVM instead of Nim + Clang use
```
2019-09-14 12:44:53 +00:00
make get-nlvm-docker
git submodule update --init
make get-wabt
2019-08-30 15:55:46 +00:00
make USE_NLVM=1 tools
```
2019-08-22 11:27:59 +00:00
### Using NLVM docker
2019-08-22 11:27:59 +00:00
```
2019-08-27 11:24:16 +00:00
make USE_NLVM=1 examples
```
## Using Nim + Clang Docker
2019-08-22 11:27:59 +00:00
```
2019-09-14 12:44:53 +00:00
make get-nimclang-docker
2019-08-22 11:27:59 +00:00
git submodule update --init
```
2019-09-26 18:45:07 +00:00
Note: nimclang docker image contains tools & wabt.
2019-08-22 11:27:59 +00:00
## Building the examples
This repo includes a number of examples such as the [King of the Hill](https://github.com/status-im/nimplay/blob/master/examples/king_of_the_hill.nim) contract. To build them, use the following commands:
```
make examples
```
or
```
make USE_NLVM=1 examples
```
2019-08-30 15:55:46 +00:00
## 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](https://www.liquidweb.com/kb/creating-virtual-environment-ubuntu-16-04/) if you want your packages isolated.