Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop to release for 3.3.0 release candidate #1919

Merged
merged 140 commits into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
10a382f
serve get_account_history with elasticsearch plugin
oxarbitrage Apr 20, 2019
00496a9
replace IdToString
oxarbitrage Apr 20, 2019
9a53b35
harden binaries through defensive compilation and linking
crypto-ape Jun 24, 2019
b228820
put seed nodes into separate file
crypto-ape Jun 24, 2019
649709f
small refactor of cli_wallet to get rid of transaction expiration con…
crypto-ape Jun 26, 2019
c2960ff
Moved undo_point forward to MAX_UNDO_HISTORY
pmconrad Jun 26, 2019
5088496
add htlc parameters to developer genesis
oxarbitrage Jun 26, 2019
416458f
Merge pull request #1811 from crypto-ape/cli_wallet-transaction_defau…
pmconrad Jun 27, 2019
49d8e94
Merge pull request #1832 from bitshares/1703_enable_undo_earlier
pmconrad Jun 27, 2019
725dff1
Merge pull request #1833 from bitshares/oxarbitrage-patch-1
pmconrad Jun 27, 2019
a905a78
Initial implementation of secondary index plugin
pmconrad Jun 27, 2019
42775b4
Committee and witnesses initialization in genesis
Jun 28, 2019
d40f70a
Added total_in_collateral to asset API calls
pmconrad Jun 27, 2019
6bb8213
Resolve #1781
pmconrad Jun 27, 2019
8691fed
Log warning if index isnt available
pmconrad Jun 27, 2019
1da7a5b
Added unit tests
pmconrad Jun 29, 2019
21778df
Avoid local static variable
pmconrad Jun 29, 2019
4bbbe13
Attempt to fix test timing
pmconrad Jun 29, 2019
4c8e1ca
Merge remote-tracking branch 'origin/develop' into 1089_asset_in_coll…
pmconrad Jun 30, 2019
c567ee7
Avoid confusion with default copy/move constructors
pmconrad Jun 30, 2019
238a599
Enable new plugin by default
pmconrad Jul 1, 2019
61364a6
Fix test for MSVC
jmjatlanta Jul 5, 2019
1c6fb9a
fix another independent_bits
jmjatlanta Jul 5, 2019
cc96750
code formatting
Jul 8, 2019
cb7512b
Merge pull request #1846 from bitshares/release
jmjatlanta Jul 11, 2019
6ca701c
add list_htlcs database api call
oxarbitrage Jul 14, 2019
2a6d7b2
add is_plugin_enabled to application
oxarbitrage Jul 15, 2019
1737d45
add elasticsearch-mode command for save, query or all
oxarbitrage Jul 15, 2019
6dda9fe
execute elasticsearch account_history in a new thread
oxarbitrage Jul 16, 2019
f49a962
Merge pull request #1858 from bitshares/release
abitmore Jul 20, 2019
048cc49
typo in vote_for_committee_member description
oxarbitrage Jul 22, 2019
305e230
Merge pull request #1862 from bitshares/oxarbitrage-patch-2
abitmore Jul 22, 2019
ee0169d
Fix API docs
abitmore Jul 23, 2019
b725efd
Merge pull request #1863 from bitshares/fix-api-docs
oxarbitrage Jul 23, 2019
bac458a
Update database API docs, wrap long lines
abitmore Jul 23, 2019
d64578b
Update CLI wallet API docs, wrap long lines
abitmore Jul 24, 2019
9886219
Update API docs, wrap long lines
abitmore Jul 24, 2019
9dfd1cd
Update CLI wallet docs
abitmore Jul 24, 2019
a2d363f
Merge pull request #1849 from oxarbitrage/issue1713
abitmore Jul 24, 2019
d23e666
Merge pull request #1809 from crypto-ape/put_seed_nodes_into_separate…
abitmore Jul 24, 2019
8f2b17a
Merge pull request #1810 from crypto-ape/harden_binaries_through_defe…
abitmore Jul 24, 2019
97b2402
Update database API docs
abitmore Jul 24, 2019
68100ed
Merge pull request #1840 from bitshares/jmj_independent_bits
jmjatlanta Jul 24, 2019
873e82a
Merge pull request #1866 from bitshares/update-api-docs
abitmore Jul 25, 2019
be417d3
modified CMakeLists.txt for static linking of libcurl
jmjatlanta Jul 26, 2019
94e1da6
Reduce log level of dupe_trx and fill_or_kill
abitmore Jul 27, 2019
c52eb62
Wrap long lines
abitmore Jul 27, 2019
eea889d
Reduce log level of exceptions in order_cancel_op
abitmore Jul 27, 2019
58d1407
Wrap long lines
abitmore Jul 28, 2019
2b5d3d0
Merge pull request #1836 from pmconrad/1089_asset_in_collateral
pmconrad Jul 29, 2019
98bd37e
move logic to main CMakeLists.txt
jmjatlanta Jul 29, 2019
8bbd217
Reduce log level of exceptions in order_create_op
abitmore Jul 29, 2019
9990f9f
Merge pull request #1872 from bitshares/jmj_static_linux
jmjatlanta Jul 30, 2019
c213f3b
Replace magic numbers in node.cpp with enum names
abitmore Jul 30, 2019
a716949
Send shorter disconn-msg when got a future block
abitmore Jul 30, 2019
35c1b87
Wrap long lines
abitmore Jul 30, 2019
d04c62a
Remove unused macro parameter
abitmore Jul 30, 2019
26e9f16
simplify conditional
oxarbitrage Jul 31, 2019
4fac171
capture only what is necessary in lambda
oxarbitrage Jul 31, 2019
29bf975
wrap command line option long lines
oxarbitrage Jul 31, 2019
1e82119
libs doc separate protocol from chain
oxarbitrage Jul 31, 2019
de76301
make mode an enum for comparison performance
oxarbitrage Jul 31, 2019
5838a38
throw when mode::all if elasticsearch-operation-string is false
oxarbitrage Jul 31, 2019
1f6ac14
change ES query
oxarbitrage Jul 31, 2019
63f7aff
remove range from second ES query
oxarbitrage Jul 31, 2019
a7fc6b0
add get_running_mode() to plugin and use it in api, fix capture
oxarbitrage Jul 31, 2019
13d8034
Merge branch 'develop' into issue1682
oxarbitrage Jul 31, 2019
f257cba
BSIP-compatible initial version, non-working
pmconrad Jul 31, 2019
d218bca
Rewrite/refactor sign_message for compatibility with python-bitshares
pmconrad Aug 1, 2019
07de45e
create only 1 thread to serve ES queries
oxarbitrage Aug 1, 2019
f1bedc7
Merge branch 'issue1682' of https://github.com/oxarbitrage/bitshares-…
oxarbitrage Aug 1, 2019
d62131e
Merge pull request #1875 from bitshares/pr-978-p2p-logging
abitmore Aug 1, 2019
7d177bf
Fixed verify_message
pmconrad Aug 1, 2019
7544f7f
Refactored verify_message into distinct methods
pmconrad Aug 1, 2019
6dd0935
Merge pull request #1835 from openledger/committee-initialization
abitmore Aug 2, 2019
da0cbb6
Merge pull request #1877 from bitshares/oxarbitrage-patch-2
abitmore Aug 2, 2019
2c672ff
Added unit test
pmconrad Aug 2, 2019
1d1a229
Remove seed node with missing DNS record
xeroc Aug 5, 2019
d735324
Switched time to string format
pmconrad Aug 5, 2019
b2a519d
Use head block num + time instead of dummy values
pmconrad Aug 5, 2019
098b02c
Removed duplicate comment
pmconrad Aug 5, 2019
89e4e4e
witness_node can accept private keys from files
crypto-ape Aug 5, 2019
f65f5b6
Add test case for ticker volume underflow issue
abitmore Aug 6, 2019
e98f178
Fix market ticker volume underflow issue
abitmore Aug 6, 2019
fc1c972
Merge pull request #1878 from pmconrad/sign_msg
pmconrad Aug 7, 2019
90fd510
Merge pull request #1885 from bitshares/pr-1883-fix-ticker-rolling
oxarbitrage Aug 8, 2019
adae71b
Improve help message of get_dev_key
abitmore Aug 8, 2019
cc565a3
Add optional subscribe param to some database APIs
abitmore Jul 24, 2019
202eb0b
Add test case for optional subscription
abitmore Aug 8, 2019
bf44862
Move some functions from htlc_tests to db_fixture
abitmore Aug 8, 2019
8d0e860
Add test case for get_htlc optional subscription
abitmore Aug 8, 2019
25db2cc
Merge pull request #1812 from crypto-ape/witness_node-accept_private_…
abitmore Aug 9, 2019
5d36325
Make Travis use multi-stage build
nathanielhourt Aug 9, 2019
25110aa
Merge pull request #1890 from nathanhourt/travis_multi_stage
nathanielhourt Aug 9, 2019
2d537c9
Merge pull request #1888 from bitshares/pr-improve-get-dev-key
abitmore Aug 9, 2019
d706a6d
add api_helper_indexes plugin
oxarbitrage Aug 10, 2019
c04d7ee
improve Doxyfile
oxarbitrage Jul 17, 2019
cd09370
Merge pull request #1851 from bitshares/oxarbitrage-patch-1
oxarbitrage Aug 12, 2019
234f641
Update build_and_test
nathanielhourt Aug 12, 2019
007c0e8
Update build_protocol
nathanielhourt Aug 12, 2019
7cfdd62
Update build_and_test
nathanielhourt Aug 12, 2019
ba65ab5
change category to helper
oxarbitrage Aug 13, 2019
86677f5
Merge pull request #1905 from bitshares/nathanhourt-patch-1
oxarbitrage Aug 13, 2019
aa76ec0
Adapted to fc promise changes
pmconrad Apr 27, 2019
8f1eca1
Replace fc::uint128 with boost::multiprecision::uint128_t
pmconrad May 7, 2019
3911b7e
Replaced fc::array with std::array
pmconrad May 29, 2019
b46c252
Replaced true_type, false_type, is_class, is_enum with std type_traits
pmconrad Jun 3, 2019
4d4f863
Use fc::uint128_t instead of boost
pmconrad Jun 6, 2019
2288f2f
Supplement native 128bit integers
pmconrad Jun 7, 2019
9c4a36e
Removed obsolete unused header
pmconrad Jun 8, 2019
b7bc8b8
Enable native 128bit
pmconrad Jun 8, 2019
6be04cb
Fixed static_assert
pmconrad Jun 19, 2019
5e71819
Removed unused _buf
pmconrad Aug 2, 2019
40414e5
Use fc::variant for uint128->string conversion
pmconrad Aug 8, 2019
f157218
Fix cmake warning
pmconrad Aug 11, 2019
b9614a4
Bumped fc
pmconrad Aug 13, 2019
9014ba1
Adapted signed_message for std:array
pmconrad Aug 13, 2019
cd5e9e2
change category to Database API
oxarbitrage Aug 13, 2019
947f0b1
Merge pull request #1789 from pmconrad/1584_simplifications
jmjatlanta Aug 13, 2019
fa2248f
Requires api_helper_indexes plugin to start node
abitmore Aug 13, 2019
ebd5dbb
Update comments, wrap long lines
abitmore Aug 13, 2019
cea7b74
Merge pull request #1725 from oxarbitrage/issue1682
oxarbitrage Aug 14, 2019
8a3fad7
bump FC for Boost 1.70
jmjatlanta Aug 14, 2019
f87858c
Merge pull request #1868 from bitshares/pr-1819-subscription
oxarbitrage Aug 14, 2019
0330e7f
Merge pull request #1894 from bitshares/oxarbitrage-patch-2
oxarbitrage Aug 14, 2019
e7df677
Requires api_helper_indexes only if enabled RPC
abitmore Aug 14, 2019
f721cdc
Rename full_account.hpp to api_objects.hpp
abitmore Aug 9, 2019
ba0dca6
Move definitions of API objects to api_objects.hpp
abitmore Aug 9, 2019
04b48fb
Merge pull request #1912 from bitshares/jmj_winfix
oxarbitrage Aug 14, 2019
f9eeb76
Merge pull request #1889 from bitshares/abitmore-patch-1
abitmore Aug 14, 2019
c3a4b65
Merge pull request #1879 from bitshares/cleanup-seed-nodes
pmconrad Aug 15, 2019
2796149
Move some code from database_api.cpp to others
abitmore Aug 9, 2019
e5ae949
Create database_api_impl.hxx and move code into it
abitmore Aug 9, 2019
3a6fbc4
Move get_account_limit_orders code to market group
abitmore Aug 9, 2019
a0aa6b4
Fix broken build by adding missing include
pmconrad Aug 15, 2019
62fc622
Update includes
abitmore Aug 15, 2019
7beb5e7
Merge pull request #1917 from pmconrad/fix-build
pmconrad Aug 15, 2019
34509f8
Merge pull request #1891 from bitshares/pr-database-api-code-refactory
oxarbitrage Aug 15, 2019
6f31305
Fix Windows linker error
abitmore Aug 15, 2019
96e3177
Merge pull request #1920 from bitshares/abitmore-patch-1
jmjatlanta Aug 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,9 @@ env:
- CCACHE_MAXSIZE=1Gi
- CCACHE_SLOPPINESS=include_file_ctime,include_file_mtime,time_macros

script:
- programs/build_helpers/buildstep -s 3500
- ccache -s
- programs/build_helpers/buildstep Prepare 1 "sed -i '/tests/d' libraries/fc/CMakeLists.txt"
- programs/build_helpers/buildstep cmake 5 "cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage -DBoost_USE_STATIC_LIBS=OFF -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON ."
- programs/build_helpers/buildstep make.cli_wallet 2200 "programs/build_helpers/make_with_sonar bw-output -j 2 cli_wallet witness_node js_operation_serializer get_dev_key network_mapper"
- programs/build_helpers/buildstep make.chain_test 1000 "make -j 2 chain_test"
- programs/build_helpers/buildstep make.cli_test 200 "make -j 2 cli_test"
- programs/build_helpers/buildstep make.perf_test 120 "make -j 2 performance_test"
- set -o pipefail
- programs/build_helpers/buildstep run.chain_test 240 "libraries/fc/tests/run-parallel-tests.sh tests/chain_test"
- programs/build_helpers/buildstep run.cli_test 60 "libraries/fc/tests/run-parallel-tests.sh tests/cli_test"
- 'programs/build_helpers/buildstep prepare.sonar 20 "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; programs/build_helpers/set_sonar_branch sonar-project.properties" || true'
- 'programs/build_helpers/buildstep run.sonar 1200 "which sonar-scanner && sonar-scanner" || true'
- programs/build_helpers/buildstep end 0
- ccache -s
jobs:
include:
- stage: build for cache
script: ./programs/build_helpers/build_protocol
- stage: build and test
script: ./programs/build_helpers/build_and_test
92 changes: 89 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Defines BitShares library target.
project( BitShares )
cmake_minimum_required( VERSION 3.1 )
cmake_minimum_required( VERSION 3.2 FATAL_ERROR )
project( BitShares LANGUAGES CXX C)

set( BLOCKCHAIN_NAME "BitShares" )

Expand All @@ -11,7 +11,12 @@ set( INSTALLER_APP_ID "68ad7005-8eee-49c9-95ce-9eed97e5b347" )

set( CMAKE_CXX_STANDARD 14 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF )

if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
set( CMAKE_CXX_EXTENSIONS ON ) # for __int128 support
else( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
set( CMAKE_CXX_EXTENSIONS OFF )
endif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )

# http://stackoverflow.com/a/18369825
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
Expand All @@ -26,6 +31,87 @@ endif()

list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )

include(CheckCCompilerFlag)
include(Utils)

# function to help with cUrl
macro(FIND_CURL)
if (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
set (OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set (CMAKE_FIND_LIBRARY_SUFFIXES .a)
find_package(CURL REQUIRED)
list(APPEND CURL_LIBRARIES ssl crypto)
set (CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_SUFFIXES})
else (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
find_package(CURL REQUIRED)
endif (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
endmacro()

# Fortify source
if (CMAKE_COMPILER_IS_GNUCXX)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message ("-- Setting optimizations for clang++")
set(CMAKE_CXX_FLAGS_RELEASE "-D_FORTIFY_SOURCE=2 -O3 -DNDEBUG=1")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-D_FORTIFY_SOURCE=2 -O3 -DNDEBUG=1 -g")

# check and add data execution prevention
message ("-- Enabling data execution prevention")
add_linker_flag("-fsanitize=safe-stack")

# check and add Stack-based buffer overrun detection
set(CMAKE_REQUIRED_FLAGS "-fstack-protector")
check_c_compiler_flag("" HAVE_STACKPROTECTOR)
if(HAVE_STACKPROTECTOR)
message ("-- Enabling stack-based buffer overrun detection")
add_flag_append(CMAKE_C_FLAGS "-fstack-protector")
add_flag_append(CMAKE_CXX_FLAGS "-fstack-protector")
endif()
else ()
message ("-- Setting optimizations for g++")
set(CMAKE_CXX_FLAGS_RELEASE "-D_FORTIFY_SOURCE=2 -O3 -DNDEBUG=1")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-D_FORTIFY_SOURCE=2 -O3 -DNDEBUG=1 -g")

# check and add data execution prevention
set(CMAKE_REQUIRED_FLAGS "-Wl,-znoexecstack")
check_c_compiler_flag("" HAVE_NOEXECSTACK)
if(HAVE_NOEXECSTACK)
message ("-- Enabling data execution prevention")
add_linker_flag("-znoexecstack")
endif()

# check and add Stack-based buffer overrun detection
set(CMAKE_REQUIRED_FLAGS "-fstack-protector-strong")
check_c_compiler_flag("" HAVE_STACKPROTECTOR)
if(HAVE_STACKPROTECTOR)
message ("-- Enabling stack-based buffer overrun detection")
add_flag_append(CMAKE_C_FLAGS "-fstack-protector-strong")
add_flag_append(CMAKE_CXX_FLAGS "-fstack-protector-strong")
endif()

endif ()
endif ()

# check for Data relocation and Protection (RELRO)
set(CMAKE_REQUIRED_FLAGS "-Wl,-zrelro,-znow")
check_c_compiler_flag("" HAVE_RELROFULL)
if(HAVE_RELROFULL)
message ("-- Enabling full data relocation and protection")
add_linker_flag("-zrelro")
add_linker_flag("-znow")
else()
#if full relro is not available, try partial relro
set(CMAKE_REQUIRED_FLAGS "-Wl,-zrelro")
check_c_compiler_flag("" HAVE_RELROPARTIAL)
if(HAVE_RELROPARTIAL)
message ("-- Enabling partial data relocation and protection")
add_linker_flag("-zrelro")
endif()
endif()

# position independent executetable (PIE)
# position independent code (PIC)
add_definitions (-fPIC)

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
set(GRAPHENE_EGENESIS_JSON "${CMAKE_CURRENT_SOURCE_DIR}/libraries/egenesis/genesis.json" )

Expand Down
13 changes: 13 additions & 0 deletions CMakeModules/Utils.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
macro(add_flag_append _VAR_NAME _FLAG)
set(${_VAR_NAME} "${${_VAR_NAME}} ${_FLAG}")
endmacro(add_flag_append _VAR_NAME _FLAG)

macro(add_linker_flag _FLAG)
#executables
add_flag_append(CMAKE_C_LINK_FLAGS "-Wl,${_FLAG}")
add_flag_append(CMAKE_CXX_LINK_FLAGS "-Wl,${_FLAG}")
#libraries
add_flag_append(CMAKE_SHARED_LIBRARY_C_FLAGS "-Wl,${_FLAG}")
add_flag_append(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Wl,${_FLAG}")
endmacro(add_linker_flag _FLAG)

10 changes: 5 additions & 5 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Bitshares-Core"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "3.0.1"
PROJECT_NUMBER = "3.3.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down Expand Up @@ -758,7 +758,7 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.

INPUT = README.md doc/main.dox libraries/chain libraries/chain/db libraries/app libraries/wallet
INPUT = README.md doc/main.dox libraries/chain libraries/db libraries/app libraries/wallet libraries/protocol libraries/net libraries/plugins libraries/fc libraries/utilities libraries/egenesis

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand All @@ -778,7 +778,7 @@ INPUT_ENCODING = UTF-8
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.

FILE_PATTERNS =
FILE_PATTERNS = *.cpp *.hpp *.hxx

# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
Expand All @@ -793,7 +793,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE =
EXCLUDE = libraries/fc/vendor/editline libraries/fc/vendor/secp256k1-zkp libraries/fc/vendor/websocketpp

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand All @@ -820,7 +820,7 @@ EXCLUDE_PATTERNS =
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*

EXCLUDE_SYMBOLS =
EXCLUDE_SYMBOLS = boost

# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
Expand Down
3 changes: 2 additions & 1 deletion libraries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ Code in libraries is the most important part of **bitshares-core** project and i
Folder | Name | Description | Status
---|---|---|---
[app](app) | Application | Bundles component libraries (chain, network, plugins) into a useful application. Also provides API access. | Active
[chain](chain) | Blockchain | Defines all objects, operations and types. This include the consensus protocol, defines the whole blockchain behaviour. | Active
[chain](chain) | Blockchain | Blockchain implementation and business logic. Database structure in the form of objects and updates to the blockchain in the form of evaluators are implemented here. | Active
[db](db) | Database | Defines the internal database graphene uses. | Active
[egenesis](egenesis) | Genesis | Hardcodes the `genesis.json` file into the `witness_node` executable.| Active
[fc](fc) | Fast-compiling C++ library | https://github.com/bitshares/bitshares-fc | Active
[net](net) | Network | The graphene p2p layer. | Active
[plugins](plugins) | Plugins | Collection of singleton designed modules used for extending the bitshares-core. | Active
[protocol](protocol) | Protocol | Fundamental structure of the data that will be transmitted on the wire. Operations are defined and basic data integrity checks are done for each. | Active
[utilities](utilities) | Utilities | Common utility calls used in applications or other libraries. | Active
[wallet](wallet) | Wallet | Wallet definition for the `cli_wallet` software. | Active
6 changes: 5 additions & 1 deletion libraries/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ file(GLOB EGENESIS_HEADERS "../egenesis/include/graphene/app/*.hpp")

add_library( graphene_app
api.cpp
api_objects.cpp
application.cpp
util.cpp
database_api.cpp
Expand All @@ -13,7 +14,10 @@ add_library( graphene_app
)

# need to link graphene_debug_witness because plugins aren't sufficiently isolated #246
target_link_libraries( graphene_app graphene_market_history graphene_account_history graphene_grouped_orders graphene_chain fc graphene_db graphene_net graphene_utilities graphene_debug_witness )
target_link_libraries( graphene_app
graphene_market_history graphene_account_history graphene_elasticsearch graphene_grouped_orders
graphene_api_helper_indexes
graphene_chain fc graphene_db graphene_net graphene_utilities graphene_debug_witness )
target_include_directories( graphene_app
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}/../egenesis/include" )
Expand Down
15 changes: 14 additions & 1 deletion libraries/app/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <graphene/chain/withdraw_permission_object.hpp>
#include <graphene/chain/worker_object.hpp>

#include <fc/crypto/base64.hpp>
#include <fc/crypto/hex.hpp>
#include <fc/rpc/api_connection.hpp>
#include <fc/thread/future.hpp>
Expand Down Expand Up @@ -180,7 +181,7 @@ namespace graphene { namespace app {

fc::variant network_broadcast_api::broadcast_transaction_synchronous(const precomputable_transaction& trx)
{
fc::promise<fc::variant>::ptr prom( new fc::promise<fc::variant>() );
fc::promise<fc::variant>::ptr prom = fc::promise<fc::variant>::create();
broadcast_transaction_with_callback( [prom]( const fc::variant& v ){
prom->set_value(v);
}, trx );
Expand Down Expand Up @@ -340,6 +341,18 @@ namespace graphene { namespace app {
start = node.operation_id;
} catch(...) { return result; }

if(_app.is_plugin_enabled("elasticsearch")) {
auto es = _app.get_plugin<elasticsearch::elasticsearch_plugin>("elasticsearch");
if(es.get()->get_running_mode() != elasticsearch::mode::only_save) {
if(!_app.elasticsearch_thread)
_app.elasticsearch_thread= std::make_shared<fc::thread>("elasticsearch");

return _app.elasticsearch_thread->async([&es, &account, &stop, &limit, &start]() {
return es->get_account_history(account, stop, limit, start);
}, "thread invoke for method " BOOST_PP_STRINGIZE(method_name)).wait();
}
}

const auto& hist_idx = db.get_index_type<account_transaction_history_index>();
const auto& by_op_idx = hist_idx.indices().get<by_op>();
auto index_start = by_op_idx.begin();
Expand Down
91 changes: 91 additions & 0 deletions libraries/app/api_objects.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
* Copyright (c) 2017 Cryptonomex, Inc., and contributors.
*
* The MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include <graphene/app/api_objects.hpp>
#include <graphene/app/util.hpp>

namespace graphene { namespace app {

market_ticker::market_ticker(const market_ticker_object& mto,
const fc::time_point_sec& now,
const asset_object& asset_base,
const asset_object& asset_quote,
const order_book& orders)
{
time = now;
base = asset_base.symbol;
quote = asset_quote.symbol;
percent_change = "0";
lowest_ask = "0";
highest_bid = "0";

fc::uint128_t bv;
fc::uint128_t qv;
price latest_price = asset( mto.latest_base, mto.base ) / asset( mto.latest_quote, mto.quote );
if( mto.base != asset_base.id )
latest_price = ~latest_price;
latest = price_to_string( latest_price, asset_base, asset_quote );
if( mto.last_day_base != 0 && mto.last_day_quote != 0 // has trade data before 24 hours
&& ( mto.last_day_base != mto.latest_base || mto.last_day_quote != mto.latest_quote ) ) // price changed
{
price last_day_price = asset( mto.last_day_base, mto.base ) / asset( mto.last_day_quote, mto.quote );
if( mto.base != asset_base.id )
last_day_price = ~last_day_price;
percent_change = price_diff_percent_string( last_day_price, latest_price );
}
if( asset_base.id == mto.base )
{
bv = mto.base_volume;
qv = mto.quote_volume;
}
else
{
bv = mto.quote_volume;
qv = mto.base_volume;
}
base_volume = uint128_amount_to_string( bv, asset_base.precision );
quote_volume = uint128_amount_to_string( qv, asset_quote.precision );

if(!orders.asks.empty())
lowest_ask = orders.asks[0].price;
if(!orders.bids.empty())
highest_bid = orders.bids[0].price;
}

market_ticker::market_ticker(const fc::time_point_sec& now,
const asset_object& asset_base,
const asset_object& asset_quote)
{
time = now;
base = asset_base.symbol;
quote = asset_quote.symbol;
latest = "0";
lowest_ask = "0";
highest_bid = "0";
percent_change = "0";
base_volume = "0";
quote_volume = "0";
}

} } // graphene::app
Loading