Archive of the libbitcoin Slack #general channel.
network.user_agent string (was hardwired). If you see /panopticon:2.0.2.0/ out there that's me 🙂 Also added config for network.enable_alert (deprecated message) and network.enable_reject (deprecated message) and renamed relay transactions to network.enable_relay.network.self and network.inbound_port , which set up inbound connections (self is how own node is advertised). Set up my port forwarding and firewall, listening now for inbound. If someone wants to set up a manual connection to me let me know.145.255.105.37:8333/1674843314/1032 [2601:18c:8b80:29cb:c149:75bc:5486:d716]:8333/1673430801/1037 80.220.68.138:8333/1675384869/1033 88.10.167.189:8333/1675548091/1033 185.107.56.236:8333/1673037105/1037 85.253.135.250:8333/1674765984/1032 143.244.60.173:8333/1675336113/1032 64.250.72.172:8333/1675567362/1033 [2001:9b1:28fd:1401:51c9:f320:52e4:7c19]:8333/1673262494/1032 73.222.63.19:8333/1674103782/1033 27.122.115.1:8333/1675295192/1037 5.9.109.174:8333/1675542544/18446744073709551615 24.231.203.26:8333/1675204643/1033 37.19.206.112:8333/1675286235/67109965 211.30.164.119:8333/1673641425/1032 172.100.101.232:8333/1674691795/1037 87.95.184.34:8333/1673688936/1033 [2404:440c:2329:2300:ca0f:33d5:3f8a:f62b]:8333/1674578566/1033 [2403:5803:1e29:aa::7ce]:8333/1673974513/1033 70.175.51.156:8333/1674456305/1033 94.31.82.133:8333/1675498459/1033 46.56.243.16:8333/1673850313/1032
================= startup Mon Feb 6 22:11:39 2023 ================== Using config file: "bn.cfg" Press CTRL-C to stop the node. Please wait while the node is starting... Bypassed seeding because outbound connections disbled. Maintaining manual connection to [127.0.0.1:8333] Accepting up to 1 connections on port 8333. Not configured for outbound connections. Node is started. Peer [127.0.0.1:8333] protocol version (70015) user agent: "/panopticon:2.0.2.0/" Peer [127.0.0.1:57492] protocol version (70015) user agent: "/panopticon:2.0.2.0/" Manual channel start [127.0.0.1:8333] success Inbound channel start [127.0.0.1:57492] success Please wait while the node is stopping... Manual channel stop [127.0.0.1:8333] service stopped Inbound channel stop [127.0.0.1:57492] peer disconnect Node stopped successfully.
config::authority class. https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation[network] # block one host incoming/outgoing from/to all ports. blacklist = 209.222.252.42 # block one host incoming/outgoing from/to port 8333. blacklist = 209.222.252.42:8333 # block class C subnet incoming/outgoing from/to all ports. blacklist = 209.222.252.0/24 # block class C subnet incoming/outgoing from/to port 8333. blacklist = 209.222.252.0:8333/24 # allow one host incoming from all ports. whitelist = 209.222.252.42 # allow one host incoming from port 4242. whitelist = 209.222.252.42:4242 # allow class C subnet incoming from all ports. whitelist = 209.222.252.0/24 # allow class C subnet incoming from port 4242. whitelist = 209.222.252.0:4242/24
================= startup Thu Feb 9 00:27:57 2023 ================== Using config file: "bn.cfg" Press CTRL-C to stop the node. Please wait while the node is starting... Bypassed seeding because outbound connections disabled. Accepting up to 10 connections on port 8333. Not configured for outbound connections. Node is started. Dropping blacklisted connection [162.218.65.24:18248] Dropping blacklisted connection [162.218.65.31:23281] Dropping blacklisted connection [188.166.69.73:43191] Peer [185.220.101.184:28069] protocol version (70016) user agent: /Satoshi:24.0.0/ Inbound channel start [185.220.101.184:28069] success Sending (1000) addresses to [185.220.101.184:28069] Inbound channel stop [185.220.101.184:28069] peer disconnect Dropping blacklisted connection [162.218.65.24:14308] Dropping blacklisted connection [162.218.65.31:17041] Dropping blacklisted connection [162.218.65.31:16394] Dropping blacklisted connection [162.218.65.31:63358] Dropping blacklisted connection [162.218.65.31:5248] Dropping blacklisted connection [162.218.65.31:37596] Dropping blacklisted connection [162.218.65.31:63656] Dropping blacklisted connection [162.218.65.24:5154] Dropping blacklisted connection [162.218.65.31:27888] Dropping blacklisted connection [162.218.65.31:54807] Dropping blacklisted connection [162.218.65.31:27783] Dropping blacklisted connection [162.218.65.31:39967] Dropping blacklisted connection [162.218.65.31:39529] Dropping blacklisted connection [162.218.65.24:38102] Dropping blacklisted connection [162.218.65.31:6165] Dropping blacklisted connection [162.218.65.24:54071] Dropping blacklisted connection [162.218.65.31:57533] Dropping blacklisted connection [162.218.65.24:10376] Dropping blacklisted connection [162.218.65.31:51198] Dropping blacklisted connection [162.218.65.24:3481] Dropping blacklisted connection [162.218.65.31:48515] Dropping blacklisted connection [162.218.65.24:62271] Peer [88.99.167.175:35307] protocol version (70016) user agent: /bitnodes.io:0.3/ Dropping blacklisted connection [162.218.65.31:54326] Dropping blacklisted connection [162.218.65.24:52904] Inbound channel start [88.99.167.175:35307] success Inbound channel stop [88.99.167.175:35307] peer disconnect Dropping blacklisted connection [162.218.65.31:10826] Dropping blacklisted connection [162.218.65.24:38934] Dropping blacklisted connection [162.218.65.31:42167] Dropping blacklisted connection [162.218.65.24:18184] Dropping blacklisted connection [162.218.65.31:43590] Dropping blacklisted connection [162.218.65.24:56634] Dropping blacklisted connection [162.218.65.31:39968] Dropping blacklisted connection [162.218.65.24:42574] Dropping blacklisted connection [162.218.65.31:26926] Dropping blacklisted connection [162.218.65.24:50835] Dropping blacklisted connection [162.218.65.31:44381] Dropping blacklisted connection [162.218.65.24:7831] Dropping blacklisted connection [162.218.65.31:64237] Dropping blacklisted connection [162.218.65.24:39074] Dropping blacklisted connection [162.218.65.31:41292] Dropping blacklisted connection [162.218.65.24:34834] Dropping blacklisted connection [162.218.65.31:40323] Dropping blacklisted connection [162.218.65.24:4489] Dropping blacklisted connection [162.218.65.31:7271] Dropping blacklisted connection [162.218.65.24:17343] Dropping blacklisted connection [162.218.65.31:32737] Dropping blacklisted connection [162.218.65.24:59027] Dropping blacklisted connection [162.218.65.31:40058] Dropping blacklisted connection [162.218.65.24:21570] Dropping blacklisted connection [162.218.65.31:62057] Dropping blacklisted connection [162.218.65.24:22570] Dropping blacklisted connection [162.218.65.31:40824] Dropping blacklisted connection [162.218.65.24:62587] Dropping blacklisted connection [162.218.65.31:34703] Dropping blacklisted connection [162.218.65.24:11505] Dropping blacklisted connection [162.218.65.31:63285] Dropping blacklisted connection [162.218.65.24:15993] Dropping blacklisted connection [162.218.65.31:64586]
[network] # /bitnodes.earn.com:0.1/ sends unsolicited addresses. blacklist = 188.166.69.73 # /nodes.mom.market:0.2/ sends unversioned sendaddrv2. blacklist = 94.237.44.67 # /Satoshi:21.99.0/ sends unversioned sendaddrv2. blacklist = 173.48.121.181 # wallet networks that constantly drop and reconnect blacklist = 209.222.252.0/24 blacklist = 162.218.65.0/24 blacklist = 91.198.115.0/24
# en.wikipedia.org/wiki/Private_network blacklist = 10.0.0.0/8 blacklist = 127.0.0.0/8 blacklist = 172.16.0.0/12 blacklist = 192.168.0.0/16 blacklist = 169.254.0.0/16 blacklist = 100.64.0.0/10 blacklist = [fd00::]/8 blacklist = [fe80::]/10 blacklist = [::1](edited)
Accepted (0 of 1 of 1) addresses from [68.105.220.26:8333]. Dropping not whitelisted connection [209.222.252.85:64448] Dropping not whitelisted connection [209.222.252.217:15312] Accepted (0 of 2 of 2) addresses from [54.212.175.16:8333]. Dropping not whitelisted connection [209.222.252.70:33723] Dropping not whitelisted connection [209.222.252.85:37115] Dropping not whitelisted connection [209.222.252.217:32660] Dropping not whitelisted connection [88.99.167.175:15149] Accepted (0 of 1 of 1) addresses from [81.170.255.240:8333]. Dropping not whitelisted connection [209.222.252.70:26772] Accepted (1 of 4 of 4) addresses from [47.203.150.77:8333]. Accepted (0 of 1 of 1) addresses from [81.6.45.155:8333]. Dropping not whitelisted connection [209.222.252.85:30428] Dropping not whitelisted connection [209.222.252.217:31736] Accepted (0 of 1 of 1) addresses from [77.0.64.205:8333]. Accepted (0 of 1 of 1) addresses from [88.67.80.89:8333]. Accepted (0 of 1 of 1) addresses from [207.182.146.85:8333]. Accepted (0 of 1 of 1) addresses from [66.38.94.13:8333]. Accepted (0 of 1 of 1) addresses from [185.209.70.17:8333]. Dropping not whitelisted connection [209.222.252.70:26812] Accepted (0 of 2 of 2) addresses from [38.114.113.52:8333]. Dropping not whitelisted connection [209.222.252.85:12199] Dropping not whitelisted connection [209.222.252.217:64097] Accepted (0 of 1 of 1) addresses from [34.222.125.43:8333]. Accepted (0 of 1 of 1) addresses from [174.89.180.238:8333]. Accepted (0 of 1 of 1) addresses from [65.21.142.118:8333]. Dropping not whitelisted connection [209.222.252.70:18069] Dropping not whitelisted connection [209.222.252.85:57776] Dropping not whitelisted connection [209.222.252.217:52986] Accepted (0 of 1 of 1) addresses from [47.149.172.35:8333]. Accepted (0 of 1 of 1) addresses from [99.29.112.187:8333]. Accepted (0 of 1 of 1) addresses from [144.76.58.238:8333]. Accepted (0 of 1 of 1) addresses from [185.140.253.169:8333]. Dropping not whitelisted connection [209.222.252.70:61538] Dropping not whitelisted connection [209.222.252.85:22483] Dropping not whitelisted connection [209.222.252.217:36892] Accepted (0 of 1 of 1) addresses from [99.6.8.35:8333]. Accepted (1 of 3 of 3) addresses from [184.147.137.197:8333]. Accepted (0 of 1 of 1) addresses from [14.200.28.19:8333]. Dropping not whitelisted connection [209.222.252.70:34006] Dropping not whitelisted connection [209.222.252.85:61254] Accepted (0 of 1 of 1) addresses from [111.90.158.46:8333]. Dropping not whitelisted connection [209.222.252.217:62302]
[network] whitelist = 127.0.0.1 whitelist = 209.237.0.0/16 whitelist = 94.0.0.0/8 whitelist = 188.166.69.0/24 whitelist = 173.0.0.0/8

// C++11: use std::regex.
using namespace boost;
// en.wikipedia.org/wiki/List_of_URI_schemes
// Schemes of p2p network and our zeromq endpoints.
#define SCHEME "(tcp|udp|http|https|inproc):\\/\\/"
#define IPV4 "([0-9.]+)"
#define IPV6 "\\[([0-9a-f:]+)]"
#define HOST "([^:?/\\\\]+)"
#define PORT ":([1-9][0-9]{0,4})"
#define CIDR "\\/([1-9][0-9]{0,2})"
// Excludes ipv4 mapped, unbracketed, and ports allowed by make_address.
bool parse_host(asio::address& ip, const std::string& value) NOEXCEPT
{
static const regex regular
{
"^(" IPV4 "|" IPV6 ")$"
};
sregex_iterator token{ value.begin(), value.end(), regular }, end{};
return token != end
&& make_address(ip, (*token)[1]);
}
// Excludes ipv4 mapped to ipv6.
bool parse_authority(asio::address& ip, uint16_t& port, uint8_t& cidr,
const std::string& value) NOEXCEPT
{
static const regex regular
{
"^(" IPV4 "|" IPV6 ")(" PORT ")?(" CIDR ")?$"
};
sregex_iterator token{ value.begin(), value.end(), regular }, end{};
return token != end
&& make_address(ip, (*token)[1])
&& to_integer(port, (*token)[5])
&& to_integer(cidr, (*token)[7])
&& ((ip.is_v4() && cidr <= maximum_cidr_ip4) ||
(ip.is_v6() && cidr <= maximum_cidr_ip6));
}
// Excludes ipv4 mapped to ipv6.
bool parse_endpoint(std::string& scheme, std::string& host, uint16_t& port,
const std::string& value) NOEXCEPT
{
static const regex regular
{
"^(" SCHEME ")?(" IPV4 "|" IPV6 "|" HOST ")(" PORT ")?$"
};
sregex_iterator token{ value.begin(), value.end(), regular }, end{};
return token != end
&& to_string(scheme, (*token)[2])
&& to_string(host, (*token)[3])
&& to_integer(port, (*token)[8]);
}
Outbound [177.5.100.90:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Channel count (480). Outbound [34.172.31.246:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [85.250.100.142:8333] protocol version (70016) user agent: /Satoshi:24.0.1/ Outbound [73.108.249.219:8333] protocol version (70016) user agent: /Satoshi:0.21.1/ Outbound [45.13.7.221:8333] protocol version (70016) user agent: /Satoshi:24.0.0/ Outbound [178.63.52.205:8333] protocol version (70015) user agent: /Satoshi:0.19.1/ Outbound [168.119.86.21:8333] protocol version (70016) user agent: /Satoshi:0.21.1/ Outbound [173.249.56.164:8333] protocol version (70016) user agent: /Satoshi:24.0.1/ Outbound [70.233.173.241:8333] protocol version (70016) user agent: /Satoshi:24.0.0/ Outbound [200.150.112.190:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [34.106.249.67:8333] protocol version (70015) user agent: /Satoshi:0.20.1/ Outbound [109.248.251.140:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [178.62.15.92:8333] protocol version (70016) user agent: /Satoshi:0.21.1/ Outbound [136.244.65.212:8333] protocol version (70015) user agent: /Satoshi:0.19.99/ Outbound [54.159.193.149:8333] protocol version (70016) user agent: /Satoshi:23.0.0/Knots:20220529/ Outbound [46.28.205.68:8333] protocol version (70015) user agent: /Satoshi:0.17.1/ Outbound [159.100.245.237:8333] protocol version (70016) user agent: /Satoshi:24.0.0/ Outbound [99.237.146.168:8333] protocol version (70016) user agent: /Satoshi:22.0.0(FutureBit-Apollo-Node)/ Outbound [8.210.18.56:8333] protocol version (70015) user agent: /Satoshi:0.20.1/ Outbound [74.91.115.229:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [137.184.186.253:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [63.228.117.99:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [89.244.182.121:8333] protocol version (70016) user agent: /Satoshi:0.21.0/ Outbound [15.204.199.249:8333] protocol version (70016) user agent: /Satoshi:24.0.1/ Channel count (490). Outbound [34.229.155.152:8333] protocol version (70016) user agent: /Satoshi:24.0.1/ Outbound [47.75.194.174:8333] protocol version (70016) user agent: /Satoshi:24.0.1/ Channel count (490). Outbound [23.108.108.110:8333] protocol version (70016) user agent: /Satoshi:0.21.0/ Channel count (490). Outbound [176.9.17.121:8333] protocol version (70016) user agent: /Satoshi:24.0.1/ Outbound [31.104.58.236:8333] protocol version (70016) user agent: /Satoshi:24.0.1/ Outbound [75.176.70.180:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [98.179.228.56:8333] protocol version (70016) user agent: /Satoshi:23.0.0/ Outbound [162.248.95.197:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [173.249.9.243:8333] protocol version (70016) user agent: /Satoshi:24.0.1/ Outbound [86.90.214.244:8333] protocol version (70016) user agent: /Satoshi:24.0.1/ Outbound [161.117.239.176:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [162.55.238.126:8333] protocol version (70016) user agent: /Satoshi:23.0.0/ Outbound [13.231.241.62:8333] protocol version (70015) user agent: /Satoshi:0.20.1(Omni:0.11.0)/ Outbound [217.26.32.10:8333] protocol version (70015) user agent: /Satoshi:0.20.1/ Outbound [62.210.132.30:8333] protocol version (70016) user agent: /Satoshi:23.0.0/ Invalid heading magic (0x48545450) from [192.99.14.77:8333] Outbound [171.96.86.246:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [82.64.247.247:8333] protocol version (70016) user agent: /Satoshi:0.21.1/ Outbound [134.122.38.34:8333] protocol version (70015) user agent: /Satoshi:0.20.1/ Outbound [97.99.5.48:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [83.198.77.75:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [184.101.44.89:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [80.241.209.102:8333] protocol version (70016) user agent: /Satoshi:22.0.0/ Outbound [95.79.53.19:8333] protocol version (70016) user agent: /Satoshi:22.0.0/Knots:20211108/ Channel count (500). Stopping at channel target (500). Please wait while the node is stopping... Closing with (501) channels and (74197) addresses. Node stopped successfully.

connector (speed race between timer and socket connect), session_outbound (quality race between a set of connectors, with the first successful connection winning), and session_seed (volume race, completing when all seed nodes close and sufficient when a target number of addresses is obtained - or all nodes are closed). These then can be easily fully tested and reduced some longstanding complex code to trivial, just a couple lines in each usage. All working well, tests almost done.2023-02-24T06:03:48Z Please wait while the node is stopping...
2023-02-24T06:03:48Z {in:1}{ch:1007}{rv:1007}{nc:1006}{ad:10000}{bs:1007}{ss:5}{cs:1}.
2023-02-24T06:03:48Z {in:1}{ch:1007}{rv:1007}{nc:1006}{ad:10000}{bs:1007}{ss:0}{cs:1}.
2023-02-24T06:03:48Z Inbound channel stop [177.227.58.83:26077] service stopped
2023-02-24T06:03:48Z Manual channel stop [5.14.19.0:8333] service stopped
2023-02-24T06:03:48Z Manual channel stop [65.109.113.126:8333] service stopped
2023-02-24T06:03:48Z Manual channel stop [86.104.228.11:8333] service stopped
2023-02-24T06:03:48Z Manual channel stop [34.222.125.43:8333] service stopped
2023-02-24T06:03:48Z Manual channel stop [89.35.142.168:8333] service stopped
2023-02-24T06:03:48Z Manual channel stop [51.79.80.166:8333] service stopped
2023-02-24T06:03:48Z Node stopped successfully.
2023-02-24T06:03:48Z ====================== shutdown ======================std::istream is always a blocking call and there's no way to unblock it. Terminating absent a successful read implies thread termination, which is process corrupting. So the capture class launches one thread for the blocking read, and another for posting notification and accepting subscriptions via its own internal strand (just like logger). These are set to high priority, so accelerate actions posted via the console, such as stop. Since the threads are almost entirely idle, this has no material impact on the process. The only downside is that in the case of a self-termination (i.e. the node decides it must stop), the process cannot terminate. It just await console input in order to unblock the input thread. So it posts a line to the console (via logger) to hit <enter> to close.
Otherwise the interface is very clean, just construct on std:cin& and subscribe to lines captured from input. It's nice that, at least on win32, a signal such as <ctrl-c> causes both an interrupt and an input event, so there is no need to wait on input. And of course if input terminates (e.g. user types "q" <enter>), then the input can terminate as well. So only on self-termination must it wait. The subscription model allows for input to be written back to the log (explicit and controlled echo). I turn of console echo in construct, as otherwise input text gets interleaved with console output and this is presumably not thread safe.const& though the application. This can be modified by the node class owner, though in some cases the use of the setting would require a notification. So eventually the settings class will carry a subscriber, and any class that accepts settings and wants to update on a change can subscribe to change notification. This would then just require that the setting change be notified by type - which we can now do at the console. Eventually this can be done via an zeromq admin interface. So no restarts for many config changes.2023-02-27T02:22:22Z.8 Node stopped successfully. 2023-02-27T02:22:22Z.8 ====================== shutdown ====================== 2023-02-27T02:22:22Z.8 Press <enter> to exit... <<unhandled exception start>> std::promise<std::error_code>::~promise<std::error_code> -> C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\future(1186) std::promise<std::error_code>::~promise<std::error_code> -> C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\future(1186) libbitcoin::system::main -> D:\Source\evoskuil\libbitcoin-node\console\main.cpp(89) libbitcoin::system::call_utf8_main -> D:\Source\evoskuil\libbitcoin-system\src\unicode\utf8_everywhere\environment.cpp(249) wmain -> D:\Source\evoskuil\libbitcoin-node\console\main.cpp(44) __scrt_common_main_seh -> D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288) <<unhandled exception end>>
.pdb file that provides instrumentation (by default in the same directory).NOEXCEPT on libbitcoin::system::call_utf8_main, which is something I've been concerned about given the pervasive use of NOEXCEPT.