Skip to content

Commit 35fd48d

Browse files
authored
Merge pull request #870 from evoskuil/master
Rename protocol_websocket_handshak, update websocket -> socket config.
2 parents e17f595 + f11129a commit 35fd48d

File tree

11 files changed

+40
-39
lines changed

11 files changed

+40
-39
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ include_bitcoin_node_protocols_HEADERS = \
212212
include/bitcoin/node/protocols/protocol_transaction_out_106.hpp \
213213
include/bitcoin/node/protocols/protocol_web.hpp \
214214
include/bitcoin/node/protocols/protocol_websocket.hpp \
215-
include/bitcoin/node/protocols/protocol_websocket_handshake.hpp \
215+
include/bitcoin/node/protocols/protocol_websocket_shake.hpp \
216216
include/bitcoin/node/protocols/protocols.hpp
217217

218218
include_bitcoin_node_sessionsdir = ${includedir}/bitcoin/node/sessions

builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_transaction_out_106.hpp" />
217217
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_web.hpp" />
218218
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_websocket.hpp" />
219-
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_websocket_handshake.hpp" />
219+
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_websocket_shake.hpp" />
220220
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocols.hpp" />
221221
<ClInclude Include="..\..\..\..\include\bitcoin\node\sessions\session.hpp" />
222222
<ClInclude Include="..\..\..\..\include\bitcoin\node\sessions\session_inbound.hpp" />

builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj.filters

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_websocket.hpp">
336336
<Filter>include\bitcoin\node\protocols</Filter>
337337
</ClInclude>
338-
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_websocket_handshake.hpp">
338+
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_websocket_shake.hpp">
339339
<Filter>include\bitcoin\node\protocols</Filter>
340340
</ClInclude>
341341
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocols.hpp">

include/bitcoin/node.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
#include <bitcoin/node/protocols/protocol_transaction_out_106.hpp>
7171
#include <bitcoin/node/protocols/protocol_web.hpp>
7272
#include <bitcoin/node/protocols/protocol_websocket.hpp>
73-
#include <bitcoin/node/protocols/protocol_websocket_handshake.hpp>
73+
#include <bitcoin/node/protocols/protocol_websocket_shake.hpp>
7474
#include <bitcoin/node/protocols/protocols.hpp>
7575
#include <bitcoin/node/sessions/session.hpp>
7676
#include <bitcoin/node/sessions/session_inbound.hpp>

include/bitcoin/node/channels/channel_websocket.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace libbitcoin {
2828
namespace node {
2929

3030
/// Abstract base websocket channel state for the node.
31+
/// Does not inherit node::channel_http but does inherit network::channel_http.
3132
class BCN_API channel_websocket
3233
: public network::channel_websocket,
3334
public node::channel

include/bitcoin/node/protocols/protocol_websocket_handshake.hpp renamed to include/bitcoin/node/protocols/protocol_websocket_shake.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* You should have received a copy of the GNU Affero General Public License
1717
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
19-
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_WEBSOCKET_HANDSHAKE_HPP
20-
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_WEBSOCKET_HANDSHAKE_HPP
19+
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_WEBSOCKET_SHAKE_HPP
20+
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_WEBSOCKET_SHAKE_HPP
2121

2222
#include <memory>
2323
#include <bitcoin/node/define.hpp>
@@ -26,32 +26,32 @@
2626
namespace libbitcoin {
2727
namespace node {
2828

29-
// TODO: make this an intermediate base class for websocket_handshake.
29+
// TODO: make this an intermediate base class for websocket_shake.
3030
// TODO: and then create a distinct concrete class for deployment.
31-
class BCN_API protocol_websocket_handshake
32-
: public network::protocol_websocket_handshake,
31+
class BCN_API protocol_websocket_shake
32+
: public network::protocol_websocket_shake,
3333
public node::protocol,
34-
protected network::tracker<protocol_websocket_handshake>
34+
protected network::tracker<protocol_websocket_shake>
3535
{
3636
public:
37-
typedef std::shared_ptr<protocol_websocket_handshake> ptr;
37+
typedef std::shared_ptr<protocol_websocket_shake> ptr;
3838

3939
// Replace base class channel_t (network::channel_http).
4040
using channel_t = node::channel_http;
4141

42-
protocol_websocket_handshake(const auto& session,
42+
protocol_websocket_shake(const auto& session,
4343
const network::channel::ptr& channel,
4444
const options_t& options) NOEXCEPT
45-
: network::protocol_websocket_handshake(session, channel, options),
45+
: network::protocol_websocket_shake(session, channel, options),
4646
node::protocol(session, channel),
47-
network::tracker<protocol_websocket_handshake>(session->log)
47+
network::tracker<protocol_websocket_shake>(session->log)
4848
{
4949
}
5050

5151
/// Public start is required.
5252
void start() NOEXCEPT override
5353
{
54-
network::protocol_websocket_handshake::start();
54+
network::protocol_websocket_shake::start();
5555
}
5656

5757
private:

include/bitcoin/node/protocols/protocols.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@
5050
#include <bitcoin/node/protocols/protocol_stratum_v1.hpp>
5151
#include <bitcoin/node/protocols/protocol_stratum_v2.hpp>
5252
#include <bitcoin/node/protocols/protocol_websocket.hpp>
53-
#include <bitcoin/node/protocols/protocol_websocket_handshake.hpp>
53+
#include <bitcoin/node/protocols/protocol_websocket_shake.hpp>
5454

5555
#endif

include/bitcoin/node/settings.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class BCN_API settings
136136
server::settings::html_server explore{ "explore" };
137137

138138
/// native websocket query interface (http/s->tcp/s, json, handshake)
139-
network::settings::websocket_server websocket{ "websocket" };
139+
network::settings::websocket_server socket{ "socket" };
140140

141141
/// bitcoind compat interface (http/s, stateless json-rpc-v2)
142142
network::settings::http_server bitcoind{ "bitcoind" };

src/full_node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ session_explore::ptr full_node::attach_explore_session() NOEXCEPT
548548

549549
session_websocket::ptr full_node::attach_websocket_session() NOEXCEPT
550550
{
551-
return net::attach<session_websocket>(*this, config_.server.websocket);
551+
return net::attach<session_websocket>(*this, config_.server.socket);
552552
}
553553

554554
session_bitcoind::ptr full_node::attach_bitcoind_session() NOEXCEPT

src/parser.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ parser::parser(system::chain::selection context) NOEXCEPT
9494
// admin
9595
configured.server.web.binds.emplace_back(asio::address{}, 8080_u16);
9696
configured.server.explore.binds.emplace_back(asio::address{}, 8180_u16);
97-
configured.server.websocket.binds.emplace_back(asio::address{}, 8280_u16);
97+
configured.server.socket.binds.emplace_back(asio::address{}, 8280_u16);
9898
configured.server.bitcoind.binds.emplace_back(asio::address{}, 8380_u16);
9999
configured.server.electrum.binds.emplace_back(asio::address{}, 8480_u16);
100100
configured.server.stratum_v1.binds.emplace_back(asio::address{}, 8580_u16);
@@ -1149,7 +1149,7 @@ options_metadata parser::load_settings() THROWS
11491149
(
11501150
"explore.bind",
11511151
value<network::config::authorities>(&configured.server.explore.binds),
1152-
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8080' (all IPv4)."
1152+
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8180' (all IPv4)."
11531153
)
11541154
(
11551155
"explore.connections",
@@ -1187,35 +1187,35 @@ options_metadata parser::load_settings() THROWS
11871187
"The path of the default source page, defaults to 'index.html'."
11881188
)
11891189

1190-
/* [websocket] */
1190+
/* [socket] */
11911191
(
11921192
"websocket.secure",
1193-
value<bool>(&configured.server.websocket.secure),
1193+
value<bool>(&configured.server.socket.secure),
11941194
"The service requires TLS (not implemented), defaults to 'false'."
11951195
)
11961196
(
1197-
"websocket.bind",
1198-
value<network::config::authorities>(&configured.server.websocket.binds),
1199-
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8080' (all IPv4)."
1197+
"socket.bind",
1198+
value<network::config::authorities>(&configured.server.socket.binds),
1199+
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8280' (all IPv4)."
12001200
)
12011201
(
1202-
"websocket.connections",
1203-
value<uint16_t>(&configured.server.websocket.connections),
1202+
"socket.connections",
1203+
value<uint16_t>(&configured.server.socket.connections),
12041204
"The required maximum number of connections, defaults to '0'."
12051205
)
12061206
(
1207-
"websocket.timeout_seconds",
1208-
value<uint32_t>(&configured.server.websocket.timeout_seconds),
1207+
"socket.timeout_seconds",
1208+
value<uint32_t>(&configured.server.socket.timeout_seconds),
12091209
"The idle timeout (http keep-alive), defaults to '60'."
12101210
)
12111211
(
1212-
"websocket.server",
1213-
value<std::string>(&configured.server.websocket.server),
1212+
"socket.server",
1213+
value<std::string>(&configured.server.socket.server),
12141214
"The server name (http header), defaults to '" BC_HTTP_SERVER_NAME "'."
12151215
)
12161216
(
1217-
"websocket.host",
1218-
value<network::config::endpoints>(&configured.server.websocket.hosts),
1217+
"socket.host",
1218+
value<network::config::endpoints>(&configured.server.socket.hosts),
12191219
"The host name (http verification), multiple allowed, defaults to empty (disabled)."
12201220
)
12211221

@@ -1228,7 +1228,7 @@ options_metadata parser::load_settings() THROWS
12281228
(
12291229
"bitcoind.bind",
12301230
value<network::config::authorities>(&configured.server.bitcoind.binds),
1231-
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8080' (all IPv4)."
1231+
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8380' (all IPv4)."
12321232
)
12331233
(
12341234
"bitcoind.connections",
@@ -1260,7 +1260,7 @@ options_metadata parser::load_settings() THROWS
12601260
(
12611261
"electrum.bind",
12621262
value<network::config::authorities>(&configured.server.electrum.binds),
1263-
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8080' (all IPv4)."
1263+
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8480' (all IPv4)."
12641264
)
12651265
(
12661266
"electrum.connections",
@@ -1282,7 +1282,7 @@ options_metadata parser::load_settings() THROWS
12821282
(
12831283
"stratum_v1.bind",
12841284
value<network::config::authorities>(&configured.server.stratum_v1.binds),
1285-
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8080' (all IPv4)."
1285+
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8580' (all IPv4)."
12861286
)
12871287
(
12881288
"stratum_v1.connections",
@@ -1304,7 +1304,7 @@ options_metadata parser::load_settings() THROWS
13041304
(
13051305
"stratum_v2.bind",
13061306
value<network::config::authorities>(&configured.server.stratum_v2.binds),
1307-
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8080' (all IPv4)."
1307+
"IP address to bind, multiple allowed, defaults to '0.0.0.0:8680' (all IPv4)."
13081308
)
13091309
(
13101310
"stratum_v2.connections",

0 commit comments

Comments
 (0)