22 Commits

Author SHA1 Message Date
tomFlowee f2b59b7737 Make logging code compile with more defines
This allows compile with BCH_NO_INFO_OUTPUT define, which removes
from the compiled binary all info level logging.
2026-01-14 18:23:19 +01:00
tomFlowee bb7275466b Stop using deprecated asio io_service
This ports the io-service to the source compatible io-context
class, with the most work going to the WorkerThreads which owns
that one.
2025-02-08 19:05:26 +01:00
tomFlowee 69b3d78e19 Making the ssl unit test work. 2024-08-20 22:46:48 +02:00
tomFlowee 712dcdb3a6 Start to implement the ssl server. 2024-08-11 18:49:35 +02:00
tomFlowee 210fef16cc Start making space for an ssl backend. 2024-08-11 18:49:35 +02:00
tomFlowee 4fe9d69e7b Use more specific define-guards 2024-01-24 21:03:58 +01:00
tomFlowee c8ed2ec382 Make compile 2022-01-22 23:27:29 +01:00
tomFlowee 2b6b3a3d5a Fix api docs. 2021-06-26 22:17:46 +02:00
tomFlowee ae78dd0bb8 Update email address 2021-06-20 22:44:44 +02:00
tomFlowee 4d5e7bfb09 Protect node with user-limits for the API.
This introduces several options for public node operators to limit their
nodes usage by 3rd parties, this is aimed at usage of resource-hungry
areas.

We allow limiting the amount of connections any single IP can keep open
with us.
We limit the amount of reconnects we allow in a short number of seconds.
We allow limiting the number of addresses (or scriptHashes) a peer can
register for the node to scan.
The last one is for both the addressMonitorService as well as for the
getBlock filters.

For node operators these items become available using command line
options or config-file options. By default these limits are unlimited as
we assume default usage to be private.
2021-02-26 15:14:14 +01:00
TomZ 3dbb2672b9 Api Docs 2021-02-22 15:53:32 +01:00
TomZ bf24ed042b Add support for legacy p2p network envelope in networkmanager 2020-03-29 12:55:12 +02:00
TomZ 191bc3758d Add a simpliefied NetworkManager::bind() method
One that doesn't require a callback to be passed in.
2019-08-24 22:25:10 +02:00
TomZ 38b4e8b189 Allow hubs -apibind to use 'localhost' string
The command really only accepts IP addresses, but we use 'localhost' as
an exception to bind to loopback for ipv4 and ipv6 at the same time.

Also improve logging of errors and avoid failing to start the API
service if a bind address wasn't an IP.
2019-05-24 23:14:15 +02:00
TomZ 6cc433c589 Make usage of NetworkConnection::accept() clear
I added some docs to bind() that handlers there should call
accept().
Also made sure that when nobody accepts a connection it actually
gets disconnected instead of just being ignored.
2019-04-10 14:28:33 +02:00
TomZ ccd66a49b2 Document and refactor NetworkService
The main goal of this is to make sure that network services
implementations don't reuse one bufferpool for all their remotes as that
can cause threading issues.
One bufferpool per remote is now made easy.
2019-04-09 17:24:38 +02:00
TomZ c8108f387c Drop API login requirement and api-cookie argument 2019-03-27 18:55:13 +01:00
TomZ 0d3d9f0efb Add NetworkManager::setAutoApiLogin() method.
Make sure that clients can do login to the API by doing nothing more
than pointing to the filename of the api-cookie.
2018-02-17 23:33:23 +01:00
TomZ 72593ea6a5 Merge branch 'master' into pos 2018-02-17 19:02:18 +01:00
TomZ 95325d5cdb Be consistent; lowercase the networkmanager dir. 2018-02-16 12:36:51 +01:00
TomZ 8cfacf219b Add NetworkService class 2018-02-16 12:32:08 +01:00
TomZ 7e737c8ea8 Start library/networkmanger 2018-02-14 13:49:53 +01:00