Skip to content

Commit 0df765f

Browse files
_
1 parent 932231f commit 0df765f

File tree

99 files changed

+2807
-1680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2807
-1680
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ programs/nodeos/nodeos
7070
scripts/tn_init.sh
7171

7272
tests/plugin_test
73-
tests/config.hpp
74-
unittests/config.hpp
7573
unittests/unit_test
7674

7775
doxygen

CMakeLists.txt

+12
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,18 @@ endif()
235235

236236
add_subdirectory( externals )
237237

238+
if ("${CORE_SYMBOL_NAME}" STREQUAL "")
239+
set( CORE_SYMBOL_NAME "SYS" )
240+
endif()
241+
string(TOUPPER ${CORE_SYMBOL_NAME} CORE_SYMBOL_NAME)
242+
243+
string(LENGTH ${CORE_SYMBOL_NAME} CORE_SYMBOL_NAME_LENGTH)
244+
if (CORE_SYMBOL_NAME_LENGTH GREATER 7)
245+
message(FATAL_ERROR "CORE_SYMBOL_NAME lenght must be a between 1 and 7 characters")
246+
endif()
247+
248+
message( STATUS "Using ${CORE_SYMBOL_NAME} as CORE symbol name")
249+
238250
include(wasm)
239251

240252
add_subdirectory( libraries )

Docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN git clone -b $branch https://github.com/EOSIO/eos.git --recursive \
55
&& cd eos && echo "$branch:$(git rev-parse HEAD)" > /etc/eosio-version \
66
&& cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
77
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/tmp/build -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true \
8-
&& cmake --build /tmp/build --target install
8+
&& cmake --build /tmp/build --target install && rm /tmp/build/bin/eosiocpp
99

1010

1111
FROM ubuntu:18.04

Docker/README.md

+6-20
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Simple and fast setup of EOS.IO on Docker is also available.
1515
## Build eos image
1616

1717
```bash
18-
git clone https://github.com/EOSIO/eos.git --recursive
18+
git clone https://github.com/EOSIO/eos.git --recursive --depth 1
1919
cd eos/Docker
2020
docker build . -t eosio/eos
2121
```
@@ -67,7 +67,7 @@ After `docker-compose up -d`, two services named `nodeosd` and `keosd` will be s
6767
You can run the `cleos` commands via a bash alias.
6868

6969
```bash
70-
alias cleos='docker-compose exec keosd /opt/eosio/bin/cleos -u http://nodeosd:8888'
70+
alias cleos='docker-compose exec keosd /opt/eosio/bin/cleos -u http://nodeosd:8888 --wallet-url http://localhost:8888'
7171
cleos get info
7272
cleos get account inita
7373
```
@@ -86,29 +86,15 @@ docker-compose stop keosd
8686

8787
### Develop/Build custom contracts
8888

89-
Due to the fact that the eosio/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 eosio/builder. However, eosio/builder does not contain eosiocpp. As such, you will need to run eosio/builder interactively, and clone, build and install EOS. Once this is complete, you can then utilize eosiocpp to compile your contracts.
89+
Due to the fact that the eosio/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 eosio/eos-dev image. This image contains both the required binaries and dependencies to build contracts using eosiocpp.
9090

91-
You can also create a Dockerfile that will do this for you.
92-
93-
```
94-
FROM eosio/builder
95-
96-
RUN git clone -b master --depth 1 https://github.com/EOSIO/eos.git --recursive \
97-
&& cd eos \
98-
&& cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
99-
-DCMAKE_C_COMPILER=clang -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true \
100-
&& cmake --build /tmp/build --target install && rm -rf /tmp/build /eos
101-
```
102-
103-
Then, from the same directory as the Dockerfile, simply run:
91+
You can either use the image available on [Docker Hub](https://hub.docker.com/r/eosio/eos-dev/) or navigate into the dev folder and build the image manually.
10492

10593
```bash
106-
docker build -t eosio/contracts .
107-
docker run -it -v /path/to/custom/contracts:/contracts eosio/contracts /bin/bash
94+
cd dev
95+
docker build -t eosio/eos-dev .
10896
```
10997

110-
At this time you should be at a bash shell. You can navigate into the /contracts directory and use eosiocpp to compile your custom contracts.
111-
11298
### Change default configuration
11399

114100
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.

Docker/dev/Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM eosio/builder
2+
ARG branch=master
3+
4+
RUN git clone -b $branch https://github.com/EOSIO/eos.git --recursive \
5+
&& cd eos && echo "$branch:$(git rev-parse HEAD)" > /etc/eosio-version \
6+
&& cmake -H. -B"/opt/eosio" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
7+
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/opt/eosio -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true \
8+
&& cmake --build /opt/eosio --target install \
9+
&& mv /eos/Docker/config.ini / && mv /opt/eosio/contracts /contracts && mv /eos/Docker/nodeosd.sh /opt/eosio/bin/nodeosd.sh \
10+
&& rm -rf /eos
11+
12+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl && rm -rf /var/lib/apt/lists/*
13+
ENV EOSIO_ROOT=/opt/eosio
14+
RUN chmod +x /opt/eosio/bin/nodeosd.sh
15+
ENV LD_LIBRARY_PATH /usr/local/lib
16+
VOLUME /opt/eosio/bin/data-dir
17+
ENV PATH /opt/eosio/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

contracts/asserter/asserter.abi

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"version": "eosio::abi/1.0",
23
"types": [],
34
"structs": [
45
{
@@ -31,5 +32,6 @@
3132
}
3233
],
3334
"tables": [],
34-
"ricardian_clauses": []
35+
"ricardian_clauses": [],
36+
"abi_extensions": []
3537
}

contracts/dice/dice.abi

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
2-
"____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-03-29T02:09:11",
3-
"types": [],
2+
"version": "eosio::abi/1.0",
3+
"types": [{
4+
"new_type_name": "account_name",
5+
"type": "name"
6+
}],
47
"structs": [{
58
"name": "offer",
69
"base": "",
@@ -213,5 +216,6 @@
213216
"type": "account"
214217
}
215218
],
216-
"ricardian_clauses": []
219+
"ricardian_clauses": [],
220+
"abi_extensions": []
217221
}

contracts/dice/dice.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class dice : public eosio::contract {
3535
//@abi action
3636
void offerbet(const asset& bet, const account_name player, const checksum256& commitment) {
3737

38-
eosio_assert( bet.symbol == S(4,EOS) , "only EOS token allowed" );
38+
eosio_assert( bet.symbol == CORE_SYMBOL, "only core token allowed" );
3939
eosio_assert( bet.is_valid(), "invalid bet" );
4040
eosio_assert( bet.amount > 0, "must bet positive quantity" );
4141

contracts/eosio.bios/eosio.bios.abi

+168-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,131 @@
11
{
2-
"types": [],
3-
"structs": [{
2+
"version": "eosio::abi/1.0",
3+
"types": [{
4+
"new_type_name": "account_name",
5+
"type": "name"
6+
},{
7+
"new_type_name": "permission_name",
8+
"type": "name"
9+
},{
10+
"new_type_name": "action_name",
11+
"type": "name"
12+
},{
13+
"new_type_name": "transaction_id_type",
14+
"type": "checksum256"
15+
},{
16+
"new_type_name": "weight_type",
17+
"type": "uint16"
18+
}],
19+
"structs": [{
20+
"name": "permission_level",
21+
"base": "",
22+
"fields": [
23+
{"name":"actor", "type":"account_name"},
24+
{"name":"permission", "type":"permission_name"}
25+
]
26+
},{
27+
"name": "key_weight",
28+
"base": "",
29+
"fields": [
30+
{"name":"key", "type":"public_key"},
31+
{"name":"weight", "type":"weight_type"}
32+
]
33+
},{
34+
"name": "permission_level_weight",
35+
"base": "",
36+
"fields": [
37+
{"name":"permission", "type":"permission_level"},
38+
{"name":"weight", "type":"weight_type"}
39+
]
40+
},{
41+
"name": "wait_weight",
42+
"base": "",
43+
"fields": [
44+
{"name":"wait_sec", "type":"uint32"},
45+
{"name":"weight", "type":"weight_type"}
46+
]
47+
},{
48+
"name": "authority",
49+
"base": "",
50+
"fields": [
51+
{"name":"threshold", "type":"uint32"},
52+
{"name":"keys", "type":"key_weight[]"},
53+
{"name":"accounts", "type":"permission_level_weight[]"},
54+
{"name":"waits", "type":"wait_weight[]"}
55+
]
56+
},{
57+
"name": "newaccount",
58+
"base": "",
59+
"fields": [
60+
{"name":"creator", "type":"account_name"},
61+
{"name":"name", "type":"account_name"},
62+
{"name":"owner", "type":"authority"},
63+
{"name":"active", "type":"authority"}
64+
]
65+
},{
66+
"name": "setcode",
67+
"base": "",
68+
"fields": [
69+
{"name":"account", "type":"account_name"},
70+
{"name":"vmtype", "type":"uint8"},
71+
{"name":"vmversion", "type":"uint8"},
72+
{"name":"code", "type":"bytes"}
73+
]
74+
},{
75+
"name": "setabi",
76+
"base": "",
77+
"fields": [
78+
{"name":"account", "type":"account_name"},
79+
{"name":"abi", "type":"bytes"}
80+
]
81+
},{
82+
"name": "updateauth",
83+
"base": "",
84+
"fields": [
85+
{"name":"account", "type":"account_name"},
86+
{"name":"permission", "type":"permission_name"},
87+
{"name":"parent", "type":"permission_name"},
88+
{"name":"auth", "type":"authority"}
89+
]
90+
},{
91+
"name": "deleteauth",
92+
"base": "",
93+
"fields": [
94+
{"name":"account", "type":"account_name"},
95+
{"name":"permission", "type":"permission_name"}
96+
]
97+
},{
98+
"name": "linkauth",
99+
"base": "",
100+
"fields": [
101+
{"name":"account", "type":"account_name"},
102+
{"name":"code", "type":"account_name"},
103+
{"name":"type", "type":"action_name"},
104+
{"name":"requirement", "type":"permission_name"}
105+
]
106+
},{
107+
"name": "unlinkauth",
108+
"base": "",
109+
"fields": [
110+
{"name":"account", "type":"account_name"},
111+
{"name":"code", "type":"account_name"},
112+
{"name":"type", "type":"action_name"}
113+
]
114+
},{
115+
"name": "canceldelay",
116+
"base": "",
117+
"fields": [
118+
{"name":"canceling_auth", "type":"permission_level"},
119+
{"name":"trx_id", "type":"transaction_id_type"}
120+
]
121+
},{
122+
"name": "onerror",
123+
"base": "",
124+
"fields": [
125+
{"name":"sender_id", "type":"uint128"},
126+
{"name":"sent_trx", "type":"bytes"}
127+
]
128+
},{
4129
"name": "set_account_limits",
5130
"base": "",
6131
"fields": [
@@ -42,7 +167,43 @@
42167
{"name":"from", "type":"account_name"}
43168
]
44169
}],
45-
"actions": [{
170+
"actions": [{
171+
"name": "newaccount",
172+
"type": "newaccount",
173+
"ricardian_contract": ""
174+
},{
175+
"name": "setcode",
176+
"type": "setcode",
177+
"ricardian_contract": ""
178+
},{
179+
"name": "setabi",
180+
"type": "setabi",
181+
"ricardian_contract": ""
182+
},{
183+
"name": "updateauth",
184+
"type": "updateauth",
185+
"ricardian_contract": ""
186+
},{
187+
"name": "deleteauth",
188+
"type": "deleteauth",
189+
"ricardian_contract": ""
190+
},{
191+
"name": "linkauth",
192+
"type": "linkauth",
193+
"ricardian_contract": ""
194+
},{
195+
"name": "unlinkauth",
196+
"type": "unlinkauth",
197+
"ricardian_contract": ""
198+
},{
199+
"name": "canceldelay",
200+
"type": "canceldelay",
201+
"ricardian_contract": ""
202+
},{
203+
"name": "onerror",
204+
"type": "onerror",
205+
"ricardian_contract": ""
206+
},{
46207
"name": "setalimits",
47208
"type": "set_account_limits",
48209
"ricardian_contract": ""
@@ -63,7 +224,8 @@
63224
"type": "require_auth",
64225
"ricardian_contract": ""
65226
}
66-
],
67-
"tables": [],
68-
"ricardian_clauses": []
227+
],
228+
"tables": [],
229+
"ricardian_clauses": [],
230+
"abi_extensions": []
69231
}

contracts/eosio.msig/eosio.msig.abi

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
{
2+
"version": "eosio::abi/1.0",
23
"types": [{
34
"new_type_name": "account_name",
45
"type": "name"
5-
}
6-
],
6+
},{
7+
"new_type_name": "permission_name",
8+
"type": "name"
9+
},{
10+
"new_type_name": "action_name",
11+
"type": "name"
12+
}],
713
"structs": [{
814
"name": "permission_level",
915
"base": "",
@@ -139,7 +145,8 @@
139145
"index_type": "i64",
140146
"key_names" : ["proposal_name"],
141147
"key_types" : ["name"]
142-
}
148+
}
143149
],
144-
"ricardian_clauses": []
150+
"ricardian_clauses": [],
151+
"abi_extensions": []
145152
}

0 commit comments

Comments
 (0)