BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface software
Classes | Namespaces | Macros | Functions
node.cpp File Reference
#include <sstream>
#include <iomanip>
#include <deque>
#include <unordered_set>
#include <list>
#include <forward_list>
#include <iostream>
#include <algorithm>
#include <tuple>
#include <string>
#include <boost/tuple/tuple.hpp>
#include <boost/circular_buffer.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/mem_fun.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/random_access_index.hpp>
#include <boost/multi_index/tag.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/logic/tribool.hpp>
#include <boost/range/algorithm_ext/push_back.hpp>
#include <boost/range/algorithm/find.hpp>
#include <boost/range/numeric.hpp>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/rolling_mean.hpp>
#include <boost/accumulators/statistics/min.hpp>
#include <boost/accumulators/statistics/max.hpp>
#include <boost/accumulators/statistics/sum.hpp>
#include <boost/accumulators/statistics/count.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <fc/thread/thread.hpp>
#include <fc/thread/future.hpp>
#include <fc/thread/non_preemptable_scope_check.hpp>
#include <fc/thread/mutex.hpp>
#include <fc/thread/scoped_lock.hpp>
#include <fc/log/logger.hpp>
#include <fc/io/json.hpp>
#include <fc/io/enum_type.hpp>
#include <fc/io/raw.hpp>
#include <fc/crypto/rand.hpp>
#include <fc/network/rate_limiting.hpp>
#include <fc/network/ip.hpp>
#include <fc/network/resolve.hpp>
#include <graphene/net/node.hpp>
#include <graphene/net/peer_database.hpp>
#include <graphene/net/peer_connection.hpp>
#include <graphene/net/stcp_socket.hpp>
#include <graphene/net/config.hpp>
#include <graphene/net/exceptions.hpp>
#include <graphene/chain/config.hpp>
#include <graphene/chain/exceptions.hpp>
#include <graphene/protocol/fee_schedule.hpp>
#include <fc/git_revision.hpp>
#include "node_impl.hxx"

Go to the source code of this file.

Classes

class  graphene::net::detail::blockchain_tied_message_cache
 
struct  graphene::net::detail::node_configuration
 
struct  graphene::net::simulated_network::node_info
 

Namespaces

 graphene
 
 graphene::net
 
 graphene::net::detail
 

Macros

#define DEFAULT_LOGGER   "p2p"
 
#define P2P_IN_DEDICATED_THREAD   1
 
#define INVOCATION_COUNTER(name)
 
#define testnetlog(...)   do {} while (0)
 
#define VERIFY_CORRECT_THREAD()   assert(_thread->is_current())
 
#define MAXIMUM_NUMBER_OF_BLOCKS_TO_HANDLE_AT_ONE_TIME   200
 
#define MAXIMUM_NUMBER_OF_BLOCKS_TO_PREFETCH   (10 * MAXIMUM_NUMBER_OF_BLOCKS_TO_HANDLE_AT_ONE_TIME)
 
#define INVOKE_IN_IMPL(method_name, ...)   return my->_thread->async([&](){ return my->method_name(__VA_ARGS__); }, "thread invoke for method " BOOST_PP_STRINGIZE(method_name)).wait()
 
#define ROLLING_WINDOW_SIZE   1000
 
#define INITIALIZE_ACCUMULATOR(r, data, method_name)
 
#define ADD_STATISTICS_FOR_METHOD(r, data, method_name)
 
#define INVOKE_AND_COLLECT_STATISTICS(method_name, ...)
 

Functions

() accept_incoming_connections() wait_if_endpoint_is_busy (private_key))
 

Macro Definition Documentation

#define ADD_STATISTICS_FOR_METHOD (   r,
  data,
  method_name 
)
Value:
fc::mutable_variant_object BOOST_PP_CAT(method_name, _stats); \
BOOST_PP_CAT(method_name, _stats)["min"] = boost::accumulators::min(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _execution_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["mean"] = boost::accumulators::rolling_mean(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _execution_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["max"] = boost::accumulators::max(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _execution_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["sum"] = boost::accumulators::sum(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _execution_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["delay_before_min"] = boost::accumulators::min(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_before_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["delay_before_mean"] = boost::accumulators::rolling_mean(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_before_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["delay_before_max"] = boost::accumulators::max(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_before_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["delay_before_sum"] = boost::accumulators::sum(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_before_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["delay_after_min"] = boost::accumulators::min(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_after_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["delay_after_mean"] = boost::accumulators::rolling_mean(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_after_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["delay_after_max"] = boost::accumulators::max(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_after_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["delay_after_sum"] = boost::accumulators::sum(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_after_accumulator))); \
BOOST_PP_CAT(method_name, _stats)["count"] = boost::accumulators::count(BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _execution_accumulator))); \
statistics[BOOST_PP_STRINGIZE(method_name)] = BOOST_PP_CAT(method_name, _stats);
An order-perserving dictionary of variant&#39;s.
#define DEFAULT_LOGGER   "p2p"

Definition at line 97 of file node.cpp.

#define INITIALIZE_ACCUMULATOR (   r,
  data,
  method_name 
)
Value:
, BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _execution_accumulator))(boost::accumulators::tag::rolling_window::window_size = ROLLING_WINDOW_SIZE) \
, BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_before_accumulator))(boost::accumulators::tag::rolling_window::window_size = ROLLING_WINDOW_SIZE) \
, BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_after_accumulator))(boost::accumulators::tag::rolling_window::window_size = ROLLING_WINDOW_SIZE)
#define ROLLING_WINDOW_SIZE
Definition: node.cpp:5103

Definition at line 5104 of file node.cpp.

#define INVOCATION_COUNTER (   name)
Value:
static unsigned total_ ## name ## _counter = 0; \
static unsigned active_ ## name ## _counter = 0; \
struct name ## _invocation_logger { \
unsigned *total; \
unsigned *active; \
name ## _invocation_logger(unsigned *total, unsigned *active) : \
total(total), active(active) \
{ \
++*total; \
++*active; \
dlog("NEWDEBUG: Entering " #name ", now ${total} total calls, ${active} active calls", ("total", *total)("active", *active)); \
} \
~name ## _invocation_logger() \
{ \
--*active; \
dlog("NEWDEBUG: Leaving " #name ", now ${total} total calls, ${active} active calls", ("total", *total)("active", *active)); \
} \
} invocation_logger(&total_ ## name ## _counter, &active_ ## name ## _counter)
#define dlog(FORMAT,...)
Definition: logger.hpp:100

Definition at line 101 of file node.cpp.

#define INVOKE_AND_COLLECT_STATISTICS (   method_name,
  ... 
)
Value:
std::shared_ptr<call_statistics_collector> statistics_collector = std::make_shared<call_statistics_collector>( \
#method_name, \
&_ ## method_name ## _execution_accumulator, \
&_ ## method_name ## _delay_before_accumulator, \
&_ ## method_name ## _delay_after_accumulator); \
if (_thread->is_current()) \
{ \
call_statistics_collector::actual_execution_measurement_helper helper(statistics_collector); \
return _node_delegate->method_name(__VA_ARGS__); \
} \
else \
return _thread->async([&, statistics_collector](){ \
call_statistics_collector::actual_execution_measurement_helper helper(statistics_collector); \
return _node_delegate->method_name(__VA_ARGS__); \
}, "invoke " BOOST_STRINGIZE(method_name)).wait()

Definition at line 5185 of file node.cpp.

#define INVOKE_IN_IMPL (   method_name,
  ... 
)    return my->_thread->async([&](){ return my->method_name(__VA_ARGS__); }, "thread invoke for method " BOOST_PP_STRINGIZE(method_name)).wait()

Definition at line 4881 of file node.cpp.

#define MAXIMUM_NUMBER_OF_BLOCKS_TO_HANDLE_AT_ONE_TIME   200

Definition at line 287 of file node.cpp.

#define MAXIMUM_NUMBER_OF_BLOCKS_TO_PREFETCH   (10 * MAXIMUM_NUMBER_OF_BLOCKS_TO_HANDLE_AT_ONE_TIME)

Definition at line 288 of file node.cpp.

#define P2P_IN_DEDICATED_THREAD   1

Definition at line 99 of file node.cpp.

#define ROLLING_WINDOW_SIZE   1000

Definition at line 5103 of file node.cpp.

#define testnetlog (   ...)    do {} while (0)

Definition at line 125 of file node.cpp.

#define VERIFY_CORRECT_THREAD ( )    assert(_thread->is_current())

Definition at line 282 of file node.cpp.

Function Documentation

() accept_incoming_connections() wait_if_endpoint_is_busy ( private_key  )