Skip to content

Commit

Permalink
Merge pull request #26 from boscore/release/3.0.x
Browse files Browse the repository at this point in the history
prepare v3.0.0 to master
  • Loading branch information
qianxiaofeng authored May 7, 2019
2 parents f83fbb7 + a9a5d26 commit a786ae3
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 57 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ else()
endif()


set(VERSION_MAJOR 2)
set(VERSION_MAJOR 3)
set(VERSION_MINOR 0)
set(VERSION_PATCH 2)
set(VERSION_PATCH 0)
#set(VERSION_SUFFIX )

if (VERSION_SUFFIX)
Expand Down
54 changes: 1 addition & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,13 @@
# BOSCore.CDT (Contract Development Toolkit)

## BOSCore.CDT Version: v2.0.2
## BOSCore.CDT Version: v3.0.0
## Basic EOSIO.CDT Version: 1.5.0

## Use BOSCore CDT docker image to build smart conrtacts

**In order to speed up the progress of contracts development, BOSCore supply complied docker image.**
**By CDT docker image, you can start build you contracts without build BOSCore.CDT firstly. Please check [README](docker/README.md).**


EOSIO.CDT is a toolchain for WebAssembly (WASM) and set of tools to facilitate contract writing for the EOSIO platform. In addition to being a general purpose WebAssembly toolchain, [EOSIO](https://github.com/eosio/eos) specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around [Clang 7](https://github.com/eosio/llvm), which means that EOSIO.CDT has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete.

## Important!
EOSIO.CDT Version 1.3.x introduced quite a few breaking changes. To have binary releases we needed to remove the concept of a core symbol from EOSIO.CDT. This meant drastic changes to symbol, asset and other types/functions that were connected to them. Since these changes would be disruptive, we decided to add as many disruptive changes needed for future contract writing, so that disruption should only occur once. Please read the **_Differences between Version 1.2.x and Version 1.3.x_** section of this readme.

### Binary Releases
EOSIO.CDT currently supports Mac OS X brew, Linux x86_64 Debian packages, and Linux x86_64 RPM packages.

**If you have previously installed EOSIO.CDT, please run the `uninstall` script (it is in the directory where you cloned EOSIO.CDT) before downloading and using the binary releases.**

#### Mac OS X Brew Install
```sh
$ brew tap eosio/eosio.cdt
$ brew install eosio.cdt
```
#### Mac OS X Brew Uninstall
```sh
$ brew remove eosio.cdt
```
#### Debian Package Install
```sh
$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.5.0/eosio.cdt-1.5.0-1_amd64.deb
$ sudo apt install ./eosio.cdt-1.5.0-1_amd64.deb
```
#### Debian Package Uninstall
```sh
$ sudo apt remove eosio.cdt
```

#### Fedora RPM Package Install
```sh
$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.5.0/eosio.cdt-1.5.0-1.fc27.x86_64.rpm
$ sudo yum install ./eosio.cdt-1.5.0-1.fc27.x86_64.rpm
```

#### Fedora RPM Package Uninstall
```sh
$ sudo yum remove eosio.cdt
```

#### Centos RPM Package Install
```sh
$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.5.0/eosio.cdt-1.5.0-1.el7.x86_64.rpm
$ sudo yum install ./eosio.cdt-1.5.0-1.el7.x86_64.rpm
```

#### Centos RPM Package Uninstall
```sh
$ sudo yum remove eosio.cdt
```

### Guided Installation (Building from Scratch)
```sh
$ git clone --recursive https://github.com/boscore/bos.cdt
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM boscore/builder as builder
ARG branch=master
ARG bosbranch=master

ENV OPENSSL_ROOT_DIR /usr/include/openssl

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates curl wget git cmake python3 g++ vim net-tools lsof wget curl supervisor


RUN cd / && git clone --depth 1 -b master https://github.com/boscore/bos.git --recursive \
RUN cd / && git clone --depth 1 -b $bosbranch https://github.com/boscore/bos.git --recursive \
&& cd /bos \
&& ./eosio_build.sh -s BOS \
&& ./eosio_install.sh \
Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## DIY: How to build self BOSCore CDT Docker image
- modify the [Dockerfile](./Dockerfile) and add yourself commands
- call `docker build -t XXXX/boscdt:vx.x.x --build-arg branch=release/v2.0.x --build-arg symbol=BOS --no-cache .`
- call `docker build -t XXXX/boscdt:vx.x.x --build-arg branch=vx.x.x --build-arg symbol=BOS --no-cache .`
- maybe you should push your docker image by call `docker push XXXX/boscdt:vx.x.x`
- change [docker-compose.yml](./docker-compose.yml) `image` into `XXXX/boscdt:vx.x.x`
- follow `Usage: How to use BOSCore CDT Docker image to build contracts` to use yourself docker image
1 change: 1 addition & 0 deletions imports/eosio.imports.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ get_blockchain_parameters_packed
set_blockchain_parameters_packed
set_name_list_packed
set_guaranteed_minimum_resources
set_upgrade_parameters_packed
is_privileged
set_privileged
get_active_producers
Expand Down
7 changes: 7 additions & 0 deletions libraries/eosiolib/eosiolib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ namespace eosio {
ds >> params;
}

void set_upgrade_parameters(const eosio::upgrade_parameters& params) {
char buf[sizeof(eosio::upgrade_parameters)];
eosio::datastream<char *> ds( buf, sizeof(buf) );
ds << params;
set_upgrade_parameters_packed( buf, ds.tellp() );
}

using ::memset;
using ::memcpy;

Expand Down
2 changes: 2 additions & 0 deletions libraries/eosiolib/privileged.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ extern "C" {
*/
void set_name_list_packed(int64_t list, int64_t action, char* data, uint32_t datalen);

void set_upgrade_parameters_packed( char* data, uint32_t datalen );

/**
* @brief Set the guaranteed minimum resources object
* Set the guaranteed minimum resources object
Expand Down
10 changes: 10 additions & 0 deletions libraries/eosiolib/privileged.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ namespace eosio {
)
};

struct upgrade_parameters {
uint32_t target_block_num;

EOSLIB_SERIALIZE(upgrade_parameters,
(target_block_num)
)
};

/**
* @brief Set the blockchain parameters
* Set the blockchain parameters
Expand All @@ -147,6 +155,8 @@ namespace eosio {
*/
void get_blockchain_parameters(eosio::blockchain_parameters& params);

void set_upgrade_parameters(const eosio::upgrade_parameters& params);

///@}

/**
Expand Down
3 changes: 3 additions & 0 deletions libraries/native/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ extern "C" {
void set_blockchain_parameters_packed( char* data, uint32_t datalen ) {
return intrinsics::get().call<intrinsics::set_blockchain_parameters_packed>(data, datalen);
}
void set_upgrade_parameters_packed( char* data, uint32_t datalen ) {
return intrinsics::get().call<intrinsics::set_upgrade_parameters_packed>(data, datalen);
}
bool is_privileged( capi_name account ) {
return intrinsics::get().call<intrinsics::is_privileged>(account);
}
Expand Down
1 change: 1 addition & 0 deletions libraries/native/intrinsics_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ intrinsic_macro(set_resource_limits) \
intrinsic_macro(set_proposed_producers) \
intrinsic_macro(get_blockchain_parameters_packed) \
intrinsic_macro(set_blockchain_parameters_packed) \
intrinsic_macro(set_upgrade_parameters_packed) \
intrinsic_macro(is_privileged) \
intrinsic_macro(set_privileged) \
intrinsic_macro(get_active_producers) \
Expand Down

0 comments on commit a786ae3

Please sign in to comment.