提交 de17fe3d 编写于 作者: peterwillcn's avatar peterwillcn

Readme add binaryen chapter for WASM compiler

上级 9d04aede
FROM ubuntu:16.04
LABEL maintainer="xiaobo <peterwillcn@gmail.com>" version="0.1.1" \
description="This is eosio/eos image" website="https://eos.io" \
reviews="toonsevrin (toonsevrin@gmail.com), etc..."
reviewers="toonsevrin (toonsevrin@gmail.com), etc..."
RUN echo 'APT::Install-Recommends 0;' >> /etc/apt/apt.conf.d/01norecommends \
&& echo 'APT::Install-Suggests 0;' >> /etc/apt/apt.conf.d/01norecommends \
......@@ -48,26 +48,27 @@ RUN cd /tmp && wget https://github.com/WebAssembly/binaryen/archive/1.37.21.tar.
&& cd binaryen-1.37.21 && cmake . && make && mkdir /opt/binaryen && mv /tmp/binaryen-1.37.21/bin /opt/binaryen \
&& ln -s /opt/binaryen/bin/* /usr/local && rm -rf /tmp/*
# Following the official master branch code takes a long time to download, depending on the network speed.
# ** Following the official master branch code takes a long time to download, depending on the network speed.
#RUN cd /tmp && git clone https://github.com/EOSIO/eos.git --recursive \
# && mkdir -p /opt/eos/bin/data-dir && cd eos && mkdir build && cd build \
# && cmake -DWASM_LLVM_CONFIG=/opt/wasm/bin/llvm-config -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/opt/eos ../ \
# && make -j$(nproc) && make install && mv ../contracts / \
# && ln -s /opt/eos/bin/eos* /usr/local/bin \
# && rm -rf /tmp/eos*
#COPY config.ini genesis.json /
#COPY entrypoint.sh /sbin
RUN mkdir -p /opt/eos/bin/data-dir && mkdir -p /tmp/eos/build/
# Using local code saves considerable time, but does't guarantee that your code stays up-to-date
# ** Using local code saves considerable time, but does't guarantee that your code stays up-to-date
COPY . /tmp/eos/
RUN cd /tmp/eos/build && cmake -DWASM_LLVM_CONFIG=/opt/wasm/bin/llvm-config -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/opt/eos ../ \
&& make -j$(nproc) && make install && mv ../contracts / \
&& ln -s /opt/eos/bin/eos* /usr/local/bin \
&& rm -rf /tmp/eos*
COPY Docker/config.ini genesis.json /
COPY Docker/entrypoint.sh /sbin
RUN chmod +x /sbin/entrypoint.sh
VOLUME /opt/eos/bin/data-dir
EXPOSE 9876 8888
......
......@@ -138,6 +138,12 @@ If a repo is cloned without the `--recursive` flag, the submodules can be retrie
The WASM_LLVM_CONFIG environment variable is used to find our recently built WASM compiler.
This is needed to compile the example contracts inside eos/contracts folder and their respective tests.
Also, to use the WASM compiler, eos has an external dependency on
- [binaryen](https://github.com/WebAssembly/binaryen.git)
* need to checkout tag 1.37.21
* also need to run "make install"
* if installed in a location outside of PATH, need to set BINARYEN_ROOT to cmake
#### On Ubuntu:
```commandline
......@@ -268,7 +274,7 @@ cd ~/eos/build/programs/eosc/
./eosc contract exchange ../../../contracts/exchange/exchange.wast ../../../contracts/exchange/exchange.abi
```
## Run in docker
## Run eos in docker
Simple and fast setup of EOS on Docker is also available. Firstly, install dependencies:
......@@ -299,7 +305,7 @@ Get chain info
curl http://127.0.0.1:8888/v1/chain/get_info
```
### Docker run contract example
### Run contract in docker example
You can run the `eosc` commands via `docker exec` command. For example:
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册