Skip to content

Commit

Permalink
Merge pull request #1270 from steemit/steem-prerelease-0.19.1
Browse files Browse the repository at this point in the history
Steem 0.19.1
  • Loading branch information
Michael Vandeberg authored Jul 21, 2017
2 parents 1ad862e + e0839e2 commit 88d9098
Show file tree
Hide file tree
Showing 63 changed files with 996 additions and 562 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Defines Steem library target.
project( Steem )
cmake_minimum_required( VERSION 2.8.12 )
cmake_minimum_required( VERSION 3.2 )

set( BLOCKCHAIN_NAME "Steem" )

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RUN \
pkg-config \
python3 \
python3-dev \
python3-jinja2 \
python3-pip \
nginx \
fcgiwrap \
Expand Down
4 changes: 4 additions & 0 deletions contrib/config-for-docker.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# this will need to increase depending on which plugins/apis you use
# 16 GB should be sufficient for a consensus node
shared-file-size = 16G

# Endpoint for P2P node to listen on
# p2p-endpoint =

Expand Down
30 changes: 16 additions & 14 deletions contrib/fullnode.config.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set larger shared-file-size than default
shared-file-size = 50G
shared-file-size = 48G

# Set an API to be publicly available, may be specified multiple times
public-api = database_api login_api account_by_key_api network_broadcast_api tag_api follow_api market_history_api raw_block_api
Expand All @@ -11,16 +11,18 @@ enable-plugin = witness account_history account_by_key tags follow market_histor
bcd-trigger = [[0,10],[85,300]]

# Defines a range of accounts to track as a json pair ["from","to"] [from,to]
# track-account-range =
# track-account-range =

history-whitelist-ops = transfer_operation transfer_to_vesting_operation withdraw_vesting_operation interest_operation transfer_to_savings_operation transfer_from_savings_operation cancel_transfer_from_savings_operation escrow_transfer_operation escrow_approve_operation escrow_dispute_operation escrow_release_operation fill_convert_request_operation fill_order_operation claim_reward_balance_operation author_reward_operation curation_reward_operation fill_vesting_withdraw_operation fill_transfer_from_savings_operation delegate_vesting_shares_operation return_vesting_delegation_operation comment_benefactor_reward_operation

# Ignore posting operations, only track transfers and account updates
# filter-posting-ops =
# filter-posting-ops =

# Database edits to apply on startup (may specify multiple times)
# edit-script =
# edit-script =

# RPC endpoint of a trusted validating node (required)
# trusted-node =
# trusted-node =


# Set the maximum size of cached feed for an account
Expand All @@ -33,7 +35,7 @@ bucket-size = [15,60,300,3600,86400]
history-per-size = 5760

# Defines a range of accounts to private messages to/from as a json pair ["from","to"] [from,to)
# pm-account-range =
# pm-account-range =

# Enable block production, even if the chain is stale.
enable-stale-production = false
Expand All @@ -42,25 +44,25 @@ enable-stale-production = false
required-participation = false

# name of witness controlled by this node (e.g. initwitness )
# witness =
# witness =

# name of miner and its private key (e.g. ["account","WIF PRIVATE KEY"] )
# miner =
# miner =

# Number of threads to use for proof of work mining
# mining-threads =
# mining-threads =

# WIF PRIVATE KEY to be used by one or more witnesses or miners
# private-key =
# private-key =

# Account creation fee to be voted on upon successful POW - Minimum fee is 100.000 STEEM (written as 100000)
# miner-account-creation-fee =
# miner-account-creation-fee =

# Maximum block size (in bytes) to be voted on upon successful POW - Max block size must be between 128 KB and 750 MB
# miner-maximum-block-size =
# miner-maximum-block-size =

# SBD interest rate to be vote on upon successful POW - Default interest rate is 10% (written as 1000)
# miner-sbd-interest-rate =
# miner-sbd-interest-rate =

# declare an appender named "stderr" that writes messages to the console
[log.console_appender.stderr]
Expand All @@ -74,7 +76,7 @@ filename=logs/p2p/p2p.log
# route any messages logged to the default logger to the "stderr" logger we
# declared above, if they are info level are higher
[logger.default]
level=info
level=debug
appenders=stderr

# route messages sent to the "p2p" logger to stderr too
Expand Down
6 changes: 3 additions & 3 deletions contrib/steemd.run
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi

# if user did pass in desired seed nodes, use
# the ones the user specified:
if [[ ! -z "$STEEMD_SEED_NODES" ]]; then
if [[ ! -z "$STEEMD_SEED_NODES" ]]; then
for NODE in $STEEMD_SEED_NODES ; do
ARGS+=" --seed-node=$NODE"
done
Expand All @@ -47,9 +47,9 @@ fi

if [[ ! -z "$TRACK_ACCOUNT" ]]; then
if [[ ! "$USE_WAY_TOO_MUCH_RAM" ]]; then
ARGS+=" --enable-plugin=witness account_history"
ARGS+=" --enable-plugin=account_history"
fi
ARGS+=" --track-account-range=[\"$TRACK_ACCOUNT\",\"$TRACK_ACCOUNT\"]"
ARGS+=" --track-account-range=[\"$TRACK_ACCOUNT\",\"$TRACK_ACCOUNT\"]"
fi

NOW=`date +%s`
Expand Down
22 changes: 13 additions & 9 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Builds steem for use in a private testnet. Also required for building unit tests

### SKIP_BY_TX_ID=[OFF/ON]

The account history plugin does not allow querying of operations by transaction id.
This requires around 65% of CPU time when reindexing so disabling the index is a
By default this is off. Enabling will prevent the account history plugin querying transactions
by id, but saving around 65% of CPU time when reindexing. Enabling this option is a
huge gain if you do not need this functionality.

## Building under Docker
Expand All @@ -51,7 +51,9 @@ will build out of the box without further effort:
libssl-dev \
libtool \
make \
pkg-config
pkg-config \
python3 \
python3-jinja2

# Boost packages (also required)
sudo apt-get install -y \
Expand Down Expand Up @@ -96,7 +98,7 @@ Here are the required packages:
# Required packages
sudo apt-get install -y \
autoconf \
cmake \
cmake3 \
g++ \
git \
libssl-dev \
Expand All @@ -108,7 +110,9 @@ Here are the required packages:
libreadline-dev \
libbz2-dev \
python-dev \
perl
perl \
python3 \
python3-jinja2

The Boost provided in the Ubuntu 14.04 package manager (Boost 1.55) is too old.
Steem requires Boost 1.58 (as in Ubuntu 16.04) and works with versions up to 1.60 (including).
Expand Down Expand Up @@ -162,7 +166,6 @@ Install Homebrew by following the instructions here: http://brew.sh/

brew doctor
brew update
brew tap homebrew/versions

### Install steem dependencies:

Expand All @@ -171,10 +174,11 @@ Install Homebrew by following the instructions here: http://brew.sh/
automake \
cmake \
git \
homebrew/versions/boost160 \
boost160 \
libtool \
openssl \
python3
python3 \
python3-jinja2

Note: brew recently updated to boost 1.61.0, which is not yet supported by
steem. Until then, this will allow you to install boost 1.60.0.
Expand All @@ -196,7 +200,7 @@ steem. Until then, this will allow you to install boost 1.60.0.
### Compile

export OPENSSL_ROOT_DIR=$(brew --prefix)/Cellar/openssl/1.0.2h_1/
export BOOST_ROOT=$(brew --prefix)/Cellar/boost160/1.60.0/
export BOOST_ROOT=$(brew --prefix)/Cellar/[email protected]/1.60.0/
git submodule update --init --recursive
mkdir build && cd build
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release ..
Expand Down
12 changes: 8 additions & 4 deletions doc/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,21 @@ docker run -d --env TRACK_ACCOUNT="yourexchangeid" steemit/steem

Please make sure that you have enough resources available.
Check `shared-file-size =` in your `config.ini` to reflect your needs.
Set it to at least 20% more than current size.
Set it to at least 25% more than current size.

Provided values are expected to grow significantly over time.

Blockchain data takes over **12GB** of storage space.
Blockchain data takes over **16GB** of storage space.

#### Full node
Shared memory file for full node uses over **45GB**
Shared memory file for full node uses over **65GB**

#### Exchange node
Shared memory file for exchange node users over **16GB**
(tracked history for single account)

#### Seed node
Shared memory file for seed node uses over **3GB**
Shared memory file for seed node uses over **5.5GB**

#### Other use cases
Shared memory file size varies, depends on your specific configuration but it is expected to be somewhere between "seed node" and "full node" usage.
6 changes: 0 additions & 6 deletions external_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@

# for each subdirectory containing a CMakeLists.txt, add that subdirectory
set( ENV{STEEMIT_EXTERNAL_PLUGINS} "" )
file( GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} * )
foreach( child ${children} )
if( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${child}" )
if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${child}/CMakeLists.txt" )
add_subdirectory( "${child}" )
set( ENV{STEEMIT_EXTERNAL_PLUGINS} $ENV{STEEMIT_EXTERNAL_PLUGINS} ${child} )
endif()
endif()
endforeach()

# add_subdirectory( hello_api )
# add_subdirectory( hello_arguments )
# add_subdirectory( hello_objects )
6 changes: 3 additions & 3 deletions libraries/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ namespace detail {
{
try
{
_chain_db->open(_data_dir / "blockchain", _shared_dir, 0, _shared_file_size, chainbase::database::read_write );\
_chain_db->open(_data_dir / "blockchain", _shared_dir, STEEMIT_INIT_SUPPLY, _shared_file_size, chainbase::database::read_write );\
}
catch( fc::assert_exception& )
{
Expand All @@ -314,7 +314,7 @@ namespace detail {
catch( chain::block_log_exception& )
{
wlog( "Error opening block log. Having to resync from network..." );
_chain_db->open( _data_dir / "blockchain", _shared_dir, 0, _shared_file_size, chainbase::database::read_write );
_chain_db->open( _data_dir / "blockchain", _shared_dir, STEEMIT_INIT_SUPPLY, _shared_file_size, chainbase::database::read_write );
}
}
}
Expand All @@ -328,7 +328,7 @@ namespace detail {
else
{
ilog( "Starting Steem node in read mode." );
_chain_db->open( _data_dir / "blockchain", _shared_dir, 0, _shared_file_size, chainbase::database::read_only );
_chain_db->open( _data_dir / "blockchain", _shared_dir, STEEMIT_INIT_SUPPLY, _shared_file_size, chainbase::database::read_only );

if( _options->count( "read-forward-rpc" ) )
{
Expand Down
59 changes: 3 additions & 56 deletions libraries/app/database_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ class database_api_impl : public std::enable_shared_from_this<database_api_impl>
~database_api_impl();

// Subscriptions
void set_subscribe_callback( std::function<void(const variant&)> cb, bool clear_filter );
void set_pending_transaction_callback( std::function<void(const variant&)> cb );
void set_block_applied_callback( std::function<void(const variant& block_id)> cb );
void cancel_all_subscriptions();

// Blocks and transactions
optional<block_header> get_block_header(uint32_t block_num)const;
Expand Down Expand Up @@ -77,9 +74,6 @@ class database_api_impl : public std::enable_shared_from_this<database_api_impl>
// signal handlers
void on_applied_block( const chain::signed_block& b );

mutable fc::bloom_filter _subscribe_filter;
std::function<void(const fc::variant&)> _subscribe_callback;
std::function<void(const fc::variant&)> _pending_trx_callback;
std::function<void(const fc::variant&)> _block_applied_callback;

steemit::chain::database& _db;
Expand Down Expand Up @@ -114,41 +108,6 @@ void find_accounts( set<string>& accounts, const discussion& d ) {
// //
//////////////////////////////////////////////////////////////////////

void database_api::set_subscribe_callback( std::function<void(const variant&)> cb, bool clear_filter )
{
my->_db.with_read_lock( [&]()
{
my->set_subscribe_callback( cb, clear_filter );
});
}

void database_api_impl::set_subscribe_callback( std::function<void(const variant&)> cb, bool clear_filter )
{
_subscribe_callback = cb;
if( clear_filter || !cb )
{
static fc::bloom_parameters param;
param.projected_element_count = 10000;
param.false_positive_probability = 1.0/10000;
param.maximum_size = 1024*8*8*2;
param.compute_optimal_parameters();
_subscribe_filter = fc::bloom_filter(param);
}
}

void database_api::set_pending_transaction_callback( std::function<void(const variant&)> cb )
{
my->_db.with_read_lock( [&]()
{
my->set_pending_transaction_callback( cb );
});
}

void database_api_impl::set_pending_transaction_callback( std::function<void(const variant&)> cb )
{
_pending_trx_callback = cb;
}

void database_api::set_block_applied_callback( std::function<void(const variant& block_id)> cb )
{
my->_db.with_read_lock( [&]()
Expand All @@ -175,19 +134,6 @@ void database_api_impl::set_block_applied_callback( std::function<void(const var
_block_applied_connection = connect_signal( _db.applied_block, *this, &database_api_impl::on_applied_block );
}

void database_api::cancel_all_subscriptions()
{
my->_db.with_read_lock( [&]()
{
my->cancel_all_subscriptions();
});
}

void database_api_impl::cancel_all_subscriptions()
{
set_subscribe_callback( std::function<void(const fc::variant&)>(), true);
}

//////////////////////////////////////////////////////////////////////
// //
// Constructors //
Expand Down Expand Up @@ -338,7 +284,7 @@ price database_api::get_current_median_history_price()const

dynamic_global_property_api_obj database_api_impl::get_dynamic_global_properties()const
{
return _db.get(dynamic_global_property_id_type());
return dynamic_global_property_api_obj( _db.get( dynamic_global_property_id_type() ), _db );
}

witness_schedule_api_obj database_api::get_witness_schedule()const
Expand Down Expand Up @@ -2029,6 +1975,7 @@ state database_api::get_state( string path )const
case operation::tag<witness_update_operation>::value:
case operation::tag<pow_operation>::value:
case operation::tag<custom_operation>::value:
case operation::tag<producer_reward_operation>::value:
default:
eacnt.other_history[item.first] = item.second;
}
Expand Down Expand Up @@ -2357,7 +2304,7 @@ state database_api::get_state( string path )const
annotated_signed_transaction database_api::get_transaction( transaction_id_type id )const
{
#ifdef SKIP_BY_TX_ID
return annotated_signed_transaction();
FC_ASSERT( false, "This node's operator has disabled operation indexing by transaction_id" );
#else
return my->_db.with_read_lock( [&](){
const auto& idx = my->_db.get_index<operation_index>().indices().get<by_transaction_id>();
Expand Down
7 changes: 7 additions & 0 deletions libraries/app/impacted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ struct get_impacted_account_visitor
_impacted.insert( op.benefactor );
_impacted.insert( op.author );
}

void operator()( const producer_reward_operation& op )
{
_impacted.insert( op.producer );
}

//void operator()( const operation& op ){}
};

void operation_get_impacted_accounts( const operation& op, flat_set<account_name_type>& result )
Expand Down
Loading

0 comments on commit 88d9098

Please sign in to comment.