diff --git a/Makefile.am b/Makefile.am
index 5440051e2..c7a80c23d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -64,6 +64,7 @@ src_libbitcoin_node_la_SOURCES = \
src/protocols/protocol_header_in_70012.cpp \
src/protocols/protocol_header_out_31800.cpp \
src/protocols/protocol_header_out_70012.cpp \
+ src/protocols/protocol_html.cpp \
src/protocols/protocol_observer.cpp \
src/protocols/protocol_peer.cpp \
src/protocols/protocol_performer.cpp \
diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt
index 766aa1613..bc188e1e4 100644
--- a/builds/cmake/CMakeLists.txt
+++ b/builds/cmake/CMakeLists.txt
@@ -276,6 +276,7 @@ add_library( ${CANONICAL_LIB_NAME}
"../../src/protocols/protocol_header_in_70012.cpp"
"../../src/protocols/protocol_header_out_31800.cpp"
"../../src/protocols/protocol_header_out_70012.cpp"
+ "../../src/protocols/protocol_html.cpp"
"../../src/protocols/protocol_observer.cpp"
"../../src/protocols/protocol_peer.cpp"
"../../src/protocols/protocol_performer.cpp"
diff --git a/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj b/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj
index 6ebad56b5..b2a222665 100644
--- a/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj
+++ b/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj
@@ -149,6 +149,7 @@
+
diff --git a/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj.filters b/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj.filters
index 500acd61a..a5623ca7f 100644
--- a/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj.filters
+++ b/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj.filters
@@ -138,6 +138,9 @@
src\protocols
+
+ src\protocols
+
src\protocols
diff --git a/include/bitcoin/node/block_arena.hpp b/include/bitcoin/node/block_arena.hpp
index f125f268f..769637d9b 100644
--- a/include/bitcoin/node/block_arena.hpp
+++ b/include/bitcoin/node/block_arena.hpp
@@ -19,7 +19,6 @@
#ifndef LIBBITCOIN_NODE_BLOCK_ARENA_HPP
#define LIBBITCOIN_NODE_BLOCK_ARENA_HPP
-#include
#include
namespace libbitcoin {
diff --git a/include/bitcoin/node/block_memory.hpp b/include/bitcoin/node/block_memory.hpp
index fbe511385..2fe6414d8 100644
--- a/include/bitcoin/node/block_memory.hpp
+++ b/include/bitcoin/node/block_memory.hpp
@@ -20,7 +20,6 @@
#define LIBBITCOIN_NODE_BLOCK_MEMORY_HPP
#include
-#include
#include
#include
diff --git a/include/bitcoin/node/channels/channel.hpp b/include/bitcoin/node/channels/channel.hpp
index 96a59150b..aa46ffab1 100644
--- a/include/bitcoin/node/channels/channel.hpp
+++ b/include/bitcoin/node/channels/channel.hpp
@@ -20,7 +20,6 @@
#define LIBBITCOIN_NODE_CHANNELS_CHANNEL_HPP
#include
-#include
#include
#include
#include
diff --git a/include/bitcoin/node/channels/channel_http.hpp b/include/bitcoin/node/channels/channel_http.hpp
index 18e3523aa..f69cb8434 100644
--- a/include/bitcoin/node/channels/channel_http.hpp
+++ b/include/bitcoin/node/channels/channel_http.hpp
@@ -20,7 +20,6 @@
#define LIBBITCOIN_NODE_CHANNELS_CHANNEL_HTTP_HPP
#include
-#include
#include
#include
#include
@@ -35,7 +34,7 @@ class BCN_API channel_http
{
public:
typedef std::shared_ptr ptr;
- using options_t = network::settings::http_server;
+ using options_t = network::channel_http::options_t;
channel_http(const network::logger& log, const network::socket::ptr& socket,
const node::configuration& config, uint64_t identifier=zero,
diff --git a/include/bitcoin/node/channels/channel_peer.hpp b/include/bitcoin/node/channels/channel_peer.hpp
index 754d55338..fea61640d 100644
--- a/include/bitcoin/node/channels/channel_peer.hpp
+++ b/include/bitcoin/node/channels/channel_peer.hpp
@@ -20,7 +20,6 @@
#define LIBBITCOIN_NODE_CHANNELS_CHANNEL_PEER_HPP
#include
-#include
#include
#include
#include
diff --git a/include/bitcoin/node/channels/channel_tcp.hpp b/include/bitcoin/node/channels/channel_tcp.hpp
index 8338c7df4..fccf83303 100644
--- a/include/bitcoin/node/channels/channel_tcp.hpp
+++ b/include/bitcoin/node/channels/channel_tcp.hpp
@@ -20,7 +20,6 @@
#define LIBBITCOIN_NODE_CHANNELS_CHANNEL_TCP_HPP
#include
-#include
#include
#include
#include
@@ -35,7 +34,7 @@ class BCN_API channel_tcp
{
public:
typedef std::shared_ptr ptr;
- using options_t = network::settings::tcp_server;
+ using options_t = network::channel_tcp::options_t;
channel_tcp(const network::logger& log, const network::socket::ptr& socket,
const node::configuration& config, uint64_t identifier=zero,
diff --git a/include/bitcoin/node/channels/channels.hpp b/include/bitcoin/node/channels/channels.hpp
index cd53d5c6c..fc22e756a 100644
--- a/include/bitcoin/node/channels/channels.hpp
+++ b/include/bitcoin/node/channels/channels.hpp
@@ -23,6 +23,7 @@
#include
#include
#include
+// add channel_websocket to network and derive here
#endif
diff --git a/include/bitcoin/node/chasers/chaser.hpp b/include/bitcoin/node/chasers/chaser.hpp
index 377da7645..6b493cd67 100644
--- a/include/bitcoin/node/chasers/chaser.hpp
+++ b/include/bitcoin/node/chasers/chaser.hpp
@@ -19,8 +19,6 @@
#ifndef LIBBITCOIN_NODE_CHASERS_CHASER_HPP
#define LIBBITCOIN_NODE_CHASERS_CHASER_HPP
-#include
-#include
#include
#include
diff --git a/include/bitcoin/node/chasers/chaser_block.hpp b/include/bitcoin/node/chasers/chaser_block.hpp
index 10bf59b58..35cc8da62 100644
--- a/include/bitcoin/node/chasers/chaser_block.hpp
+++ b/include/bitcoin/node/chasers/chaser_block.hpp
@@ -19,7 +19,6 @@
#ifndef LIBBITCOIN_NODE_CHASERS_CHASER_BLOCK_HPP
#define LIBBITCOIN_NODE_CHASERS_CHASER_BLOCK_HPP
-#include
#include
#include
diff --git a/include/bitcoin/node/chasers/chaser_check.hpp b/include/bitcoin/node/chasers/chaser_check.hpp
index 0789edd2e..64c17bff3 100644
--- a/include/bitcoin/node/chasers/chaser_check.hpp
+++ b/include/bitcoin/node/chasers/chaser_check.hpp
@@ -21,7 +21,6 @@
#include
#include
-#include
#include
#include
diff --git a/include/bitcoin/node/chasers/chaser_confirm.hpp b/include/bitcoin/node/chasers/chaser_confirm.hpp
index 985885a88..e2a25a567 100644
--- a/include/bitcoin/node/chasers/chaser_confirm.hpp
+++ b/include/bitcoin/node/chasers/chaser_confirm.hpp
@@ -19,7 +19,6 @@
#ifndef LIBBITCOIN_NODE_CHASERS_CHASER_CONFIRM_HPP
#define LIBBITCOIN_NODE_CHASERS_CHASER_CONFIRM_HPP
-#include
#include
#include
diff --git a/include/bitcoin/node/chasers/chaser_header.hpp b/include/bitcoin/node/chasers/chaser_header.hpp
index 3ac08f2ef..3afa9eb93 100644
--- a/include/bitcoin/node/chasers/chaser_header.hpp
+++ b/include/bitcoin/node/chasers/chaser_header.hpp
@@ -19,7 +19,6 @@
#ifndef LIBBITCOIN_NODE_CHASERS_CHASER_HEADER_HPP
#define LIBBITCOIN_NODE_CHASERS_CHASER_HEADER_HPP
-#include
#include
#include
diff --git a/include/bitcoin/node/chasers/chaser_organize.hpp b/include/bitcoin/node/chasers/chaser_organize.hpp
index a5a51cdfd..63f53c9ad 100644
--- a/include/bitcoin/node/chasers/chaser_organize.hpp
+++ b/include/bitcoin/node/chasers/chaser_organize.hpp
@@ -20,8 +20,6 @@
#define LIBBITCOIN_NODE_CHASERS_CHASER_ORGANIZE_HPP
#include
-#include
-#include
#include
#include
diff --git a/include/bitcoin/node/chasers/chaser_snapshot.hpp b/include/bitcoin/node/chasers/chaser_snapshot.hpp
index f409258b2..ec295aa12 100644
--- a/include/bitcoin/node/chasers/chaser_snapshot.hpp
+++ b/include/bitcoin/node/chasers/chaser_snapshot.hpp
@@ -20,7 +20,6 @@
#define LIBBITCOIN_NODE_CHASERS_CHASER_SNAPSHOT_HPP
#include
-#include
#include
#include
diff --git a/include/bitcoin/node/chasers/chaser_storage.hpp b/include/bitcoin/node/chasers/chaser_storage.hpp
index 761bfe4b8..77037d6be 100644
--- a/include/bitcoin/node/chasers/chaser_storage.hpp
+++ b/include/bitcoin/node/chasers/chaser_storage.hpp
@@ -19,7 +19,6 @@
#ifndef LIBBITCOIN_NODE_CHASERS_CHASER_STORAGE_HPP
#define LIBBITCOIN_NODE_CHASERS_CHASER_STORAGE_HPP
-#include
#include
#include
diff --git a/include/bitcoin/node/chasers/chaser_transaction.hpp b/include/bitcoin/node/chasers/chaser_transaction.hpp
index 0bc19c953..2b2aeb98f 100644
--- a/include/bitcoin/node/chasers/chaser_transaction.hpp
+++ b/include/bitcoin/node/chasers/chaser_transaction.hpp
@@ -19,7 +19,6 @@
#ifndef LIBBITCOIN_NODE_CHASERS_CHASER_TRANSACTION_HPP
#define LIBBITCOIN_NODE_CHASERS_CHASER_TRANSACTION_HPP
-#include
#include
#include
diff --git a/include/bitcoin/node/chasers/chaser_validate.hpp b/include/bitcoin/node/chasers/chaser_validate.hpp
index e3a2faf63..5babd4457 100644
--- a/include/bitcoin/node/chasers/chaser_validate.hpp
+++ b/include/bitcoin/node/chasers/chaser_validate.hpp
@@ -20,8 +20,6 @@
#define LIBBITCOIN_NODE_CHASERS_CHASER_VALIDATE_HPP
#include
-#include
-#include
#include
#include
diff --git a/include/bitcoin/node/configuration.hpp b/include/bitcoin/node/configuration.hpp
index e29e1b946..563ef6840 100644
--- a/include/bitcoin/node/configuration.hpp
+++ b/include/bitcoin/node/configuration.hpp
@@ -19,8 +19,6 @@
#ifndef LIBBITCOIN_NODE_CONFIGURATION_HPP
#define LIBBITCOIN_NODE_CONFIGURATION_HPP
-#include
-#include
#include
#include
@@ -62,6 +60,7 @@ class BCN_API configuration
/// Settings.
log::settings log;
+ server::settings server;
node::settings node;
network::settings network;
database::settings database;
diff --git a/include/bitcoin/node/full_node.hpp b/include/bitcoin/node/full_node.hpp
index 921f66988..fd92c6df3 100644
--- a/include/bitcoin/node/full_node.hpp
+++ b/include/bitcoin/node/full_node.hpp
@@ -19,8 +19,6 @@
#ifndef LIBBITCOIN_NODE_FULL_NODE_HPP
#define LIBBITCOIN_NODE_FULL_NODE_HPP
-#include
-#include
#include
#include
#include
diff --git a/include/bitcoin/node/impl/chasers/chaser_organize.ipp b/include/bitcoin/node/impl/chasers/chaser_organize.ipp
index 67f36272d..8b4b96036 100644
--- a/include/bitcoin/node/impl/chasers/chaser_organize.ipp
+++ b/include/bitcoin/node/impl/chasers/chaser_organize.ipp
@@ -21,8 +21,6 @@
#include
#include
-#include
-#include
#include
#include
diff --git a/include/bitcoin/node/parser.hpp b/include/bitcoin/node/parser.hpp
index 8f6e7bf42..d5e41b8da 100644
--- a/include/bitcoin/node/parser.hpp
+++ b/include/bitcoin/node/parser.hpp
@@ -19,7 +19,6 @@
#ifndef LIBBITCOIN_NODE_PARSER_HPP
#define LIBBITCOIN_NODE_PARSER_HPP
-#include
#include
#include
diff --git a/include/bitcoin/node/protocols/protocol.hpp b/include/bitcoin/node/protocols/protocol.hpp
index 183d1106c..37b83e6b1 100644
--- a/include/bitcoin/node/protocols/protocol.hpp
+++ b/include/bitcoin/node/protocols/protocol.hpp
@@ -20,10 +20,11 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HPP
#include
-#include
#include
#include
#include
+
+// Only session.hpp.
#include
namespace libbitcoin {
@@ -45,15 +46,13 @@ namespace node {
class BCN_API protocol
{
protected:
- typedef std::shared_ptr ptr;
-
DELETE_COPY_MOVE_DESTRUCT(protocol);
/// Constructors.
/// -----------------------------------------------------------------------
// reinterpret_pointer_cast because channel is abstract.
- protocol(const node::session::ptr& session,
+ protocol(const auto& session,
const network::channel::ptr& channel) NOEXCEPT
: channel_(std::reinterpret_pointer_cast(channel)),
session_(session)
diff --git a/include/bitcoin/node/protocols/protocol_bitcoind.hpp b/include/bitcoin/node/protocols/protocol_bitcoind.hpp
index 94a3b2a69..e6127cf4a 100644
--- a/include/bitcoin/node/protocols/protocol_bitcoind.hpp
+++ b/include/bitcoin/node/protocols/protocol_bitcoind.hpp
@@ -20,7 +20,6 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_BITCOIND_HPP
#include
-#include
#include
#include
#include
@@ -34,8 +33,6 @@ class BCN_API protocol_bitcoind
{
public:
typedef std::shared_ptr ptr;
- using options_t = network::settings::http_server;
- using channel_t = node::channel_http;
protocol_bitcoind(const auto& session,
const network::channel::ptr& channel,
diff --git a/include/bitcoin/node/protocols/protocol_block_in_106.hpp b/include/bitcoin/node/protocols/protocol_block_in_106.hpp
index 321ef9070..1f5af47dd 100644
--- a/include/bitcoin/node/protocols/protocol_block_in_106.hpp
+++ b/include/bitcoin/node/protocols/protocol_block_in_106.hpp
@@ -20,9 +20,7 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_BLOCK_IN_106_HPP
#include
-#include
#include
-#include
#include
namespace libbitcoin {
diff --git a/include/bitcoin/node/protocols/protocol_block_in_31800.hpp b/include/bitcoin/node/protocols/protocol_block_in_31800.hpp
index 2a31b9e69..51814b333 100644
--- a/include/bitcoin/node/protocols/protocol_block_in_31800.hpp
+++ b/include/bitcoin/node/protocols/protocol_block_in_31800.hpp
@@ -19,7 +19,6 @@
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_BLOCK_IN_31800_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_BLOCK_IN_31800_HPP
-#include
#include
#include
#include
diff --git a/include/bitcoin/node/protocols/protocol_block_out_106.hpp b/include/bitcoin/node/protocols/protocol_block_out_106.hpp
index 5c2bf7371..5877c5822 100644
--- a/include/bitcoin/node/protocols/protocol_block_out_106.hpp
+++ b/include/bitcoin/node/protocols/protocol_block_out_106.hpp
@@ -19,9 +19,7 @@
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_BLOCK_OUT_106_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_BLOCK_OUT_106_HPP
-#include
#include
-#include
#include
namespace libbitcoin {
diff --git a/include/bitcoin/node/protocols/protocol_block_out_70012.hpp b/include/bitcoin/node/protocols/protocol_block_out_70012.hpp
index 7efc706e8..708f8223d 100644
--- a/include/bitcoin/node/protocols/protocol_block_out_70012.hpp
+++ b/include/bitcoin/node/protocols/protocol_block_out_70012.hpp
@@ -19,7 +19,6 @@
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_BLOCK_OUT_70012_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_BLOCK_OUT_70012_HPP
-#include
#include
#include
diff --git a/include/bitcoin/node/protocols/protocol_electrum.hpp b/include/bitcoin/node/protocols/protocol_electrum.hpp
index 05621849b..01316e497 100644
--- a/include/bitcoin/node/protocols/protocol_electrum.hpp
+++ b/include/bitcoin/node/protocols/protocol_electrum.hpp
@@ -20,7 +20,6 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_ELECTRUM_HPP
#include
-#include
#include
#include
#include
@@ -34,8 +33,6 @@ class BCN_API protocol_electrum
{
public:
typedef std::shared_ptr ptr;
- using options_t = network::settings::tcp_server;
- using channel_t = node::channel_tcp;
protocol_electrum(const auto& session,
const network::channel::ptr& channel,
diff --git a/include/bitcoin/node/protocols/protocol_explore.hpp b/include/bitcoin/node/protocols/protocol_explore.hpp
index 6659acd61..a0c3f06af 100644
--- a/include/bitcoin/node/protocols/protocol_explore.hpp
+++ b/include/bitcoin/node/protocols/protocol_explore.hpp
@@ -20,8 +20,6 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_EXPLORE_HPP
#include
-#include
-#include
#include
#include
@@ -34,8 +32,6 @@ class BCN_API protocol_explore
{
public:
typedef std::shared_ptr ptr;
- using options_t = network::settings::html_server;
- using channel_t = node::channel_http;
protocol_explore(const auto& session,
const network::channel::ptr& channel,
@@ -54,10 +50,6 @@ class BCN_API protocol_explore
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
diff --git a/include/bitcoin/node/protocols/protocol_filter_out_70015.hpp b/include/bitcoin/node/protocols/protocol_filter_out_70015.hpp
index 72d8bb506..4a2adbca1 100644
--- a/include/bitcoin/node/protocols/protocol_filter_out_70015.hpp
+++ b/include/bitcoin/node/protocols/protocol_filter_out_70015.hpp
@@ -20,9 +20,7 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_CLIENT_FILTER_HPP
#include
-#include
#include
-#include
#include
namespace libbitcoin {
diff --git a/include/bitcoin/node/protocols/protocol_header_in_31800.hpp b/include/bitcoin/node/protocols/protocol_header_in_31800.hpp
index 21a64210e..c8f2da996 100644
--- a/include/bitcoin/node/protocols/protocol_header_in_31800.hpp
+++ b/include/bitcoin/node/protocols/protocol_header_in_31800.hpp
@@ -19,9 +19,7 @@
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HEADER_IN_31800_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HEADER_IN_31800_HPP
-#include
#include
-#include
#include
namespace libbitcoin {
diff --git a/include/bitcoin/node/protocols/protocol_header_in_70012.hpp b/include/bitcoin/node/protocols/protocol_header_in_70012.hpp
index 7f081c2dd..e8583a829 100644
--- a/include/bitcoin/node/protocols/protocol_header_in_70012.hpp
+++ b/include/bitcoin/node/protocols/protocol_header_in_70012.hpp
@@ -19,7 +19,6 @@
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HEADER_IN_70012_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HEADER_IN_70012_HPP
-#include
#include
#include
diff --git a/include/bitcoin/node/protocols/protocol_header_out_31800.hpp b/include/bitcoin/node/protocols/protocol_header_out_31800.hpp
index f985e2a9f..e109dc722 100644
--- a/include/bitcoin/node/protocols/protocol_header_out_31800.hpp
+++ b/include/bitcoin/node/protocols/protocol_header_out_31800.hpp
@@ -19,9 +19,7 @@
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HEADER_OUT_31800_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HEADER_OUT_31800_HPP
-#include
#include
-#include
#include
namespace libbitcoin {
diff --git a/include/bitcoin/node/protocols/protocol_header_out_70012.hpp b/include/bitcoin/node/protocols/protocol_header_out_70012.hpp
index eed6ba5c3..b439a58ee 100644
--- a/include/bitcoin/node/protocols/protocol_header_out_70012.hpp
+++ b/include/bitcoin/node/protocols/protocol_header_out_70012.hpp
@@ -19,7 +19,6 @@
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HEADER_OUT_70012_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HEADER_OUT_70012_HPP
-#include
#include
#include
diff --git a/include/bitcoin/node/protocols/protocol_html.hpp b/include/bitcoin/node/protocols/protocol_html.hpp
index 8ffbb4071..a721309dd 100644
--- a/include/bitcoin/node/protocols/protocol_html.hpp
+++ b/include/bitcoin/node/protocols/protocol_html.hpp
@@ -19,31 +19,51 @@
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HTML_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HTML_HPP
-#include
-#include
#include
#include
#include
-#include
+#include
namespace libbitcoin {
namespace node {
/// Abstract base for HTML protocols, thread safe.
class BCN_API protocol_html
- : public network::protocol_html,
+ : public network::protocol_http,
public node::protocol
{
-protected:
- typedef std::shared_ptr ptr;
+public:
+ /// http channel, but html settings.
+ using options_t = server::settings::html_server;
+ using channel_t = node::channel_http;
+protected:
protocol_html(const auto& session,
const network::channel::ptr& channel,
const options_t& options) NOEXCEPT
- : network::protocol_html(session, channel, options),
+ : network::protocol_http(session, channel, options),
+ options_(options),
node::protocol(session, channel)
{
}
+
+ /// Message handlers by http method.
+ void handle_receive_get(const code& ec,
+ const network::http::method::get& request) NOEXCEPT override;
+
+ /// Senders.
+ void send_file(const network::http::string_request& request,
+ network::http::file&& file, network::http::mime_type type) NOEXCEPT;
+
+ /// Utilities.
+ bool is_allowed_origin(const std::string& origin,
+ size_t version) const NOEXCEPT;
+ std::filesystem::path to_local_path(
+ const std::string& target = "/") const NOEXCEPT;
+
+private:
+ // This is thread safe.
+ const options_t& options_;
};
} // namespace node
diff --git a/include/bitcoin/node/protocols/protocol_http.hpp b/include/bitcoin/node/protocols/protocol_http.hpp
index 0ea0492f4..fe3ca2d9a 100644
--- a/include/bitcoin/node/protocols/protocol_http.hpp
+++ b/include/bitcoin/node/protocols/protocol_http.hpp
@@ -20,10 +20,11 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_HTTP_HPP
#include
-#include
#include
#include
#include
+
+ // Only session.hpp.
#include
namespace libbitcoin {
@@ -34,9 +35,11 @@ class BCN_API protocol_http
: public network::protocol_http,
public node::protocol
{
-protected:
- typedef std::shared_ptr ptr;
+public:
+ // Replace base class channel_t (network::channel_http).
+ using channel_t = node::channel_http;
+protected:
protocol_http(const auto& session,
const network::channel::ptr& channel,
const options_t& options) NOEXCEPT
@@ -52,7 +55,7 @@ class BCN_API protocol_http
const node::channel_tcp::ptr channel_;
// This is thread safe.
- const session::ptr session_;
+ const node::session::ptr session_;
};
} // namespace node
diff --git a/include/bitcoin/node/protocols/protocol_observer.hpp b/include/bitcoin/node/protocols/protocol_observer.hpp
index 77401b248..4ef8bc58b 100644
--- a/include/bitcoin/node/protocols/protocol_observer.hpp
+++ b/include/bitcoin/node/protocols/protocol_observer.hpp
@@ -20,7 +20,6 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_OBSERVER_HPP
#include
-#include
#include
#include
#include
diff --git a/include/bitcoin/node/protocols/protocol_peer.hpp b/include/bitcoin/node/protocols/protocol_peer.hpp
index 263c20443..448ab9c45 100644
--- a/include/bitcoin/node/protocols/protocol_peer.hpp
+++ b/include/bitcoin/node/protocols/protocol_peer.hpp
@@ -20,10 +20,11 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_PEER_HPP
#include
-#include
#include
#include
#include
+
+ // Only session.hpp.
#include
namespace libbitcoin {
@@ -122,7 +123,7 @@ class BCN_API protocol_peer
const node::channel_peer::ptr channel_;
// This is thread safe.
- const session::ptr session_;
+ const node::session::ptr session_;
// This is protected by singular subscription.
object_key key_{};
diff --git a/include/bitcoin/node/protocols/protocol_performer.hpp b/include/bitcoin/node/protocols/protocol_performer.hpp
index 7d54c914f..59a6ac864 100644
--- a/include/bitcoin/node/protocols/protocol_performer.hpp
+++ b/include/bitcoin/node/protocols/protocol_performer.hpp
@@ -19,9 +19,7 @@
#ifndef LIBBITCOIN_NODE_PROTOCOL_PERFORMER_HPP
#define LIBBITCOIN_NODE_PROTOCOL_PERFORMER_HPP
-#include
#include
-#include
#include
namespace libbitcoin {
diff --git a/include/bitcoin/node/protocols/protocol_stratum_v1.hpp b/include/bitcoin/node/protocols/protocol_stratum_v1.hpp
index b378b7b56..3f3cff5d5 100644
--- a/include/bitcoin/node/protocols/protocol_stratum_v1.hpp
+++ b/include/bitcoin/node/protocols/protocol_stratum_v1.hpp
@@ -20,8 +20,6 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_STRATUM_V1_HPP
#include
-#include
-#include
#include
#include
@@ -34,8 +32,6 @@ class BCN_API protocol_stratum_v1
{
public:
typedef std::shared_ptr ptr;
- using options_t = network::settings::tcp_server;
- using channel_t = node::channel_tcp;
protocol_stratum_v1(const auto& session,
const network::channel::ptr& channel,
diff --git a/include/bitcoin/node/protocols/protocol_stratum_v2.hpp b/include/bitcoin/node/protocols/protocol_stratum_v2.hpp
index eb214bbc9..fdc71358f 100644
--- a/include/bitcoin/node/protocols/protocol_stratum_v2.hpp
+++ b/include/bitcoin/node/protocols/protocol_stratum_v2.hpp
@@ -20,8 +20,6 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_STRATUM_V2_HPP
#include
-#include
-#include
#include
#include
@@ -34,8 +32,6 @@ class BCN_API protocol_stratum_v2
{
public:
typedef std::shared_ptr ptr;
- using options_t = network::settings::tcp_server;
- using channel_t = node::channel_tcp;
protocol_stratum_v2(const auto& session,
const network::channel::ptr& channel,
diff --git a/include/bitcoin/node/protocols/protocol_tcp.hpp b/include/bitcoin/node/protocols/protocol_tcp.hpp
index 5bdcc8b38..5df824894 100644
--- a/include/bitcoin/node/protocols/protocol_tcp.hpp
+++ b/include/bitcoin/node/protocols/protocol_tcp.hpp
@@ -20,10 +20,11 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_TCP_HPP
#include
-#include
#include
#include
#include
+
+ // Only session.hpp.
#include
namespace libbitcoin {
@@ -34,9 +35,11 @@ class BCN_API protocol_tcp
: public network::protocol_tcp,
public node::protocol
{
-protected:
- typedef std::shared_ptr ptr;
+public:
+ // Replace base class channel_t (network::channel_tcp).
+ using channel_t = node::channel_tcp;
+protected:
protocol_tcp(const auto& session,
const network::channel::ptr& channel,
const options_t& options) NOEXCEPT
@@ -52,7 +55,7 @@ class BCN_API protocol_tcp
const node::channel_tcp::ptr channel_;
// This is thread safe.
- const session::ptr session_;
+ const node::session::ptr session_;
};
} // namespace node
diff --git a/include/bitcoin/node/protocols/protocol_transaction_in_106.hpp b/include/bitcoin/node/protocols/protocol_transaction_in_106.hpp
index 5cc9396bd..15670a56c 100644
--- a/include/bitcoin/node/protocols/protocol_transaction_in_106.hpp
+++ b/include/bitcoin/node/protocols/protocol_transaction_in_106.hpp
@@ -19,9 +19,7 @@
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_TRANSACTION_IN_106_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_TRANSACTION_IN_106_HPP
-#include
#include
-#include
#include
namespace libbitcoin {
diff --git a/include/bitcoin/node/protocols/protocol_transaction_out_106.hpp b/include/bitcoin/node/protocols/protocol_transaction_out_106.hpp
index d3f32cf98..1f8f518df 100644
--- a/include/bitcoin/node/protocols/protocol_transaction_out_106.hpp
+++ b/include/bitcoin/node/protocols/protocol_transaction_out_106.hpp
@@ -19,9 +19,7 @@
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_TRANSACTION_OUT_106_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_TRANSACTION_OUT_106_HPP
-#include
#include
-#include
#include
namespace libbitcoin {
diff --git a/include/bitcoin/node/protocols/protocol_web.hpp b/include/bitcoin/node/protocols/protocol_web.hpp
index 5e3616a90..57c4da783 100644
--- a/include/bitcoin/node/protocols/protocol_web.hpp
+++ b/include/bitcoin/node/protocols/protocol_web.hpp
@@ -20,22 +20,19 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_WEB_HPP
#include
-#include
-#include
#include
-#include
+#include
namespace libbitcoin {
namespace node {
+/// Administrative web site for the node (currently just page server).
class BCN_API protocol_web
: public node::protocol_html,
protected network::tracker
{
public:
typedef std::shared_ptr ptr;
- using options_t = network::settings::html_server;
- using channel_t = node::channel_http;
protocol_web(const auto& session,
const network::channel::ptr& channel,
@@ -50,14 +47,6 @@ class BCN_API protocol_web
{
node::protocol_html::start();
}
-
-////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
diff --git a/include/bitcoin/node/protocols/protocol_websocket.hpp b/include/bitcoin/node/protocols/protocol_websocket.hpp
index 5b6085fe9..cfb0825fa 100644
--- a/include/bitcoin/node/protocols/protocol_websocket.hpp
+++ b/include/bitcoin/node/protocols/protocol_websocket.hpp
@@ -20,8 +20,6 @@
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_WEBSOCKET_HPP
#include
-#include
-#include
#include
#include
@@ -34,8 +32,6 @@ class BCN_API protocol_websocket
{
public:
typedef std::shared_ptr ptr;
- using options_t = network::settings::http_server;
- using channel_t = node::channel_http;
protocol_websocket(const auto& session,
const network::channel::ptr& channel,
diff --git a/include/bitcoin/node/protocols/protocols.hpp b/include/bitcoin/node/protocols/protocols.hpp
index 9ffd30fff..a78a5b9af 100644
--- a/include/bitcoin/node/protocols/protocols.hpp
+++ b/include/bitcoin/node/protocols/protocols.hpp
@@ -19,11 +19,12 @@
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOLS_HPP
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOLS_HPP
-/// node base
+/// base
#include
-
-/// peer base
+#include
+#include
#include
+#include
/// peer
#include
@@ -40,11 +41,6 @@
#include
#include
-/// server base
-#include
-#include
-#include
-
/// server
#include
#include
diff --git a/include/bitcoin/node/sessions/session.hpp b/include/bitcoin/node/sessions/session.hpp
index 22f0afa74..5343d544c 100644
--- a/include/bitcoin/node/sessions/session.hpp
+++ b/include/bitcoin/node/sessions/session.hpp
@@ -19,8 +19,6 @@
#ifndef LIBBITCOIN_NODE_SESSIONS_SESSION_HPP
#define LIBBITCOIN_NODE_SESSIONS_SESSION_HPP
-#include
-#include
#include
#include
diff --git a/include/bitcoin/node/sessions/session_inbound.hpp b/include/bitcoin/node/sessions/session_inbound.hpp
index ffd53cdf9..c4f439c3b 100644
--- a/include/bitcoin/node/sessions/session_inbound.hpp
+++ b/include/bitcoin/node/sessions/session_inbound.hpp
@@ -19,14 +19,13 @@
#ifndef LIBBITCOIN_NODE_SESSIONS_SESSION_INBOUND_HPP
#define LIBBITCOIN_NODE_SESSIONS_SESSION_INBOUND_HPP
-#include
#include
#include
namespace libbitcoin {
namespace node {
-class session_inbound
+class BCN_API session_inbound
: public session_peer
{
public:
diff --git a/include/bitcoin/node/sessions/session_manual.hpp b/include/bitcoin/node/sessions/session_manual.hpp
index 28649d3d6..3293e016d 100644
--- a/include/bitcoin/node/sessions/session_manual.hpp
+++ b/include/bitcoin/node/sessions/session_manual.hpp
@@ -19,14 +19,13 @@
#ifndef LIBBITCOIN_NODE_SESSIONS_SESSION_MANUAL_HPP
#define LIBBITCOIN_NODE_SESSIONS_SESSION_MANUAL_HPP
-#include
#include
#include
namespace libbitcoin {
namespace node {
-class session_manual
+class BCN_API session_manual
: public session_peer
{
public:
diff --git a/include/bitcoin/node/sessions/session_outbound.hpp b/include/bitcoin/node/sessions/session_outbound.hpp
index 3f4c331df..a4edad14c 100644
--- a/include/bitcoin/node/sessions/session_outbound.hpp
+++ b/include/bitcoin/node/sessions/session_outbound.hpp
@@ -19,14 +19,13 @@
#ifndef LIBBITCOIN_NODE_SESSIONS_SESSION_OUTBOUND_HPP
#define LIBBITCOIN_NODE_SESSIONS_SESSION_OUTBOUND_HPP
-#include
#include
#include
namespace libbitcoin {
namespace node {
-class session_outbound
+class BCN_API session_outbound
: public session_peer
{
public:
diff --git a/include/bitcoin/node/sessions/session_peer.hpp b/include/bitcoin/node/sessions/session_peer.hpp
index 34e2eace3..bca26304a 100644
--- a/include/bitcoin/node/sessions/session_peer.hpp
+++ b/include/bitcoin/node/sessions/session_peer.hpp
@@ -21,7 +21,7 @@
#include
#include
-#include
+#include
#include
#include
#include