Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ src_libbitcoin_node_la_SOURCES = \
src/protocols/protocol_block_in_31800.cpp \
src/protocols/protocol_block_out_106.cpp \
src/protocols/protocol_block_out_70012.cpp \
src/protocols/protocol_explore.cpp \
src/protocols/protocol_filter_out_70015.cpp \
src/protocols/protocol_header_in_31800.cpp \
src/protocols/protocol_header_in_70012.cpp \
Expand Down Expand Up @@ -180,6 +181,7 @@ include_bitcoin_node_protocols_HEADERS = \
include/bitcoin/node/protocols/protocol_block_in_31800.hpp \
include/bitcoin/node/protocols/protocol_block_out_106.hpp \
include/bitcoin/node/protocols/protocol_block_out_70012.hpp \
include/bitcoin/node/protocols/protocol_explore.hpp \
include/bitcoin/node/protocols/protocol_filter_out_70015.hpp \
include/bitcoin/node/protocols/protocol_header_in_31800.hpp \
include/bitcoin/node/protocols/protocol_header_in_70012.hpp \
Expand Down
1 change: 1 addition & 0 deletions builds/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ add_library( ${CANONICAL_LIB_NAME}
"../../src/protocols/protocol_block_in_31800.cpp"
"../../src/protocols/protocol_block_out_106.cpp"
"../../src/protocols/protocol_block_out_70012.cpp"
"../../src/protocols/protocol_explore.cpp"
"../../src/protocols/protocol_filter_out_70015.cpp"
"../../src/protocols/protocol_header_in_31800.cpp"
"../../src/protocols/protocol_header_in_70012.cpp"
Expand Down
2 changes: 2 additions & 0 deletions builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
<ClCompile Include="..\..\..\..\src\protocols\protocol_block_in_31800.cpp" />
<ClCompile Include="..\..\..\..\src\protocols\protocol_block_out_106.cpp" />
<ClCompile Include="..\..\..\..\src\protocols\protocol_block_out_70012.cpp" />
<ClCompile Include="..\..\..\..\src\protocols\protocol_explore.cpp" />
<ClCompile Include="..\..\..\..\src\protocols\protocol_filter_out_70015.cpp" />
<ClCompile Include="..\..\..\..\src\protocols\protocol_header_in_31800.cpp" />
<ClCompile Include="..\..\..\..\src\protocols\protocol_header_in_70012.cpp" />
Expand Down Expand Up @@ -187,6 +188,7 @@
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_block_in_31800.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_block_out_106.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_block_out_70012.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_explore.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_filter_out_70015.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_header_in_31800.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_header_in_70012.hpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
<ClCompile Include="..\..\..\..\src\protocols\protocol_block_out_70012.cpp">
<Filter>src\protocols</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\protocols\protocol_explore.cpp">
<Filter>src\protocols</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\protocols\protocol_filter_out_70015.cpp">
<Filter>src\protocols</Filter>
</ClCompile>
Expand Down Expand Up @@ -242,6 +245,9 @@
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_block_out_70012.hpp">
<Filter>include\bitcoin\node\protocols</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_explore.hpp">
<Filter>include\bitcoin\node\protocols</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_filter_out_70015.hpp">
<Filter>include\bitcoin\node\protocols</Filter>
</ClInclude>
Expand Down
1 change: 1 addition & 0 deletions include/bitcoin/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <bitcoin/node/protocols/protocol_block_in_31800.hpp>
#include <bitcoin/node/protocols/protocol_block_out_106.hpp>
#include <bitcoin/node/protocols/protocol_block_out_70012.hpp>
#include <bitcoin/node/protocols/protocol_explore.hpp>
#include <bitcoin/node/protocols/protocol_filter_out_70015.hpp>
#include <bitcoin/node/protocols/protocol_header_in_31800.hpp>
#include <bitcoin/node/protocols/protocol_header_in_70012.hpp>
Expand Down
11 changes: 5 additions & 6 deletions include/bitcoin/node/define.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ using type_id = network::messages::peer::inventory_item::type_id;
// settings : define
// configuration : define settings
// parser : define configuration
// /chasers : define configuration [forward: full_node]
// /chasers : define configuration [forward: full_node]
// full_node : define /chasers
// session : define full_node
// /protocols : define session

// Session is only included by full_node.cpp (avoids cycle).
// /sessions : define full_node /protocols
// attach : define session [forward: full_node]
// session : define [forward: full_node]
// /sessions : define attach /protocols [forward: full_node]
// /protocols : define session
4 changes: 3 additions & 1 deletion include/bitcoin/node/full_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <bitcoin/node/chasers/chasers.hpp>
#include <bitcoin/node/configuration.hpp>
#include <bitcoin/node/define.hpp>
////#include <bitcoin/node/protocols/protocols.hpp>
////#include <bitcoin/node/sessions/sessions.hpp>

namespace libbitcoin {
namespace node {
Expand All @@ -40,9 +42,9 @@ class BCN_API full_node
: public network::net
{
public:
using memory_controller = block_memory;
using store = node::store;
using query = node::query;
using memory_controller = block_memory;
typedef std::shared_ptr<full_node> ptr;

/// Constructors.
Expand Down
5 changes: 1 addition & 4 deletions include/bitcoin/node/protocols/protocol_block_in_106.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@ class BCN_API protocol_block_in_106
public:
typedef std::shared_ptr<protocol_block_in_106> ptr;

BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
template <typename SessionPtr>
protocol_block_in_106(const SessionPtr& session,
protocol_block_in_106(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: node::protocol(session, channel),
block_type_(session->config().network.witness_node() ?
type_id::witness_block : type_id::block),
network::tracker<protocol_block_in_106>(session->log)
{
}
BC_POP_WARNING()

/// Start/stop protocol (strand required).
void start() NOEXCEPT override;
Expand Down
5 changes: 1 addition & 4 deletions include/bitcoin/node/protocols/protocol_block_in_31800.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ class BCN_API protocol_block_in_31800
public:
typedef std::shared_ptr<protocol_block_in_31800> ptr;

BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
template <typename SessionPtr>
protocol_block_in_31800(const SessionPtr& session,
protocol_block_in_31800(const auto& session,
const network::channel::ptr& channel, bool performance_enabled=true) NOEXCEPT
: protocol_performer(session, channel, performance_enabled),
top_checkpoint_height_(
Expand All @@ -48,7 +46,6 @@ class BCN_API protocol_block_in_31800
network::tracker<protocol_block_in_31800>(session->log)
{
}
BC_POP_WARNING()

/// Start/stop protocol (strand required).
void start() NOEXCEPT override;
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/node/protocols/protocol_block_out_106.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class BCN_API protocol_block_out_106
public:
typedef std::shared_ptr<protocol_block_out_106> ptr;

template <typename SessionPtr>
protocol_block_out_106(const SessionPtr& session,
protocol_block_out_106(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: node::protocol(session, channel),
node_witness_(session->config().network.witness_node()),
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/node/protocols/protocol_block_out_70012.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class BCN_API protocol_block_out_70012
public:
typedef std::shared_ptr<protocol_block_out_70012> ptr;

template <typename SessionPtr>
protocol_block_out_70012(const SessionPtr& session,
protocol_block_out_70012(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: protocol_block_out_106(session, channel),
network::tracker<protocol_block_out_70012>(session->log)
Expand Down
60 changes: 60 additions & 0 deletions include/bitcoin/node/protocols/protocol_explore.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_EXPLORE_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_EXPLORE_HPP

#include <memory>
#include <bitcoin/network.hpp>
#include <bitcoin/node/define.hpp>
#include <bitcoin/node/protocols/protocol.hpp>

namespace libbitcoin {
namespace node {

class BCN_API protocol_explore
: public network::protocol_html,
protected network::tracker<protocol_explore>
{
public:
typedef std::shared_ptr<protocol_explore> ptr;
using options_t = network::settings::html_server;
using channel_t = network::channel_http;

protocol_explore(const auto& session,
const network::channel::ptr& channel,
const options_t& options) NOEXCEPT
: network::protocol_html(session, channel, options),
////options_(options),
network::tracker<protocol_explore>(session->log)
{
}

protected:
void handle_receive_get(const code& ec,
const network::http::method::get& request) NOEXCEPT override;

private:
// This is thread safe.
////const options_t& options_;
};

} // namespace node
} // namespace libbitcoin

#endif
3 changes: 1 addition & 2 deletions include/bitcoin/node/protocols/protocol_filter_out_70015.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class BCN_API protocol_filter_out_70015
public:
typedef std::shared_ptr<protocol_filter_out_70015> ptr;

template <typename SessionPtr>
protocol_filter_out_70015(const SessionPtr& session,
protocol_filter_out_70015(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: node::protocol(session, channel),
network::tracker<protocol_filter_out_70015>(session->log)
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/node/protocols/protocol_header_in_31800.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class BCN_API protocol_header_in_31800
public:
typedef std::shared_ptr<protocol_header_in_31800> ptr;

template <typename SessionPtr>
protocol_header_in_31800(const SessionPtr& session,
protocol_header_in_31800(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: node::protocol(session, channel),
network::tracker<protocol_header_in_31800>(session->log)
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/node/protocols/protocol_header_in_70012.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class BCN_API protocol_header_in_70012
public:
typedef std::shared_ptr<protocol_header_in_70012> ptr;

template <typename SessionPtr>
protocol_header_in_70012(const SessionPtr& session,
protocol_header_in_70012(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: node::protocol_header_in_31800(session, channel),
network::tracker<protocol_header_in_70012>(session->log)
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/node/protocols/protocol_header_out_31800.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class BCN_API protocol_header_out_31800
public:
typedef std::shared_ptr<protocol_header_out_31800> ptr;

template <typename SessionPtr>
protocol_header_out_31800(const SessionPtr& session,
protocol_header_out_31800(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: node::protocol(session, channel),
network::tracker<protocol_header_out_31800>(session->log)
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/node/protocols/protocol_header_out_70012.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class BCN_API protocol_header_out_70012
public:
typedef std::shared_ptr<protocol_header_out_70012> ptr;

template <typename SessionPtr>
protocol_header_out_70012(const SessionPtr& session,
protocol_header_out_70012(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: node::protocol_header_out_31800(session, channel),
network::tracker<protocol_header_out_70012>(session->log)
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/node/protocols/protocol_observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class BCN_API protocol_observer

// TODO: consider relay may be dynamic (disallowed until current).
// TODO: current network handshake sets relay based on config only.
template <typename SessionPtr>
protocol_observer(const SessionPtr& session,
protocol_observer(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: node::protocol(session, channel),
relay_disallowed_
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/node/protocols/protocol_performer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ class BCN_API protocol_performer
virtual void count(size_t bytes) NOEXCEPT;

protected:
template <typename SessionPtr>
protocol_performer(const SessionPtr& session,
protocol_performer(const auto& session,
const network::channel::ptr& channel, bool enabled) NOEXCEPT
: node::protocol(session, channel),
deviation_(session->config().node.allowed_deviation > 0.0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class BCN_API protocol_transaction_in_106
public:
typedef std::shared_ptr<protocol_transaction_in_106> ptr;

template <typename SessionPtr>
protocol_transaction_in_106(const SessionPtr& session,
protocol_transaction_in_106(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: node::protocol(session, channel),
////tx_type_(session->config().network.witness_node() ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class BCN_API protocol_transaction_out_106
public:
typedef std::shared_ptr<protocol_transaction_out_106> ptr;

template <typename SessionPtr>
protocol_transaction_out_106(const SessionPtr& session,
protocol_transaction_out_106(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: node::protocol(session, channel),
node_witness_(session->config().network.witness_node()),
Expand Down
1 change: 1 addition & 0 deletions include/bitcoin/node/protocols/protocols.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <bitcoin/node/protocols/protocol_block_in_31800.hpp>
#include <bitcoin/node/protocols/protocol_block_out_106.hpp>
#include <bitcoin/node/protocols/protocol_block_out_70012.hpp>
#include <bitcoin/node/protocols/protocol_explore.hpp>
#include <bitcoin/node/protocols/protocol_filter_out_70015.hpp>
#include <bitcoin/node/protocols/protocol_header_in_31800.hpp>
#include <bitcoin/node/protocols/protocol_header_in_70012.hpp>
Expand Down
Loading
Loading