Skip to content

Commit e02ad1f

Browse files
committed
Fix merge conflict
2 parents d370b3f + d382ac8 commit e02ad1f

File tree

140 files changed

+17180
-2234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+17180
-2234
lines changed

.travis.yml

+27-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
language: c++
22

3+
cache: ccache
4+
35
git:
46
depth: 1
57

@@ -10,9 +12,30 @@ sudo: true
1012
install:
1113
- echo "deb http://de.archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
1214
- sudo apt-get update
13-
- sudo apt-get install --allow-unauthenticated g++ libboost-all-dev cmake libreadline-dev libssl-dev autoconf
15+
- sudo apt-get install --allow-unauthenticated g++ libboost-all-dev cmake libreadline-dev libssl-dev autoconf parallel ccache
16+
17+
addons:
18+
sonarcloud:
19+
organization: "flwyiq7go36p6lipr64tbesy5jayad3q"
20+
token:
21+
secure: "Ik4xQhs9imtsFIC1SMAPmdLId9lVadY/4PEgo5tM4M5cQRvyt4xeuMMV+CRIT6tGEEqF71ea74qVJTxT7qinWZ3kmHliFjbqDxk1FbjCpK6NGQDyTdfWMVJFIlk7WefvtGAwFBkf6pSTs553bKNNM0HbBYQGKe08waLwv7R+lOmVjTTKIRF/cCVw+C5QQZdXFnUMTg+mRuUqGk4WvNNPmcBfkX0ekHPrXwAD5ATVS1q0iloA0nzHq8CPNmPE+IyXdPw0EBp+fl3cL9MgrlwRbELxrnCKFy+ObdjhDj7z3FDIxDe+03gVlgd+6Fame+9EJCeeeNLF4G4qNR1sLEvHRqVz12/NYnRU9hQL0c/jJtiUquOJA5+HqrhhB9XUZjS1xbHV3aIU5PR0bdDP6MKatvIVwRhwxwhaDXh7VSimis8eL+LvXT7EO+rGjco0c17RuzZpFCsKmXCej4Q8iDBMdOIWwe2WuWi8zb6MFvnLyK2EcM53hAn2yMwU+nprbpHwzU5oJTFZLD+J78zCSGk7uu7vsF+EEnheMwfqafP9MpMEXGXaXZiq7QKy3KvxQTg+1ozPIu+fgxvY0xdyrjJHOSJlrvXN7osjD4IDTs6D5cLAZ04WGIKsulZDr7ZN5n3gmA9h4cfhJsIEia0uQzLmWnfF6RksxWElK1i1+xmse7E="
22+
23+
env:
24+
global:
25+
- CCACHE_COMPRESS=exists_means_true
26+
- CCACHE_MAXSIZE=1Gi
27+
- CCACHE_SLOPPINESS=include_file_ctime,include_file_mtime,time_macros
1428

1529
script:
16-
- cmake -DCMAKE_BUILD_TYPE=Debug -DBoost_USE_STATIC_LIBS=OFF .
17-
- make -j 2
18-
30+
- 'echo $((`date +%s` - 120)) >_start_time'
31+
- ccache -s
32+
- '( [ `ccache -s | grep "files in cache" | cut -c 20-` = 0 ] && touch _empty_cache ) || true'
33+
- sed -i '/tests/d' libraries/fc/CMakeLists.txt
34+
- cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage -DBoost_USE_STATIC_LIBS=OFF -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON .
35+
- 'which build-wrapper-linux-x86-64 && build-wrapper-linux-x86-64 --out-dir bw-output make -j 2 cli_wallet witness_node chain_test cli_test || make -j 2 cli_wallet witness_node chain_test cli_test'
36+
- set -o pipefail
37+
- '[ -r _empty_cache ] || tests/chain_test 2>&1 | cat'
38+
- '[ -r _empty_cache ] || tests/cli_test 2>&1 | cat'
39+
- 'find libraries/[acdenptuw]*/CMakeFiles/*.dir programs/[cdgjsw]*/CMakeFiles/*.dir -type d | while read d; do gcov -o "$d" "${d/CMakeFiles*.dir//}"/*.cpp; done >/dev/null'
40+
- '( [ -r _empty_cache -o $((`date +%s` - `cat _start_time`)) -gt $((42 * 60)) ] && echo "WARNING! Skipping sonar scanner due to time constraints!" ) || ( which sonar-scanner && sonar-scanner || true )'
41+
- '[ ! -r _empty_cache ] || ( echo "Please restart with populated cache" && false )'

CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ if (USE_PCH)
3232
include (cotire)
3333
endif(USE_PCH)
3434

35+
option(USE_PROFILER "Build with GPROF support(Linux)." OFF)
36+
3537
IF( NOT WIN32 )
3638
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/CMakeModules" )
3739
ENDIF( NOT WIN32 )
@@ -112,6 +114,9 @@ else( WIN32 ) # Apple AND Linux
112114
# Linux Specific Options Here
113115
message( STATUS "Configuring BitShares on Linux" )
114116
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall" )
117+
if(USE_PROFILER)
118+
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg" )
119+
endif( USE_PROFILER )
115120
set( rt_library rt )
116121
set( pthread_library pthread)
117122
if ( NOT DEFINED crypto_library )
@@ -203,3 +208,7 @@ endif(LINUX)
203208

204209
include(CPack)
205210
endif(ENABLE_INSTALLER)
211+
212+
MESSAGE( STATUS "" )
213+
MESSAGE( STATUS "PROFILER: ${USE_PROFILER}" )
214+
MESSAGE( STATUS "" )

Dockerfile

+6-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ RUN \
4040
-DCMAKE_BUILD_TYPE=Release \
4141
. && \
4242
make witness_node cli_wallet && \
43-
make install && \
43+
install -s programs/witness_node/witness_node programs/cli_wallet/cli_wallet /usr/local/bin && \
4444
#
4545
# Obtain version
4646
mkdir /etc/bitshares && \
@@ -60,12 +60,15 @@ VOLUME ["/var/lib/bitshares", "/etc/bitshares"]
6060
# rpc service:
6161
EXPOSE 8090
6262
# p2p service:
63-
EXPOSE 2001
63+
EXPOSE 1776
6464

6565
# default exec/config files
6666
ADD docker/default_config.ini /etc/bitshares/config.ini
6767
ADD docker/bitsharesentry.sh /usr/local/bin/bitsharesentry.sh
6868
RUN chmod a+x /usr/local/bin/bitsharesentry.sh
6969

70+
# Make Docker send SIGINT instead of SIGTERM to the daemon
71+
STOPSIGNAL SIGINT
72+
7073
# default execute entry
71-
CMD /usr/local/bin/bitsharesentry.sh
74+
CMD ["/usr/local/bin/bitsharesentry.sh"]

Doxyfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "Bitshares-Core"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "2.0.180202"
41+
PROJECT_NUMBER = "2.0.180612"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

README-docker.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ containers. This README serves as documentation.
77

88
The `Dockerfile` performs the following steps:
99

10-
1. Obtain base image (phusion/baseimage:0.9.19)
10+
1. Obtain base image (phusion/baseimage:0.10.1)
1111
2. Install required dependencies using `apt-get`
1212
3. Add bitshares-core source code into container
1313
4. Update git submodules
@@ -16,7 +16,7 @@ The `Dockerfile` performs the following steps:
1616
7. Purge source code off the container
1717
8. Add a local bitshares user and set `$HOME` to `/var/lib/bitshares`
1818
9. Make `/var/lib/bitshares` and `/etc/bitshares` a docker *volume*
19-
10. Expose ports `8090` and `2001`
19+
10. Expose ports `8090` and `1776`
2020
11. Add default config from `docker/default_config.ini` and entry point script
2121
12. Run entry point script by default
2222

README.md

+30-20
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,48 @@ The web wallet is [BitShares UI](https://github.com/bitshares/bitshares-ui).
2020

2121
Visit [BitShares.org](https://bitshares.org/) to learn about BitShares and join the community at [BitSharesTalk.org](https://bitsharestalk.org/).
2222

23-
**NOTE:** The official BitShares git repository location, default branch, and submodule remotes were recently changed. Existing
24-
repositories can be updated with the following steps:
25-
26-
git remote set-url origin https://github.com/bitshares/bitshares-core.git
27-
git checkout master
28-
git remote set-head origin --auto
29-
git pull
30-
git submodule sync --recursive
31-
git submodule update --init --recursive
32-
3323
Getting Started
3424
---------------
3525
Build instructions and additional documentation are available in the
3626
[wiki](https://github.com/bitshares/bitshares-core/wiki).
3727

38-
We recommend building on Ubuntu 16.04 LTS, and the build dependencies may be installed with:
28+
We recommend building on Ubuntu 16.04 LTS (64-bit)
29+
30+
**Build Dependencies**:
3931

4032
sudo apt-get update
41-
sudo apt-get install autoconf cmake git libboost-all-dev libssl-dev g++ libcurl4-openssl-dev
33+
sudo apt-get install autoconf cmake make automake libtool git libboost-all-dev libssl-dev g++ libcurl4-openssl-dev
4234

43-
To build after all dependencies are installed:
35+
**Build Script:**
4436

4537
git clone https://github.com/bitshares/bitshares-core.git
4638
cd bitshares-core
47-
git checkout <LATEST_RELEASE_TAG>
39+
git checkout master # may substitute "master" with current release tag
4840
git submodule update --init --recursive
4941
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .
5042
make
5143

52-
**NOTE:** BitShares requires an [OpenSSL](https://www.openssl.org/) version in the 1.0.x series. OpenSSL 1.1.0 and newer are NOT supported. If your system OpenSSL version is newer, then you will need to manually provide an older version of OpenSSL and specify it to CMake using `-DOPENSSL_INCLUDE_DIR`, `-DOPENSSL_SSL_LIBRARY`, and `-DOPENSSL_CRYPTO_LIBRARY`.
44+
**Upgrade Script** (prepend to the Build Script above if you built a prior release):
45+
46+
git remote set-url origin https://github.com/bitshares/bitshares-core.git
47+
git checkout master
48+
git remote set-head origin --auto
49+
git pull
50+
git submodule update --init --recursive # this command may fail
51+
git submodule sync --recursive
52+
git submodule update --init --recursive
5353

54-
**NOTE:** BitShares requires a [Boost](http://www.boost.org/) version in the range [1.57, 1.63]. Versions earlier than
55-
1.57 or newer than 1.63 are NOT supported. If your system Boost version is newer, then you will need to manually build
54+
**NOTE:** BitShares requires a [Boost](http://www.boost.org/) version in the range [1.57 - 1.65.1]. Versions earlier than
55+
1.57 or newer than 1.65.1 are NOT supported. If your system's Boost version is newer, then you will need to manually build
5656
an older version of Boost and specify it to CMake using `DBOOST_ROOT`.
5757

58-
After building, the witness node can be launched with:
58+
**NOTE:** BitShares requires a 64-bit operating system to build, and will not build on a 32-bit OS.
59+
60+
**NOTE:** BitShares now supports Ubuntu 18.04 LTS
61+
62+
**NOTE:** BitShares now supports OpenSSL 1.1.0
63+
64+
**After Building**, the `witness_node` can be launched with:
5965

6066
./programs/witness_node/witness_node
6167

@@ -65,8 +71,12 @@ the blockchain. After syncing, you can exit the node using Ctrl+C and setup the
6571

6672
rpc-endpoint = 127.0.0.1:8090
6773

68-
**NOTE:** By default the witness node will start in reduced memory ram mode by using some of the commands detailed in [Memory reduction for nodes](https://github.com/bitshares/bitshares-core/wiki/Memory-reduction-for-nodes).
69-
In order to run a full node with all the account history you need to remove `partial-operations` and `max-ops-per-account` from your config file. Please note that currently(2017-12-23) a full node need 54GB of RAM to operate and required memory is growing fast.
74+
**IMPORTANT:** By default the witness node will start in reduced memory ram mode by using some of the commands detailed in [Memory reduction for nodes](https://github.com/bitshares/bitshares-core/wiki/Memory-reduction-for-nodes).
75+
In order to run a full node with all the account history you need to remove `partial-operations` and `max-ops-per-account` from your config file. Please note that currently(2018-07-02) a full node will need more than 100GB of RAM to operate and required memory is growing fast. Consider the following table before running a node:
76+
77+
| Default | Full | Minimal | ElasticSearch
78+
| --- | --- | --- | ---
79+
| 16G RAM | 120G RAM | 4G RAM | 500G SSD HD, 32G RAM
7080

7181
After starting the witness node again, in a separate terminal you can run:
7282

docker/bitsharesentry.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ ln -f -s /etc/bitshares/config.ini /var/lib/bitshares
8181
# Plugins need to be provided in a space-separated list, which
8282
# makes it necessary to write it like this
8383
if [[ ! -z "$BITSHARESD_PLUGINS" ]]; then
84-
$BITSHARESD --data-dir ${HOME} ${ARGS} ${BITSHARESD_ARGS} --plugins "${BITSHARESD_PLUGINS}"
84+
exec $BITSHARESD --data-dir ${HOME} ${ARGS} ${BITSHARESD_ARGS} --plugins "${BITSHARESD_PLUGINS}"
8585
else
86-
$BITSHARESD --data-dir ${HOME} ${ARGS} ${BITSHARESD_ARGS}
86+
exec $BITSHARESD --data-dir ${HOME} ${ARGS} ${BITSHARESD_ARGS}
8787
fi

docker/default_config.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Endpoint for P2P node to listen on
2-
p2p-endpoint = 0.0.0.0:9090
2+
p2p-endpoint = 0.0.0.0:1776
33

44
# P2P nodes to connect to on startup (may specify multiple times)
55
# seed-node =

docs

Submodule docs updated from bd792d0 to 73a4f9a

libraries/app/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ add_library( graphene_app
66
application.cpp
77
util.cpp
88
database_api.cpp
9-
impacted.cpp
109
plugin.cpp
10+
config_util.cpp
1111
${HEADERS}
1212
${EGENESIS_HEADERS}
1313
)

libraries/app/api.cpp

+18-10
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <graphene/app/api.hpp>
2727
#include <graphene/app/api_access.hpp>
2828
#include <graphene/app/application.hpp>
29-
#include <graphene/app/impacted.hpp>
3029
#include <graphene/chain/database.hpp>
3130
#include <graphene/chain/get_config.hpp>
3231
#include <graphene/utilities/key_conversion.hpp>
@@ -309,7 +308,7 @@ namespace graphene { namespace app {
309308
return result;
310309
}
311310

312-
vector<operation_history_object> history_api::get_account_history( account_id_type account,
311+
vector<operation_history_object> history_api::get_account_history( const std::string account_id_or_name,
313312
operation_history_id_type stop,
314313
unsigned limit,
315314
operation_history_id_type start ) const
@@ -318,7 +317,9 @@ namespace graphene { namespace app {
318317
const auto& db = *_app.chain_database();
319318
FC_ASSERT( limit <= 100 );
320319
vector<operation_history_object> result;
320+
account_id_type account;
321321
try {
322+
account = database_api.get_account_id_from_string(account_id_or_name);
322323
const account_transaction_history_object& node = account(db).statistics(db).most_recent_op(db);
323324
if(start == operation_history_id_type() || start.instance.value > node.operation_id.instance.value)
324325
start = node.operation_id;
@@ -342,7 +343,7 @@ namespace graphene { namespace app {
342343
return result;
343344
}
344345

345-
vector<operation_history_object> history_api::get_account_history_operations( account_id_type account,
346+
vector<operation_history_object> history_api::get_account_history_operations( const std::string account_id_or_name,
346347
int operation_id,
347348
operation_history_id_type start,
348349
operation_history_id_type stop,
@@ -352,6 +353,10 @@ namespace graphene { namespace app {
352353
const auto& db = *_app.chain_database();
353354
FC_ASSERT( limit <= 100 );
354355
vector<operation_history_object> result;
356+
account_id_type account;
357+
try {
358+
account = database_api.get_account_id_from_string(account_id_or_name);
359+
} catch(...) { return result; }
355360
const auto& stats = account(db).statistics(db);
356361
if( stats.most_recent_op == account_transaction_history_id_type() ) return result;
357362
const account_transaction_history_object* node = &stats.most_recent_op(db);
@@ -378,7 +383,7 @@ namespace graphene { namespace app {
378383
}
379384

380385

381-
vector<operation_history_object> history_api::get_relative_account_history( account_id_type account,
386+
vector<operation_history_object> history_api::get_relative_account_history( const std::string account_id_or_name,
382387
uint32_t stop,
383388
unsigned limit,
384389
uint32_t start) const
@@ -387,13 +392,16 @@ namespace graphene { namespace app {
387392
const auto& db = *_app.chain_database();
388393
FC_ASSERT(limit <= 100);
389394
vector<operation_history_object> result;
395+
account_id_type account;
396+
try {
397+
account = database_api.get_account_id_from_string(account_id_or_name);
398+
} catch(...) { return result; }
390399
const auto& stats = account(db).statistics(db);
391400
if( start == 0 )
392401
start = stats.total_ops;
393402
else
394403
start = min( stats.total_ops, start );
395404

396-
397405
if( start >= stop && start > stats.removed_ops && limit > 0 )
398406
{
399407
const auto& hist_idx = db.get_index_type<account_transaction_history_index>();
@@ -419,12 +427,12 @@ namespace graphene { namespace app {
419427
return hist->tracked_buckets();
420428
}
421429

422-
history_operation_detail history_api::get_account_history_by_operations(account_id_type account, vector<uint16_t> operation_types, uint32_t start, unsigned limit)
430+
history_operation_detail history_api::get_account_history_by_operations(const std::string account_id_or_name, vector<uint16_t> operation_types, uint32_t start, unsigned limit)
423431
{
424-
FC_ASSERT(limit <= 100);
425-
history_operation_detail result;
426-
vector<operation_history_object> objs = get_relative_account_history(account, start, limit, limit + start - 1);
427-
std::for_each(objs.begin(), objs.end(), [&](const operation_history_object &o) {
432+
FC_ASSERT(limit <= 100);
433+
history_operation_detail result;
434+
vector<operation_history_object> objs = get_relative_account_history(account_id_or_name, start, limit, limit + start - 1);
435+
std::for_each(objs.begin(), objs.end(), [&](const operation_history_object &o) {
428436
if (operation_types.empty() || find(operation_types.begin(), operation_types.end(), o.op.which()) != operation_types.end()) {
429437
result.operation_history_objs.push_back(o);
430438
}

libraries/app/application.cpp

+12-4
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,10 @@ void application_impl::reset_p2p_node(const fc::path& data_dir)
179179
"seed.cubeconnex.com:1777", // cube (USA)
180180
"seed.roelandp.nl:1776", // roelandp (Canada)
181181
"seed04.bts-nodes.net:1776", // Thom (Australia)
182-
"seed05.bts-nodes.net:1776", // Thom (USA)
183-
"seed06.bts-nodes.net:1776", // Thom (USA)
184-
"seed07.bts-nodes.net:1776", // Thom (Singapore)
182+
"seed05.bts-nodes.net:1776", // Thom (USA)
183+
"seed06.bts-nodes.net:1776", // Thom (USA)
184+
"seed07.bts-nodes.net:1776", // Thom (Singapore)
185+
"seed.bts.bangzi.info:55501", // Bangzi (Germany)
185186
"seeds.bitshares.eu:1776" // pc (http://seeds.quisquis.de/bitshares.html)
186187
};
187188
for( const string& endpoint_string : seeds )
@@ -384,6 +385,11 @@ void application_impl::startup()
384385
}
385386
_chain_db->add_checkpoints( loaded_checkpoints );
386387

388+
if( _options->count("enable-standby-votes-tracking") )
389+
{
390+
_chain_db->enable_standby_votes_tracking( _options->at("enable-standby-votes-tracking").as<bool>() );
391+
}
392+
387393
if( _options->count("replay-blockchain") )
388394
_chain_db->wipe( _data_dir / "blockchain", false );
389395

@@ -435,7 +441,6 @@ void application_impl::startup()
435441
wild_access.allowed_apis.push_back( "database_api" );
436442
wild_access.allowed_apis.push_back( "network_broadcast_api" );
437443
wild_access.allowed_apis.push_back( "history_api" );
438-
wild_access.allowed_apis.push_back( "crypto_api" );
439444
wild_access.allowed_apis.push_back( "orders_api" );
440445
_apiaccess.permission_map["*"] = wild_access;
441446
}
@@ -939,6 +944,9 @@ void application::set_program_options(boost::program_options::options_descriptio
939944
("io-threads", bpo::value<uint16_t>()->implicit_value(0), "Number of IO threads, default to 0 for auto-configuration")
940945
("enable-subscribe-to-all", bpo::value<bool>()->implicit_value(false),
941946
"Whether allow API clients to subscribe to universal object creation and removal events")
947+
("enable-standby-votes-tracking", bpo::value<bool>()->implicit_value(true),
948+
"Whether to enable tracking of votes of standby witnesses and committee members. "
949+
"Set it to true to provide accurate data to API clients, set to false for slightly better performance.")
942950
;
943951
command_line_options.add(configuration_file_options);
944952
command_line_options.add_options()

0 commit comments

Comments
 (0)