Skip to content

Commit

Permalink
finish BOS basic functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaipanda committed Nov 29, 2018
1 parent 59626f1 commit 14546f1
Show file tree
Hide file tree
Showing 72 changed files with 3,785 additions and 192 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ build:
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA -f Docker/Dockerfile .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ include( SetupTargetMacros )
include( InstallDirectoryPermissions )
include( MASSigning )

set( BLOCKCHAIN_NAME "EOSIO" )
set( BLOCKCHAIN_NAME "BOS" )
set( CMAKE_CXX_STANDARD 14 )
set( CMAKE_CXX_EXTENSIONS ON )
set( CXX_STANDARD_REQUIRED ON)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 4)
set(VERSION_PATCH 4)
set(VERSION_MINOR 0)
set(VERSION_PATCH 1)

set( CLI_CLIENT_EXECUTABLE_NAME cleos )
set( NODE_EXECUTABLE_NAME nodeos )
Expand Down
2 changes: 1 addition & 1 deletion CMakeModules/EosioTester.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ macro(add_eosio_test test_name)
${liblogging}
${libchainbase}
${libbuiltins}
${GMP_LIBRARIES}
${libsecp256k1}
${GMP_LIBRARIES}

LLVMX86Disassembler
LLVMX86AsmParser
Expand Down
29 changes: 29 additions & 0 deletions CMakeModules/FindCppkafka.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Override default CMAKE_FIND_LIBRARY_SUFFIXES
if (CPPKAFKA_SHARED_LIB)
set(CPPKAFKA_SUFFIX so)
else()
set(CPPKAFKA_SUFFIX a)
endif()
message(STATUS "Cppkafka finding .${CPPKAFKA_SUFFIX} library")

FIND_PATH(
CPPKAFKA_INCLUDE_DIR cppkafka.h
PATH "/usr/local"
PATH_SUFFIXES "" "cppkafka")
MARK_AS_ADVANCED(CPPKAFKA_INCLUDE_DIR)

SET(CPPKAFKA_INCLUDE_DIR ${CPPKAFKA_INCLUDE_DIR})

FIND_LIBRARY(
CPPKAFKA_LIBRARY
NAMES cppkafka.${CPPKAFKA_SUFFIX} libcppkafka.${CPPKAFKA_SUFFIX}
HINTS ${CPPKAFKA_INCLUDE_DIR}/..
PATH_SUFFIXES lib${LIB_SUFFIX})
MARK_AS_ADVANCED(CPPKAFKA_LIBRARY)

SET(CPPKAFKA_LIBRARY ${CPPKAFKA_LIBRARY})
message(STATUS "Cppkafka found ${CPPKAFKA_LIBRARY}")

include(FindPackageHandleStandardArgs)
SET(_CPPKAFKA_REQUIRED_VARS CPPKAFKA_INCLUDE_DIR CPPKAFKA_LIBRARY)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cppkafka DEFAULT_MSG ${_CPPKAFKA_REQUIRED_VARS})
14 changes: 9 additions & 5 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
FROM eosio/builder as builder
FROM boscore/builder as builder
ARG branch=master
ARG symbol=SYS

RUN git clone -b $branch https://github.com/EOSIO/eos.git --recursive \
&& cd eos && echo "$branch:$(git rev-parse HEAD)" > /etc/eosio-version \
ENV OPENSSL_ROOT_DIR /usr/include/openssl


RUN git clone -b $branch https://github.com/boscore/bos.git --recursive \
&& cd bos && 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 -DBUILD_MONGO_DB_PLUGIN=true -DCORE_SYMBOL_NAME=$symbol \
-DOPENSSL_ROOT_DIR="${OPENSSL_ROOT_DIR}" \
&& cmake --build /tmp/build --target install && rm /tmp/build/bin/eosiocpp


Expand All @@ -15,9 +19,9 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl
COPY --from=builder /usr/local/lib/* /usr/local/lib/
COPY --from=builder /tmp/build/bin /opt/eosio/bin
COPY --from=builder /tmp/build/contracts /contracts
COPY --from=builder /eos/Docker/config.ini /
COPY --from=builder /bos/Docker/config.ini /
COPY --from=builder /etc/eosio-version /etc
COPY --from=builder /eos/Docker/nodeosd.sh /opt/eosio/bin/nodeosd.sh
COPY --from=builder /bos/Docker/nodeosd.sh /opt/eosio/bin/nodeosd.sh
ENV EOSIO_ROOT=/opt/eosio
RUN chmod +x /opt/eosio/bin/nodeosd.sh
ENV LD_LIBRARY_PATH /usr/local/lib
Expand Down
38 changes: 19 additions & 19 deletions Docker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Run in docker

Simple and fast setup of EOS.IO on Docker is also available.
Simple and fast setup of BOSCore on Docker is also available.

## Install Dependencies

Expand All @@ -12,30 +12,30 @@ Simple and fast setup of EOS.IO on Docker is also available.
- At least 7GB RAM (Docker -> Preferences -> Advanced -> Memory -> 7GB or above)
- If the build below fails, make sure you've adjusted Docker Memory settings and try again.

## Build eos image
## Build BOSCore image

```bash
git clone https://github.com/EOSIO/eos.git --recursive --depth 1
cd eos/Docker
docker build . -t eosio/eos
git clone https://github.com/boscore/bos.git --recursive --depth 1
cd bos/Docker
docker build . -t boscore/bos
```

The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v1.4.4 tag, you could do the following:
The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v1.0.1 tag, you could do the following:

```bash
docker build -t eosio/eos:v1.4.4 --build-arg branch=v1.4.4 .
docker build -t boscore/bos:v1.0.1 --build-arg branch=v1.0.1 .
```

By default, the symbol in eosio.system is set to SYS. You can override this using the symbol argument while building the docker image.

```bash
docker build -t eosio/eos --build-arg symbol=<symbol> .
docker build -t boscore/bos --build-arg symbol=<symbol> .
```

## Start nodeos docker container only

```bash
docker run --name nodeos -p 8888:8888 -p 9876:9876 -t eosio/eos nodeosd.sh -e --http-alias=nodeos:8888 --http-alias=127.0.0.1:8888 --http-alias=localhost:8888 arg1 arg2
docker run --name nodeos -p 8888:8888 -p 9876:9876 -t boscore/bos nodeosd.sh -e --http-alias=nodeos:8888 --http-alias=127.0.0.1:8888 --http-alias=localhost:8888 arg1 arg2
```

By default, all data is persisted in a docker volume. It can be deleted if the data is outdated or corrupted:
Expand All @@ -49,7 +49,7 @@ $ docker volume rm fdc265730a4f697346fa8b078c176e315b959e79365fc9cbd11f090ea0cb5
Alternately, you can directly mount host directory into the container

```bash
docker run --name nodeos -v /path-to-data-dir:/opt/eosio/bin/data-dir -p 8888:8888 -p 9876:9876 -t eosio/eos nodeosd.sh -e --http-alias=nodeos:8888 --http-alias=127.0.0.1:8888 --http-alias=localhost:8888 arg1 arg2
docker run --name nodeos -v /path-to-data-dir:/opt/eosio/bin/data-dir -p 8888:8888 -p 9876:9876 -t boscore/bos nodeosd.sh -e --http-alias=nodeos:8888 --http-alias=127.0.0.1:8888 --http-alias=localhost:8888 arg1 arg2
```

## Get chain info
Expand Down Expand Up @@ -92,13 +92,13 @@ docker-compose stop keosd

### Develop/Build custom contracts

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.
Due to the fact that the boscore/bos 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 boscore/bos-dev image. This image contains both the required binaries and dependencies to build contracts using eosiocpp.

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.
You can either use the image available on [Docker Hub](https://hub.docker.com/r/boscore/bos-dev/) or navigate into the dev folder and build the image manually.

```bash
cd dev
docker build -t eosio/eos-dev .
docker build -t boscore/bos-dev .
```

### Change default configuration
Expand Down Expand Up @@ -133,15 +133,15 @@ docker volume rm keosd-data-volume

### Docker Hub

Docker Hub image available from [docker hub](https://hub.docker.com/r/eosio/eos/).
Docker Hub image available from [docker hub](https://hub.docker.com/r/boscore/bos/).
Create a new `docker-compose.yaml` file with the content below

```bash
version: "3"

services:
nodeosd:
image: eosio/eos:latest
image: boscore/bos:latest
command: /opt/eosio/bin/nodeosd.sh --data-dir /opt/eosio/bin/data-dir -e --http-alias=nodeosd:8888 --http-alias=127.0.0.1:8888 --http-alias=localhost:8888
hostname: nodeosd
ports:
Expand All @@ -153,7 +153,7 @@ services:
- nodeos-data-volume:/opt/eosio/bin/data-dir

keosd:
image: eosio/eos:latest
image: boscore/bos:latest
command: /opt/eosio/bin/keosd --wallet-dir /opt/eosio/bin/data-dir --http-server-address=127.0.0.1:8900 --http-alias=localhost:8900 --http-alias=keosd:8900
hostname: keosd
links:
Expand All @@ -169,13 +169,13 @@ volumes:

*NOTE:* the default version is the latest, you can change it to what you want

run `docker pull eosio/eos:latest`
run `docker pull boscore/bos:latest`

run `docker-compose up`

### EOSIO Testnet
### BOSCore Testnet

We can easily set up a EOSIO local testnet using docker images. Just run the following commands:
We can easily set up a BOSCore local testnet using docker images. Just run the following commands:

Note: if you want to use the mongo db plugin, you have to enable it in your `data-dir/config.ini` first.

Expand Down
19 changes: 17 additions & 2 deletions Docker/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:18.04

LABEL author="xiaobo <peterwillcn@gmail.com>" maintainer="Xiaobo <peterwillcn@gmail.com> Huang-Ming Huang <huangh@objectcomputing.com>" version="0.1.1" \
description="This is a base image for building eosio/eos"
LABEL author="xiaobo <peterwillcn@gmail.com>" maintainer="Xiaobo <peterwillcn@gmail.com> Huang-Ming Huang <huangh@objectcomputing.com> Winlin <pcguangtao@gmail.com>" version="0.1.2" \
description="This is a base image for building boscore/bos"

RUN echo 'APT::Install-Recommends 0;' >> /etc/apt/apt.conf.d/01norecommends \
&& echo 'APT::Install-Suggests 0;' >> /etc/apt/apt.conf.d/01norecommends \
Expand Down Expand Up @@ -56,3 +56,18 @@ RUN git clone --depth 1 -b releases/v3.3 https://github.com/mongodb/mongo-cxx-dr
&& make -j$(nproc) \
&& make install \
&& cd ../../ && rm -rf mongo-cxx-driver

RUN git clone --depth 1 -b v0.11.6 https://github.com/boscore/librdkafka.git \
&& cd librdkafka/ \
&& cmake -H. -B_cmake_build \
&& cmake -DRDKAFKA_BUILD_STATIC=1 --build _cmake_build \
&& cd _cmake_build \
&& make install \
&& cd ../../ && rm -rf librdkafka

RUN git clone --depth 1 -b 0.2 https://github.com/boscore/cppkafka.git \
&& cd cppkafka/ \
&& mkdir build && cd build \
&& cmake -DCPPKAFKA_RDKAFKA_STATIC_LIB=1 -DCPPKAFKA_BUILD_SHARED=0 .. \
&& make install \
&& cd ../../ && rm -rf cppkafka
5 changes: 5 additions & 0 deletions Docker/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ access-control-allow-credentials = false
# The actual host:port used to listen for incoming p2p connections. (eosio::net_plugin)
p2p-listen-endpoint = 0.0.0.0:9876

#The p2p-discoverable is used to enable or disable p2p network self-discovery (eosio::net_plugin)
#p2p-discoverable=

# An externally accessible host:port for identifying this node. Defaults to p2p-listen-endpoint. (eosio::net_plugin)
# p2p-server-address =

Expand Down Expand Up @@ -158,3 +161,5 @@ txn-reference-block-lag = 0
# plugin =
plugin = eosio::chain_api_plugin
plugin = eosio::history_api_plugin
# enable this option to produce blocks
#plugin = eosio::producer_plugin
4 changes: 2 additions & 2 deletions Docker/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM eosio/builder
FROM boscore/builder
ARG branch=master
ARG symbol=SYS

RUN git clone -b $branch https://github.com/EOSIO/eos.git --recursive \
RUN git clone -b $branch https://github.com/boscore/bos.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 -DBUILD_MONGO_DB_PLUGIN=true -DCORE_SYMBOL_NAME=$symbol \
Expand Down
106 changes: 20 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,29 @@
# BOSCore - 更可用的链,为DApp而生。Born for DApp, be more useable.

# EOSIO - The Most Powerful Infrastructure for Decentralized Applications
## BOSCore Version: v1.0.1
### Basic EOSIO Version: v1.4.4

[![Build status](https://badge.buildkite.com/370fe5c79410f7d695e4e34c500b4e86e3ac021c6b1f739e20.svg?branch=master)](https://buildkite.com/EOSIO/eosio)
# 背景
EOS的出现给区块链带来了新的想象力,主网启动短短几个月以来,版本经历了几十次升级,不仅稳定性得到了很大提高,并且新功能也逐步实现,各个节点团队也积极参与建设EOSIO生态。让人更加兴奋的是,EOS已经吸引了越来越多的开发团队,当前已经有数百个DApp在EOS主网上面运行,其交易量和流通市值远超以太坊,可发展的空间愈来愈广阔。
在EOS主网逐渐发展的过程中,我们发现了一些偏离期望的地方。作为最有竞争力的第三代公链,大家希望看到的是能够有更多、更丰富的应用能够在EOS上面运行,开发者会将EOS作为自己应用开发的首选平台,但是由于目前EOS的资源模型的限制,导致了很高的使用成本,包括为用户创建更多的账户,以及部署运营DApp需要的较高成本。针对白皮书中要实现的上百万TPS需要的关键技术IBC,一直没有进行推进,主网多次出现CPU计算资源不足的情况,更是加剧了对跨链通讯需求的迫切性。此外,由于EOSIO采用的Pipeline-DPOS共识机制,一个交易需要近三分钟才能保证不可更改,虽然相较比特币、以太坊是有很大的进步,但是这也给EOS的应用场景带来很大限制,快速支付只能聚焦于小额转账,大额转账必须要等待足够长的时间才能保证不可更改,这就限制了链上、链下用户支付体验。
除了上面提到的情况,还有很多其他改进想法一直在我们社区进行活跃的讨论,由此,我们觉得应该基于EOS进行更多的尝试,让更多的开发者或者团队来参与到EOSIO生态的建设中来,一起为区块链在不同行业不同场景中的落地做出一份努力。BOS作为一条完全由社区维护的EOS侧链,在继承其良好功能的基础上,会进行更多的尝试,并且会将经过验证的新特性、新功能反哺给EOSIO生态。

Welcome to the EOSIO source code repository! This software enables businesses to rapidly build and deploy high-performance and high-security blockchain-based applications.
# 概述
BOS致力于为用户提供方便进入并易于使用的区块链服务,为DApp运营提供更友好的基础设施,为支持更丰富的应用场景努力,为DApp大繁荣进行积极尝试。除了技术改进以外,BOS也会进行其他方面的尝试。比如,为了提高用户投票参与度,可以通过预言机技术来针对符合明确规则的账户进行激励;BOS上面的BP的奖励会根据链上DApp的数量、TPS、市值、流通量等指标进行调整,鼓励每个BP为生态提供更多资源;一项社区公投达成的决议将会尽量被代码化,减少人为的因素在里面,流程上链,保持公正透明。
BOS链的代码完全由社区贡献并维护,每个生态参与者都可以提交代码或者建议,相关的流程会参考已有开源软件来进行,比如PEP(Python Enhancement Proposals)。
为鼓励DApp在BOS的发展,BOS基金会将会为其上的DApp提供Token置换的低成本的资源抵押服务,降低DApp前期的运营成本;此外还会定期对做出贡献的开发者或者功能验证者提供BOS激励,以便建立起一个相互促进的社区发展趋势。

Some of the groundbreaking features of EOSIO include:
## 资源
1. [Website](https://boscore.io)
2. [Developer Telegram Group](https://t.me/BOSCoreProject)

1. Free Rate Limited Transactions
1. Low Latency Block confirmation (0.5 seconds)
1. Low-overhead Byzantine Fault Tolerant Finality
1. Designed for optional high-overhead, low-latency BFT finality
1. Smart contract platform powered by Web Assembly
1. Designed for Sparse Header Light Client Validation
1. Scheduled Recurring Transactions
1. Time Delay Security
1. Hierarchical Role Based Permissions
1. Support for Biometric Hardware Secured Keys (e.g. Apple Secure Enclave)
1. Designed for Parallel Execution of Context Free Validation Logic
1. Designed for Inter Blockchain Communication
## 开始
1. 源码直接编译: `bash ./eosio_build.sh`
2. Docker方式部署,参看 [Docker](./Docker/README.md)

EOSIO is released under the open source MIT license and is offered “AS IS” without warranty of any kind, express or implied. Any security provided by the EOSIO software depends in part on how it is used, configured, and deployed. EOSIO is built upon many third-party libraries such as Binaryen (Apache License) and WAVM (BSD 3-clause) which are also provided “AS IS” without warranty of any kind. Without limiting the generality of the foregoing, Block.one makes no representation or guarantee that EOSIO or any third-party libraries will perform as intended or will be free of errors, bugs or faulty code. Both may fail in large or small ways that could completely or partially limit functionality or compromise computer systems. If you use or implement EOSIO, you do so at your own risk. In no event will Block.one be liable to any party for any damages whatsoever, even if it had been advised of the possibility of damage.
BOSCore是基于EOSIO技术的扩展,所以EOSIO的相关资料也可以参考:

Block.one is neither launching nor operating any initial public blockchains based upon the EOSIO software. This release refers only to version 1.0 of our open source software. We caution those who wish to use blockchains built on EOSIO to carefully vet the companies and organizations launching blockchains based on EOSIO before disclosing any private keys to their derivative software.
[Getting Started](https://developers.eos.io/eosio-nodeos/docs/overview-1)

There is no public testnet running currently.
[EOSIO Developer Portal](https://developers.eos.io).

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

#### Mac OS X Brew Install
```sh
$ brew tap eosio/eosio
$ brew install eosio
```
#### Mac OS X Brew Uninstall
```sh
$ brew remove eosio
```
#### Ubuntu 18.04 Debian Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.4.4/eosio_1.4.4-1-ubuntu-18.04_amd64.deb
$ sudo apt install ./eosio_1.4.4-1-ubuntu-18.04_amd64.deb
```
#### Ubuntu 16.04 Debian Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.4.4/eosio_1.4.4-1-ubuntu-16.04_amd64.deb
$ sudo apt install ./eosio_1.4.4-1-ubuntu-16.04_amd64.deb
```
#### Debian Package Uninstall
```sh
$ sudo apt remove eosio
```
#### Centos RPM Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.4.4/eosio-1.4.4-1.el7.x86_64.rpm
$ sudo yum install ./eosio-1.4.4-1.el7.x86_64.rpm
```
#### Centos RPM Package Uninstall
```sh
$ sudo yum remove eosio.cdt
```
#### Fedora RPM Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.4.4/eosio-1.4.4-1.fc27.x86_64.rpm
$ sudo yum install ./eosio-1.4.4-1.fc27.x86_64.rpm
```
#### Fedora RPM Package Uninstall
```sh
$ sudo yum remove eosio.cdt
```

## Supported Operating Systems
EOSIO currently supports the following operating systems:
1. Amazon 2017.09 and higher
2. Centos 7
3. Fedora 25 and higher (Fedora 27 recommended)
4. Mint 18
5. Ubuntu 16.04 (Ubuntu 16.10 recommended)
6. Ubuntu 18.04
7. MacOS Darwin 10.12 and higher (MacOS 10.13.x recommended)

## Resources
1. [Website](https://eos.io)
1. [Blog](https://medium.com/eosio)
1. [Developer Portal](https://developers.eos.io)
1. [StackExchange for Q&A](https://eosio.stackexchange.com/)
1. [Community Telegram Group](https://t.me/EOSProject)
1. [Developer Telegram Group](https://t.me/joinchat/EaEnSUPktgfoI-XPfMYtcQ)
1. [White Paper](https://github.com/EOSIO/Documentation/blob/master/TechnicalWhitePaper.md)
1. [Roadmap](https://github.com/EOSIO/Documentation/blob/master/Roadmap.md)

<a name="gettingstarted"></a>
## Getting Started
Instructions detailing the process of getting the software, building it, running a simple test network that produces blocks, account creation and uploading a sample contract to the blockchain can be found in [Getting Started](https://developers.eos.io/eosio-nodeos/docs/overview-1) on the [EOSIO Developer Portal](https://developers.eos.io).
Loading

0 comments on commit 14546f1

Please sign in to comment.