diff --git a/.travis.yml b/.travis.yml index 997c2d48..da3d6a2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,6 @@ sudo: required dist: bionic # ubuntu 18.04 -#os: - # - linux - compiler: - gcc - clang @@ -48,6 +45,17 @@ install: brew update; brew install cmake pkg-config openssl boost libsodium readline protobuf ncurses; export OPENSSL_ROOT_DIR=`brew --prefix openssl`; + git clone https://github.com/eclipse/paho.mqtt.c.git; + cd paho.mqtt.c; + git checkout v1.3.1; + mkdir build && cd build; + cmake -DPAHO_BUILD_STATIC=TRUE -DPAHO_WITH_SSL=TRUE ..; + sudo make install; + sudo mkdir /usr/local/include/mqtt/; + sudo chmod 755 /usr/local/include/mqtt/; + sudo cp ${TRAVIS_BUILD_DIR}/src/mqtt/src/mqtt/* /usr/local/include/mqtt/; + sudo chmod 644 /usr/local/include/mqtt/*; + cd ${TRAVIS_BUILD_DIR}; else sudo apt-get update -qq; sudo apt install -y g++ cmake libboost-all-dev openssl libssl1.0-dev libreadline-dev pkg-config libprotobuf-dev protobuf-compiler libncurses5-dev autoconf; @@ -60,15 +68,27 @@ install: make -j2; sudo make install; cd ../; + git clone https://github.com/eclipse/paho.mqtt.c.git; + cd paho.mqtt.c; + git checkout v1.3.1; + mkdir build && cd build; + cmake -DPAHO_BUILD_STATIC=TRUE -DPAHO_WITH_SSL=TRUE ..; + sudo make install; + sudo cp -r ${TRAVIS_BUILD_DIR}/src/mqtt/src/mqtt/ /usr/local/include/; + sudo chmod 755 /usr/local/include/mqtt; + cd /usr/local/include/mqtt; + sudo chmod 644 *; + cd -; + cd ../..; fi before_script: - ulimit -c unlimited -S # enable core dumps script: -- ./INSTALL.sh +- ./INSTALL.sh - ./build/test/test_big - ./build/test/test_ctsdb - if [ "$TRAVIS_OS_NAME" == "linux" ]; then - cppcheck --error-exitcode=1 --std=c++11 --enable=warning,performance,portability -i libsodium-1.0.18 -i src/leveldb -i build -i src/snappy -i src/crypto -i src/jsonrpc/json -i src/xengine/docker -i script -i test . ; + cppcheck -j2 --error-exitcode=1 --std=c++11 --enable=warning,performance,portability -i libsodium-1.0.18 -i src/leveldb -i build -i src/snappy -i src/crypto -i src/jsonrpc/json -i src/xengine/docker -i script -i test -i paho.mqtt.c -i src/mqtt . ; fi diff --git a/CMakeLists.txt b/CMakeLists.txt index aaaee1d7..c90060e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ elseif(UNIX) set(CMAKE_CXX_EXTENSIONS OFF) else() - message(FATAL_ERROR "Unsupported plantform") + message(FATAL_ERROR "Unsupported platform") endif() # build type @@ -57,7 +57,7 @@ endif() if(UNIX AND NOT CYGWIN) string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra -Werror -Wno-char-subscripts -Wno-unused-parameter -Wno-sign-compare -Wno-reorder -Wno-unused-local-typedefs -Wno-implicit-fallthrough -Wno-overloaded-virtual -Wno-strict-aliasing") if (APPLE) - string(APPEND CMAKE_CXX_FLAGS " -fvisibility-inlines-hidden -fvisibility=hidden") + string(APPEND CMAKE_CXX_FLAGS " -Wno-missing-field-initializers -fvisibility-inlines-hidden -fvisibility=hidden") endif() endif() diff --git a/INSTALL.sh b/INSTALL.sh index 74188ede..147e2d78 100755 --- a/INSTALL.sh +++ b/INSTALL.sh @@ -12,24 +12,25 @@ fi cd build # cmake -flagdebug="" +flag="" if [[ "$1" = "debug" || "$2" = "debug" ]] then - flagdebug="-DCMAKE_BUILD_TYPE=Debug" + flag="-DCMAKE_BUILD_TYPE=Debug" else - flagdebug="-DCMAKE_BUILD_TYPE=Release" + flag="-DCMAKE_BUILD_TYPE=Release" fi -flagtestnet="" if [[ "$1" = "testnet" || "$2" = "testnet" ]] then - flagtestnet="-DTESTNET=on" + flag+=" -DTESTNET=on" else - flagtestnet="-DTESTNET=off" + flag+=" -DTESTNET=off" fi -cmake .. $flagdebug $flagtestnet -if [ $? -ne 0 ]; then +flag+=" -DPAHO_BUILD_STATIC=TRUE -DPAHO_BUILD_SHARED=FALSE" + +cmake .. $flag +if [ $? -ne 0 ]; then cd $origin_path exit 1 fi diff --git a/doc/auto_rpc.md b/doc/auto_rpc.md index b4d66762..0e7f77b7 100755 --- a/doc/auto_rpc.md +++ b/doc/auto_rpc.md @@ -30,11 +30,11 @@ CBasicConfig* CreateConfig(const std::string& cmd) { if (cmd == "help") { - return new mode_impl::CCombinConfig; + return new mode_impl::CCombineConfig; } else if (cmd == "stop") { - return new mode_impl::CCombinConfig; + return new mode_impl::CCombineConfig; } ... } diff --git a/doc/config-sample/bigbang.conf b/doc/config-sample/bigbang.conf index 8ab242b1..f9408abb 100644 --- a/doc/config-sample/bigbang.conf +++ b/doc/config-sample/bigbang.conf @@ -1,177 +1,192 @@ -## -## bigbang.conf configuration file. Lines beginning with # are comments. -## - - -# Network-related options: - - -# Note that if you use testnet, particularly with the options -# addnode, connect, port, rpcport or rpchost, you will also -# want to read "[Sections]" further down. - -# Run on the test network instead of the real bigbang network. -#testnet=false -#testnet -# or -#testnet=true - -# Listening mode, Accept IPv4 and IPv6 connections from outside (disabled by default) -#listen=false -#listen -# or -#listen=true - -# Accept IPv4 connections from outside (default: false) -#listen4=false - -# Accept IPv6 connections from outside (default: false) -#listen6=false - -# Port on which to listen for connections (default: 9901, testnet: 9903) -#port= - -# Used in the case of node is being behind a NAT, The form of : of address of gateway( can be IPv4 or IPv6, default : 9901, IPv6 format: [ip]:port) -#gateway=: - -# Maximum number of inbound+outbound connections(125 by default). -#maxconnections= - -# Specify connection timeout (in milliseconds) -#timeout= - -# Add a node to connect to and attempt to keep the connection open(
can be IPv4 or IPv6 or domain name, default : 9901, IPv6 format: [ip]:port) -# Use as many addnode= settings as you like to connect to specific peers -#addnode=69.164.218.197 -#addnode=10.0.0.2:8333 - -# Connect only to the specified node(
can be IPv4 or IPv6 or domain name, default : 9901, IPv6 format: [ip]:port) -# Alternatively use as many connect= settings as you like to connect ONLY to specific peers -#connect=69.164.218.197 -#connect=10.0.0.1:8333 - -# Trust node address(
can be IPv4 or IPv6) -#confidentAddress=
- -# DNSeed address list(
can be IPv4 or IPv6 or domain name, default : 9906, IPv6 format: [ip]:port) -#dnseed=
: - - -# JSON-RPC options (for controlling a running bigbang process) - - -# rpclisten=true tells bigbang daemon to accept JSON-RPC commands -#rpclisten=false - -# Bind to given address to listen for JSON-RPC connections. -#rpchost= - -# Listen for JSON-RPC connections on (default: 9902 or testnet: 9904)) -#rpcport=port - -# Accept RPC IPv4 connections (default: 0) -#rpclisten4=false - -# Accept RPC IPv6 connections (default: 0) -#rpclisten6 - -# name for JSON-RPC connections -#rpcuser= - -# for JSON-RPC connections -#rpcpassword= - -# Use OpenSSL (https) for JSON-RPC connections or not (default false) -#rpcssl - -# Verify SSL or not (default yes) -#norpcsslverify - -# SSL CA file name (default ca.crt) -#rpccafile= - -# Server certificate file (default: server.crt) -#rpccertfile= - -# Server private key (default: server.pem) -#rpcpkfile= - -# Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH) -#rpcciphers= - -# Enable statistical data or not (default false) -#statdata - -# Enable write RPC log (default true) -#rpclog - -# Connection timeout