Skip to content

Commit

Permalink
Revert "Feature/lib serverproto"
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnnng committed Nov 5, 2018
1 parent a554892 commit 757d9db
Show file tree
Hide file tree
Showing 19 changed files with 1,419 additions and 1,542 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Expand Up @@ -7,9 +7,3 @@
[submodule "src/depends/mongo-cxx-driver"]
path = src/depends/mongo-cxx-driver
url = https://github.com/mongodb/mongo-cxx-driver.git
[submodule "src/depends/grpc"]
path = src/depends/grpc
url = https://github.com/grpc/grpc
[submodule "src/depends/protobuf"]
path = src/depends/protobuf
url = https://github.com/protocolbuffers/protobuf
10 changes: 1 addition & 9 deletions CMakeLists.txt
Expand Up @@ -47,14 +47,6 @@ include_directories(${OPENSSL_INCLUDE_DIR})

find_package(LevelDB REQUIRED)

include(InstallProtobuf)
include(FindProtobuf)
find_package(Protobuf 3.6.1 CONFIG REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIR})

include(InstallGRPC)
include_directories(${GRPC_INCLUDE_DIRS})

if(OPENCL_MINE AND CUDA_MINE)
message(FATAL_ERROR "Cannot support OpenCL (OPENCL_MINE=ON) and CUDA (CUDA=ON) at the same time")
endif()
Expand Down Expand Up @@ -137,7 +129,7 @@ set(CPACK_PACKAGE_VERSION $ENV{ZIL_VER})
set(CPACK_PACKAGE_NAME $ENV{ZIL_PACK_NAME})
set(CPACK_DEBIAN_PACKAGE_NAME "zilliqa")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-system-dev, libboost-filesystem-dev, libboost-test-dev, libssl-dev, libleveldb-dev, libjsoncpp-dev, libsnappy-dev, cmake, libmicrohttpd-dev, libjsonrpccpp-dev, build-essential, pkg-config, libevent-dev, libminiupnpc-dev, libprotobuf-dev, protobuf-compiler, libtool, autoconf, golang")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-system-dev, libboost-filesystem-dev, libboost-test-dev, libssl-dev, libleveldb-dev, libjsoncpp-dev, libsnappy-dev, cmake, libmicrohttpd-dev, libjsonrpccpp-dev, build-essential, pkg-config, libevent-dev, libminiupnpc-dev, libprotobuf-dev, protobuf-compiler")
set(CPACK_PACKAGE_CONTACT "maintainers@zilliqa.com")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Members of maintainers@zilliqa.com")

Expand Down
5 changes: 2 additions & 3 deletions README.md
Expand Up @@ -72,14 +72,13 @@ To run Zilliqa, we recommend the following minimum system requirements:
sudo apt-get install git libboost-system-dev libboost-filesystem-dev libboost-test-dev \
libssl-dev libleveldb-dev libjsoncpp-dev libsnappy-dev cmake libmicrohttpd-dev \
libjsonrpccpp-dev build-essential pkg-config libevent-dev libminiupnpc-dev \
libprotobuf-dev protobuf-compiler libcurl4-openssl-dev libtool autoconf golang
libprotobuf-dev protobuf-compiler libcurl4-openssl-dev
```

* macOS (experimental):

```bash
brew install pkg-config jsoncpp leveldb libjson-rpc-cpp libevent miniupnpc protobuf \
libtool autoconf
brew install pkg-config jsoncpp leveldb libjson-rpc-cpp libevent miniupnpc protobuf
```

## Running Zilliqa locally
Expand Down
101 changes: 0 additions & 101 deletions cmake/InstallGRPC.cmake

This file was deleted.

31 changes: 0 additions & 31 deletions cmake/InstallProtobuf.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions docker/Dockerfile
Expand Up @@ -25,9 +25,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libprotobuf-dev \
protobuf-compiler \
libcurl4-openssl-dev \
libtool \
autoconf \
golang \
python python-pip \
&& rm -rf /var/lib/apt/lists/* \
&& pip install netaddr
Expand Down
9 changes: 2 additions & 7 deletions scripts/ci_install_deps.sh
Expand Up @@ -69,10 +69,7 @@ apt-get install -y \
libevent-dev \
libprotobuf-dev \
libcurl4-openssl-dev \
protobuf-compiler \
libtool \
autoconf \
golang
protobuf-compiler

# install development dependencies
apt-get install -y \
Expand Down Expand Up @@ -102,9 +99,7 @@ brew install \
libjson-rpc-cpp \
miniupnpc \
libevent \
protobuf \
autoconf \
libtool
protobuf

# install developement deps
brew install \
Expand Down
54 changes: 54 additions & 0 deletions scripts/download_proto3.sh
@@ -0,0 +1,54 @@
#!/bin/sh
# Copyright (c) 2018 Zilliqa
# This source code is being disclosed to you solely for the purpose of your
# participation in testing Zilliqa. You may view, compile and run the code for
# that purpose and pursuant to the protocols and algorithms that are programmed
# into, and intended by, the code. You may not do anything else with the code
# without express permission from Zilliqa Research Pte. Ltd., including
# modifying or publishing the code (or any part of it), and developing or
# forming another public or private blockchain network. This source code is
# provided 'as is' and no warranties are given as to title or non-infringement,
# merchantability or fitness for purpose and, to the extent permitted by law,
# all liability for your use of the code is disclaimed. Some programs in this
# code are governed by the GNU General Public License v3.0 (available at
# https://www.gnu.org/licenses/gpl-3.0.en.html) ('GPLv3'). The programs that
# are governed by GPLv3.0 are those programs that are located in the folders
# src/depends and tests/depends and which include a reference to GPLv3 in their
# program files.
#

PROTOC_REQUIRED_VERSION="3.6.1"
PROTOC_DOWNLOAD_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_REQUIRED_VERSION}/protobuf-cpp-${PROTOC_REQUIRED_VERSION}.tar.gz"

# detect ubuntu 16.04 lts version
OS_VERSION=`lsb_release -rs`
if [ -z "$OS_VERSION" ] || [ "$OS_VERSION" != "16.04" ]; then
echo "Not Ubuntu 16.04 LTS version"
exit 1
fi

# detect current protoc version
PROTOC_BIN=`which protoc`
if [ ! -z "$PROTOC_BIN" ]; then
PROTOC_VERSION=`${PROTOC_BIN} --version | cut -d ' ' -f 2`

# check if required version already exists.
if [ "$PROTOC_VERSION" = "$PROTOC_REQUIRED_VERSION" ]; then
echo "Protoc ${PROTOC_REQUIRED_VERSION} already installed. Nothing else to do"
exit 0
else
echo "Required protoc version: ${PROTOC_REQUIRED_VERSION}"
echo "Existing protoc version: ${PROTOC_VERSION}"
echo "Please delete existing version..."
exit 1
fi
fi

# download proto3
mkdir -p /tmp/protoc
wget -qO- ${PROTOC_DOWNLOAD_URL} | tar xvz -C /tmp/protoc
cd /tmp/protoc/protobuf-${PROTOC_REQUIRED_VERSION}
./configure && make && sudo make install && sudo ldconfig

sudo ln -s /usr/local/bin/protoc /usr/bin/
sudo ln -s /usr/local/lib/libprotobuf.so /usr/lib/x86_64-linux-gnu/
1 change: 0 additions & 1 deletion src/depends/grpc
Submodule grpc deleted from d2c7d4
1 change: 0 additions & 1 deletion src/depends/protobuf
Submodule protobuf deleted from 48cb18
4 changes: 0 additions & 4 deletions src/libConsensus/ConsensusCommon.cpp
Expand Up @@ -21,11 +21,7 @@
#include "common/Constants.h"
#include "common/Messages.h"
#include "libMessage/Messenger.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "libMessage/ZilliqaMessage.pb.h"
#pragma GCC diagnostic pop

#include "libNetwork/P2PComm.h"
#include "libUtils/BitVector.h"
#include "libUtils/DataConversion.h"
Expand Down
9 changes: 4 additions & 5 deletions src/libProtoServer/CMakeLists.txt
@@ -1,7 +1,6 @@
set(PROTOBUF_IMPORT_DIRS ${PROTOBUF_IMPORT_DIRS} ${PROJECT_SOURCE_DIR}/src/libMessage)
protobuf_generate_cpp(PROTO_SRC PROTO_HEADER ServerRequest.proto ServerResponse.proto ServerMessages.proto Server.proto)
grpc_generate_cpp(GRPC_SRCS GRPC_HDRS Server.proto)
add_library(ProtoServer ${PROTO_HEADER} ${PROTO_SRC} ${GRPC_SRCS} ${GRPC_HDRS} ServerInterface.cpp)
protobuf_generate_cpp(PROTO_SRC PROTO_HEADER ServerRequest.proto ServerResponse.proto ServerMessages.proto)
add_library(ProtoServer ${PROTO_HEADER} ${PROTO_SRC} Server.cpp)
target_compile_options(ProtoServer PRIVATE "-Wno-unused-parameter")
target_include_directories(ProtoServer PUBLIC ${PROJECT_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src/libProtoServer ${CMAKE_BINARY_DIR}/src/libMessage ${CMAKE_BINARY_DIR}/include)
target_link_libraries(ProtoServer PUBLIC ${PROTOBUF_LIBRARY} ${GRPC_LIBRARIES} AccountData Messenger)
target_include_directories(ProtoServer PUBLIC ${PROJECT_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src/libProtoServer ${CMAKE_BINARY_DIR}/src/libMessage)
target_link_libraries (ProtoServer PUBLIC ${PROTOBUF_LIBRARY} AccountData Messenger)

0 comments on commit 757d9db

Please sign in to comment.