Skip to content

Commit

Permalink
Testnet 0.1.0 (#146)
Browse files Browse the repository at this point in the history
Release Testnet 0.1.0

- Add instructions for joining the Testnet.
- Update install instructions
- Upgrade `cxxopt` and `spdlog`
- Streamline ci install scripts
- Systematically install dependencies by using `./sys-dep-install.sh`
- Drop support for CentOS
- upgrade to gcc-8 and clang-9 for both travis and install
- Remove Travis deploy, plan to use Github Action
  • Loading branch information
reijz authored Oct 24, 2019
1 parent e7cfc06 commit 8c816f2
Show file tree
Hide file tree
Showing 92 changed files with 11,278 additions and 8,870 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ test_*/

# autogenerated proto and grpc files
src/rpc/proto-gen/

# dependencies install files
ci/sys-dep-install
48 changes: 25 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,31 @@ matrix:
dist: bionic
addons:
apt:
sources:
- ubuntu-tool-chain-r-test
packages:
- autoconf
- libtool
- pkg-config
- gcc-8
- g++-8
- lcov
- llvm
cache:
directories:
- $BUILD_LIB_LPATH
before_install:
- ls
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 100
- gcc -v
- g++ -v
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
- sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main"
- sudo apt-get update
- sudo apt-get install clang-9
- sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 100
- sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 100
- clang -v
- clang++ -v
- pwd
- sudo ln -s /usr/local/clang-7.0.0/bin/clang++ /usr/bin/clang++
- sudo ln -s /usr/local/clang-7.0.0/bin/clang /usr/bin/clang
- echo $BUILD_LIB_LPATH
- echo $EPIC_PATH
- cd $BUILD_LIB_LPATH
Expand All @@ -46,23 +54,20 @@ matrix:
- pip install --user cpp-coveralls
- coveralls --help
- coveralls --build-root build/CMakeFiles -E ".*/test/.*" -E ".*/src/tools/.*" -E ".*/3.1.*" -E ".*/src/cuckaroo/.*" -E ".*/src/main.*" -E ".*/src/rpc/proto-gen/.*" -E ".*/src/utils/(memory|spdlog|ar.*|big.*|cpptoml.*|cxx.*|merkle.*|port.*|seri.*|tiny.*|utilstr.*).*" --gcov "/usr/bin/llvm-cov gcov" --gcov-options '\-lp'
- rm ~/.ssh/id_rsa
- openssl aes-256-cbc -K $encrypted_be909093e248_key -iv $encrypted_be909093e248_iv -in ci/id_rsa.enc -out temp_key -d
- cp temp_key ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh -p99 -oStrictHostKeyChecking=no [email protected] "rm -rf epic && git clone [email protected]:EPI-ONE/epic.git && cd epic && ./ci/deploy-build.sh"
- ssh -p99 -oStrictHostKeyChecking=no [email protected] "rm -rf epic && git clone [email protected]:EPI-ONE/epic.git && cd epic && ./ci/deploy-build.sh"
- ssh -p99 -oStrictHostKeyChecking=no [email protected] "rm -rf epic && git clone [email protected]:EPI-ONE/epic.git && cd epic && ./ci/deploy-build.sh"

- os: osx
osx_image: xcode11.2
osx_image: xcode11.1
addons:
homebrew:
packages:
- autoconf
- automake
- libtool
- gmp
- gmp
- cmake
- [email protected]
- grpc
- rocksdb
cache:
directories:
- $BUILD_LIB_MPATH
Expand All @@ -72,20 +77,17 @@ matrix:

install:
- clang -v
- pwd
- ls /usr/local/lib
- ls
- $EPIC_PATH/ci/install-cmake.sh
- if [ ${TRAVIS_OS_NAME} == 'linux' ]; then $EPIC_PATH/ci/install-cmake.sh; fi
- export PATH="/usr/local/bin:$PATH"
- cmake --version
- which cmake
- $EPIC_PATH/ci/install-openssl.sh
- type -a cmake
- if [ ${TRAVIS_OS_NAME} == 'linux' ]; then $EPIC_PATH/ci/install-openssl.sh; fi
- if [ ${TRAVIS_OS_NAME} == 'linux' ]; then $EPIC_PATH/ci/install-protobuf.sh; fi
- if [ ${TRAVIS_OS_NAME} == 'linux' ]; then $EPIC_PATH/ci/install-grpc.sh; fi
- if [ ${TRAVIS_OS_NAME} == 'linux' ]; then $EPIC_PATH/ci/install-rocksdb.sh; fi
- $EPIC_PATH/ci/install-secp256k1.sh
- $EPIC_PATH/ci/install-libevent.sh
- $EPIC_PATH/ci/install-googletest.sh
- $EPIC_PATH/ci/install-protobuf.sh
- $EPIC_PATH/ci/install-grpc.sh
- $EPIC_PATH/ci/install-rocksdb.sh
- ls

script:
Expand Down
76 changes: 23 additions & 53 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,51 @@

## Basic tools via system installation

We provide instructions for three operating systems: Ubuntu, CentOS and MacOS.
We provide instructions for two operating systems: Ubuntu and MacOS.

### Ubuntu 18.04

0. Install some basics including `gcc` version 7.4 and build tools.
0. Install some basics build tools

```bash
sudo apt-get install build-essential
sudo apt-get install autoconf libtool pkg-config
```

2. `clang` version 8

Add repository. If you have a different version of Ubuntu other than 18.04, see https://apt.llvm.org for corresponding repos.

```bash
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main"
sudo apt-get update
```

The following is instructed in https://apt.llvm.org

1. Install gcc-8

```bash
# LLVM
sudo apt-get install libllvm-8-ocaml-dev libllvm8 llvm-8 llvm-8-dev llvm-8-doc llvm-8-examples llvm-8-runtime
# Clang and co
sudo apt-get install clang-8 clang-tools-8 clang-8-doc libclang-common-8-dev libclang-8-dev libclang1-8 clang-format-8
sudo apt-get install gcc-8 g++-8
```

Update alternatives

```bash
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 100
```

3. (Optional) for `libsecp256k1`

```bash
sudo apt-get install libgmp-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 100
```

### CentOS 7.6
0. Install clang-9

0. Basic build tools
Add repository. If you have a different version of Ubuntu other than 18.04, see https://apt.llvm.org for corresponding repos.

```bash
sudo yum install libtool autoconf automake
```
```bash
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main"
sudo apt-get update
sudo apt-get install clang-9
```

1. `gcc` version 7.4
```bash
sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc-c++
scl enable devtoolset-7 bash/zsh
```
Update alternatives

2. `clang` version 5.0
```bash
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 100
```

```bash
sudo yum install llvm-toolset-7
scl enable llvm-toolset-7 bash
```
1. (Optional) for `libsecp256k1`

3. (Optional) for `libsecp256k1`
```bash
sudo yum install gmp-devel
sudo apt-get install libgmp-dev
```

### Mac OS X 10.15
Expand All @@ -79,12 +56,7 @@ We provide instructions for three operating systems: Ubuntu, CentOS and MacOS.
```bash
xcode-select --install
```
Mac provides its own C/C++ compiler and lib via XCode, `Apple clang version 11.0.0 (clang-1100.0.33.8)`
> Note: if you use XCode10 (or lower) and on OS X 10.14, you need to install llvm by using `brew install llvm` and manually add some required C header files. This step is complicated since MacOS Mojave removed some system headers. You may check whether you already have the required C headers by
>
> `ls /Library/Developer/CommandLineTools/Packages`
>
> If you have something like `macOS_SDK_headers_for_macOS_10.14.pkg` in this folder, then you can skip the next step. Otherwise, please go to [Apple Developer](https://developer.apple.com/download/more/) and download `Command Line Tools (macOS 10.14) for Xcode 10.2.1.dmg` and install. After this, you will find `/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg`. After install this package, you will have the required system header files. Now, you can build from source.
Mac provides its own C/C++ compiler and lib via XCode, `Apple clang version 11.0.0 (clang-1100.0.33.8)`. Mac OS X must upgrade to 10.15.

1. Brew

Expand All @@ -104,8 +76,6 @@ We provide instructions for three operating systems: Ubuntu, CentOS and MacOS.
brew install gmp
```



## Dependencies installation from source

Some depencencies need to be installed from the source. The following is the detailed instruction, with slight variation depending on Linux (Ubuntu/CentOS) or Mac.
Expand Down
48 changes: 26 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,42 @@
[![Build Status](https://travis-ci.com/EPI-ONE/epic.svg?token=xx2m4HADP8ipz4gYg3xd&branch=master)](https://travis-ci.com/EPI-ONE/epic)
[![Coverage Status](https://coveralls.io/repos/github/EPI-ONE/epic/badge.svg?branch=master&t=OvdAhL)](https://coveralls.io/github/EPI-ONE/epic?branch=master)

Epic is a pow chain that achives an order of magnitude improvement on the throughput without sacrificing the security and decentralization.
Epic is a pow chain that achieves an order of magnitude improvement on the throughput without sacrificing the security and decentralization.

We have released our `testnet 0.1.0`. You may join the testnet by following the [instruction](#compile-and-run).

## Design

The design of this chain is based on the [paper](https://arxiv.org/abs/1901.02755).
The design of the consensus mechanism is based on a Structured DAG. Refer to the [paper](https://arxiv.org/abs/1901.02755) for details.

## Implementation

The implementation of this peoject is written in C++ 17.

- C/C++ compilier and library
- `gcc` version 7 or up on Linux
- Apple LLVM version 11.0.0 (clang-1100.0.33.8) provided by XCode 11
- `gcc` version 8 or up on Linux
- Apple LLVM version 11.0.0 (clang-1100.0.33.8) provided by XCode 11 on OS X 10.15

- `cmake` version 3.14 or up
- `cmake` version 3.15 or up

- (Recommended) `clang` version 5 or up as an alternative (or better) compiler.
- (Recommended) `clang` version 8 or up as an alternative (or better) compiler.
Note: the llvm `libc++` lacks support of some C++ 17, thus still need the `gcc` (or Mac clang) library.

Builds on several esisting projects:
Builds on several existing projects:

- Our source code has inculded the code from existing projects:
- [bitcoin](https://github.com/bitcoin/bitcoin) and several pieces of code it uses, some of which with our own modification.
- [cxxopts v2.0.0](https://github.com/jarro2783/cxxopts)
- [cpptoml v0.1.1](https://github.com/skystrife/cpptoml)
- [spdlog v1.3.1](https://github.com/gabime/spdlog): header file only. You may customize how to use it by editing the default [config.toml](./config.toml) file.
- Our source code has included the code from existing projects:
- several pieces of code in the [bitcoin](https://github.com/bitcoin/bitcoin) project, some of which with our own modification.
- `cxxopts` [v2.0.0](https://github.com/jarro2783/cxxopts)
- `cpptoml` [v0.1.1](https://github.com/skystrife/cpptoml)
- `spdlog` [v1.3.1](https://github.com/gabime/spdlog)
- The following dependencies need to be installed on your system:
- `openssl` version 1.1
- `openssl` [version 1.1](https://github.com/openssl/openssl)
- `libsecp256k1`
- `libevent` version 2.1.11
- `RocksDB` version 6.1.2 or up
- `protobuf` version 3.10.0
- `gRPC` version 1.23.0 or up
- `GoogleTest` version 1.10.0
- `libevent` [version 2.1.11](https://github.com/libevent/libevent/releases)
- `RocksDB` [version 6.1.2](https://github.com/facebook/rocksdb) or up
- `protobuf` [version 3.10.0](https://github.com/protocolbuffers/protobuf)
- `gRPC` [version 1.23.0](https://github.com/grpc/grpc) or up
- `GoogleTest` [version 1.10.0](https://github.com/google/googletest)

We test this project on Ubuntu (18.04), CentOS (7.6) and MacOS X (10.14.6). See [INSTALL.md](./INSTALL.md) for detailed installation instructions.

Expand All @@ -46,19 +48,21 @@ We test this project on Ubuntu (18.04), CentOS (7.6) and MacOS X (10.14.6). See
git clone https://github.com/epi-one/epic/
cd epic && mkdir build && cd build
# Debug mode by default
cmake ..
# cmake ..
# Release mode
# cmake -DCAMKE_BUILD_TYPE=Release ..
cmake -DCAMKE_BUILD_TYPE=Release ..
make -j
cd ../bin
# you may run the following test
./epictest
# runing the daemon
./epic
./epic --configpath /path/to/toml
# send rpc command to daemon
./epicc [OPTIONS] [COMMAND]
./epic-cli [OPTIONS] [COMMAND]
```

We provide a default [config.toml](./config.toml), where seed address for the testnet is provided. You may customize a number of things, e.g., how to use spdlog, by editing it.

### GPU mining

The project is enabled with CPU mining by default, if no CUDA installation found on the system.
Expand Down
Binary file removed ci/id_rsa.enc
Binary file not shown.
22 changes: 9 additions & 13 deletions ci/install-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ set -ev
EPIC_CMAKE_VERSION="3.15.4"
EPIC_CMAKE_DIR=""cmake-"$EPIC_CMAKE_VERSION"

if [ ${TRAVIS_OS_NAME} == 'osx' ]; then
brew install cmake
if [[ ! -d ${EPIC_CMAKE_DIR} ]];then
sudo rm -rf cmake*
git clone -b v${EPIC_CMAKE_VERSION} --single-branch https://github.com/Kitware/CMake.git ${EPIC_CMAKE_DIR}
cd ${EPIC_CMAKE_DIR}
./bootstrap && make -j6
else
if [[ ! -d ${EPIC_CMAKE_DIR} ]];then
sudo rm -rf cmake*
git clone -b v${EPIC_CMAKE_VERSION} --single-branch https://github.com/Kitware/CMake.git ${EPIC_CMAKE_DIR}
cd ${EPIC_CMAKE_DIR}
./bootstrap && make -j6
else
cd ${EPIC_CMAKE_DIR}
fi

sudo make install
cd ..
cd ${EPIC_CMAKE_DIR}
fi

sudo make install
cd ..
24 changes: 10 additions & 14 deletions ci/install-grpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@ set -ev
EPIC_GRPC_VERSION="1.24.0"
EPIC_GRPC_DIR=""grpc-"$EPIC_GRPC_VERSION"

if [ ${TRAVIS_OS_NAME} == 'osx' ]; then
brew install grpc
if [[ ! -d ${EPIC_GRPC_DIR} ]];then
sudo rm -rf grpc*
git clone -b v${EPIC_GRPC_VERSION} --single-branch https://github.com/grpc/grpc.git ${EPIC_GRPC_DIR}
cd ${EPIC_GRPC_DIR}
git submodule update --init
make -j6
else
if [[ ! -d ${EPIC_GRPC_DIR} ]];then
sudo rm -rf grpc*
git clone -b v${EPIC_GRPC_VERSION} --single-branch https://github.com/grpc/grpc.git ${EPIC_GRPC_DIR}
cd ${EPIC_GRPC_DIR}
git submodule update --init
make -j6
else
cd ${EPIC_GRPC_DIR}
fi

sudo make install
cd ..
cd ${EPIC_GRPC_DIR}
fi

sudo make install
cd ..
22 changes: 9 additions & 13 deletions ci/install-openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ set -ev
EPIC_OPENSSL_VERSION="1_1_1d"
EPIC_OPENSSL_DIR=""openssl-"$EPIC_OPENSSL_VERSION"

if [ ${TRAVIS_OS_NAME} == 'osx' ]; then
brew install [email protected]
if [[ ! -d ${EPIC_OPENSSL_DIR} ]];then
sudo rm -rf openssl*
git clone -b OpenSSL_${EPIC_OPENSSL_VERSION} https://github.com/openssl/openssl.git ${EPIC_OPENSSL_DIR}
cd ${EPIC_OPENSSL_DIR}
./config && make -j4
else
if [[ ! -d ${EPIC_OPENSSL_DIR} ]];then
sudo rm -rf openssl*
git clone -b OpenSSL_${EPIC_OPENSSL_VERSION} https://github.com/openssl/openssl.git ${EPIC_OPENSSL_DIR}
cd ${EPIC_OPENSSL_DIR}
./config && make -j4
else
cd ${EPIC_OPENSSL_DIR}
fi

sudo make install_sw
cd ..
cd ${EPIC_OPENSSL_DIR}
fi

sudo make install_sw
cd ..
Loading

0 comments on commit 8c816f2

Please sign in to comment.