Skip to content

Commit

Permalink
Merge pull request EOSIO#128 from enumivo/staging
Browse files Browse the repository at this point in the history
merge from eosio master
  • Loading branch information
Enumivo authored May 18, 2018
2 parents e84120c + f2839d7 commit 8743be5
Show file tree
Hide file tree
Showing 50 changed files with 1,709 additions and 1,047 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ programs/enunode/enunode
scripts/tn_init.sh

tests/plugin_test
tests/config.hpp
unittests/config.hpp
unittests/unit_test

doxygen
Expand Down
2 changes: 1 addition & 1 deletion Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN git clone -b $branch https://github.com/enumivo/enumivo.git --recursive \
&& cd eos && echo "$branch:$(git rev-parse HEAD)" > /etc/eosio-version \
&& cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/tmp/build -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true \
&& cmake --build /tmp/build --target install
&& cmake --build /tmp/build --target install && rm /tmp/build/bin/eosiocpp


FROM ubuntu:18.04
Expand Down
26 changes: 6 additions & 20 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Simple and fast setup of Enumivo on Docker is also available.
## Build eos image

```bash
git clone https://github.com/enumivo/enumivo.git --recursive
git clone https://github.com/enumivo/enumivo.git --recursive --depth 1
cd eos/Docker
docker build . -t enumivo/eos
```
Expand Down Expand Up @@ -67,7 +67,7 @@ After `docker-compose up -d`, two services named `nodeosd` and `enuwallet` will
You can run the `enucli` commands via a bash alias.

```bash
alias enucli='docker-compose exec enuwallet /opt/enumivo/bin/enucli -u http://nodeosd:8888'
alias enucli='docker-compose exec enuwallet /opt/enumivo/bin/enucli -u http://nodeosd:8888 --wallet-url http://localhost:8888'
enucli get info
enucli get account inita
```
Expand All @@ -86,29 +86,15 @@ docker-compose stop enuwallet

### Develop/Build custom contracts

Due to the fact that the enumivo/eos image does not contain the required dependencies for contract development (this is by design, to keep the image size small), you will need to utilize enumivo/builder. However, enumivo/builder does not contain enumivocpp. As such, you will need to run enumivo/builder interactively, and clone, build and install Enumivo. Once this is complete, you can then utilize enumivocpp to compile your contracts.
Due to the fact that the enumivo/eos image does not contain the required dependencies for contract development (this is by design, to keep the image size small), you will need to utilize the enumivo/eos-dev image. This image contains both the required binaries and dependencies to build contracts using enumivocpp.

You can also create a Dockerfile that will do this for you.

```
FROM enumivo/builder
RUN git clone -b master --depth 1 https://github.com/enumivo/enumivo.git --recursive \
&& cd eos \
&& cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true \
&& cmake --build /tmp/build --target install && rm -rf /tmp/build /eos
```

Then, from the same directory as the Dockerfile, simply run:
You can either use the image available on [Docker Hub](https://hub.docker.com/r/enumivo/eos-dev/) or navigate into the dev folder and build the image manually.

```bash
docker build -t enumivo/contracts .
docker run -it -v /path/to/custom/contracts:/contracts enumivo/contracts /bin/bash
cd dev
docker build -t enumivo/eos-dev .
```

At this time you should be at a bash shell. You can navigate into the /contracts directory and use enumivocpp to compile your custom contracts.

### Change default configuration

You can use docker compose override file to change the default configurations. For example, create an alternate config file `config2.ini` and a `docker-compose.override.yml` with the following content.
Expand Down
17 changes: 17 additions & 0 deletions Docker/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM eosio/builder
ARG branch=master

RUN git clone -b $branch https://github.com/EOSIO/eos.git --recursive \
&& cd eos && echo "$branch:$(git rev-parse HEAD)" > /etc/eosio-version \
&& cmake -H. -B"/opt/eosio" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/opt/eosio -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true \
&& cmake --build /opt/eosio --target install \
&& mv /eos/Docker/config.ini / && mv /opt/eosio/contracts /contracts && mv /eos/Docker/nodeosd.sh /opt/eosio/bin/nodeosd.sh \
&& rm -rf /eos

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl && rm -rf /var/lib/apt/lists/*
ENV EOSIO_ROOT=/opt/eosio
RUN chmod +x /opt/eosio/bin/nodeosd.sh
ENV LD_LIBRARY_PATH /usr/local/lib
VOLUME /opt/eosio/bin/data-dir
ENV PATH /opt/eosio/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
4 changes: 3 additions & 1 deletion contracts/asserter/asserter.abi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"version": "enumivo::abi/1.0",
"types": [],
"structs": [
{
Expand Down Expand Up @@ -31,5 +32,6 @@
}
],
"tables": [],
"ricardian_clauses": []
"ricardian_clauses": [],
"abi_extensions": []
}
10 changes: 7 additions & 3 deletions contracts/dice/dice.abi
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"____comment": "This file was generated by enugenabi. DO NOT EDIT - 2018-03-29T02:09:11",
"types": [],
"version": "enumivo::abi/1.0",
"types": [{
"new_type_name": "account_name",
"type": "name"
}],
"structs": [{
"name": "offer",
"base": "",
Expand Down Expand Up @@ -213,5 +216,6 @@
"type": "account"
}
],
"ricardian_clauses": []
"ricardian_clauses": [],
"abi_extensions": []
}
174 changes: 168 additions & 6 deletions contracts/enumivo.bios/enumivo.bios.abi
Original file line number Diff line number Diff line change
@@ -1,6 +1,131 @@
{
"types": [],
"structs": [{
"version": "enumivo::abi/1.0",
"types": [{
"new_type_name": "account_name",
"type": "name"
},{
"new_type_name": "permission_name",
"type": "name"
},{
"new_type_name": "action_name",
"type": "name"
},{
"new_type_name": "transaction_id_type",
"type": "checksum256"
},{
"new_type_name": "weight_type",
"type": "uint16"
}],
"structs": [{
"name": "permission_level",
"base": "",
"fields": [
{"name":"actor", "type":"account_name"},
{"name":"permission", "type":"permission_name"}
]
},{
"name": "key_weight",
"base": "",
"fields": [
{"name":"key", "type":"public_key"},
{"name":"weight", "type":"weight_type"}
]
},{
"name": "permission_level_weight",
"base": "",
"fields": [
{"name":"permission", "type":"permission_level"},
{"name":"weight", "type":"weight_type"}
]
},{
"name": "wait_weight",
"base": "",
"fields": [
{"name":"wait_sec", "type":"uint32"},
{"name":"weight", "type":"weight_type"}
]
},{
"name": "authority",
"base": "",
"fields": [
{"name":"threshold", "type":"uint32"},
{"name":"keys", "type":"key_weight[]"},
{"name":"accounts", "type":"permission_level_weight[]"},
{"name":"waits", "type":"wait_weight[]"}
]
},{
"name": "newaccount",
"base": "",
"fields": [
{"name":"creator", "type":"account_name"},
{"name":"name", "type":"account_name"},
{"name":"owner", "type":"authority"},
{"name":"active", "type":"authority"}
]
},{
"name": "setcode",
"base": "",
"fields": [
{"name":"account", "type":"account_name"},
{"name":"vmtype", "type":"uint8"},
{"name":"vmversion", "type":"uint8"},
{"name":"code", "type":"bytes"}
]
},{
"name": "setabi",
"base": "",
"fields": [
{"name":"account", "type":"account_name"},
{"name":"abi", "type":"bytes"}
]
},{
"name": "updateauth",
"base": "",
"fields": [
{"name":"account", "type":"account_name"},
{"name":"permission", "type":"permission_name"},
{"name":"parent", "type":"permission_name"},
{"name":"auth", "type":"authority"}
]
},{
"name": "deleteauth",
"base": "",
"fields": [
{"name":"account", "type":"account_name"},
{"name":"permission", "type":"permission_name"}
]
},{
"name": "linkauth",
"base": "",
"fields": [
{"name":"account", "type":"account_name"},
{"name":"code", "type":"account_name"},
{"name":"type", "type":"action_name"},
{"name":"requirement", "type":"permission_name"}
]
},{
"name": "unlinkauth",
"base": "",
"fields": [
{"name":"account", "type":"account_name"},
{"name":"code", "type":"account_name"},
{"name":"type", "type":"action_name"}
]
},{
"name": "canceldelay",
"base": "",
"fields": [
{"name":"canceling_auth", "type":"permission_level"},
{"name":"trx_id", "type":"transaction_id_type"}
]
},{
"name": "onerror",
"base": "",
"fields": [
{"name":"sender_id", "type":"uint128"},
{"name":"sent_trx", "type":"bytes"}
]
},{
"name": "set_account_limits",
"base": "",
"fields": [
Expand Down Expand Up @@ -42,7 +167,43 @@
{"name":"from", "type":"account_name"}
]
}],
"actions": [{
"actions": [{
"name": "newaccount",
"type": "newaccount",
"ricardian_contract": ""
},{
"name": "setcode",
"type": "setcode",
"ricardian_contract": ""
},{
"name": "setabi",
"type": "setabi",
"ricardian_contract": ""
},{
"name": "updateauth",
"type": "updateauth",
"ricardian_contract": ""
},{
"name": "deleteauth",
"type": "deleteauth",
"ricardian_contract": ""
},{
"name": "linkauth",
"type": "linkauth",
"ricardian_contract": ""
},{
"name": "unlinkauth",
"type": "unlinkauth",
"ricardian_contract": ""
},{
"name": "canceldelay",
"type": "canceldelay",
"ricardian_contract": ""
},{
"name": "onerror",
"type": "onerror",
"ricardian_contract": ""
},{
"name": "setalimits",
"type": "set_account_limits",
"ricardian_contract": ""
Expand All @@ -63,7 +224,8 @@
"type": "require_auth",
"ricardian_contract": ""
}
],
"tables": [],
"ricardian_clauses": []
],
"tables": [],
"ricardian_clauses": [],
"abi_extensions": []
}
9 changes: 7 additions & 2 deletions contracts/enumivo.coin/enumivo.coin.abi
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"types": [],
"version": "enumivo::abi/1.0",
"types": [{
"new_type_name": "account_name",
"type": "name"
}],
"structs": [{
"name": "transfer",
"base": "",
Expand Down Expand Up @@ -69,5 +73,6 @@
"key_types" : ["uint64"]
}
],
"ricardian_clauses": []
"ricardian_clauses": [],
"abi_extensions": []
}
15 changes: 11 additions & 4 deletions contracts/enumivo.msig/enumivo.msig.abi
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"version": "enumivo::abi/1.0",
"types": [{
"new_type_name": "account_name",
"type": "name"
}
],
},{
"new_type_name": "permission_name",
"type": "name"
},{
"new_type_name": "action_name",
"type": "name"
}],
"structs": [{
"name": "permission_level",
"base": "",
Expand Down Expand Up @@ -139,7 +145,8 @@
"index_type": "i64",
"key_names" : ["proposal_name"],
"key_types" : ["name"]
}
}
],
"ricardian_clauses": []
"ricardian_clauses": [],
"abi_extensions": []
}
Loading

0 comments on commit 8743be5

Please sign in to comment.