Skip to content

Commit dfdc777

Browse files
committed
Optimize default configuration for first use.
1 parent 93634f2 commit dfdc777

File tree

3 files changed

+39
-39
lines changed

3 files changed

+39
-39
lines changed

data/bn.cfg

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ debug_file = debug.log
77
error_file = error.log
88
# The log archive directory, defaults to 'archive'.
99
archive_directory = archive
10-
# The size at which a log is archived, defaults to 0 (disabled).
11-
rotation_size = 0
10+
# The size at which a log is archived, defaults to 10000000 (0 disables).
11+
rotation_size = 10000000
1212
# The minimum free space required in the archive directory, defaults to 0.
1313
minimum_free_space = 0
1414
# The maximum combined size of archived logs, defaults to 0 (maximum).
@@ -35,10 +35,10 @@ identifier = 3652501241
3535
validate_checksum = false
3636
# The port for incoming connections, defaults to 8333 (use 18333 for testnet).
3737
inbound_port = 8333
38-
# The target number of incoming network connections, defaults to 8.
39-
inbound_connections = 8
40-
# The target number of outgoing network connections, defaults to 8.
41-
outbound_connections = 8
38+
# The target number of incoming network connections, defaults to 0.
39+
inbound_connections = 0
40+
# The target number of outgoing network connections, defaults to 2.
41+
outbound_connections = 2
4242
# The attempt limit for manual connection establishment, defaults to 0 (forever).
4343
manual_attempt_limit = 0
4444
# The number of concurrent attempts to establish one connection, defaults to 5.
@@ -51,8 +51,8 @@ channel_handshake_seconds = 30
5151
channel_heartbeat_minutes = 5
5252
# The inactivity time limit for any connection, defaults to 30.
5353
channel_inactivity_minutes = 30
54-
# The age limit for any connection, defaults to 1440.
55-
channel_expiration_minutes = 1440
54+
# The age limit for any connection, defaults to 60.
55+
channel_expiration_minutes = 60
5656
# The time limit for obtaining seed addresses, defaults to 30.
5757
channel_germination_seconds = 30
5858
# The maximum number of peer hosts in the pool, defaults to 1000.
@@ -91,8 +91,8 @@ file_growth_rate = 50
9191
block_table_buckets = 650000
9292
# Transaction hash table size, defaults to 110000000.
9393
transaction_table_buckets = 110000000
94-
# The maximum number of entries in the unspent outputs cache, defaults to 0.
95-
cache_capacity = 0
94+
# The maximum number of entries in the unspent outputs cache, defaults to 10000.
95+
cache_capacity = 10000
9696

9797
[blockchain]
9898
# The number of cores dedicated to block validation, defaults to 0 (physical cores).
@@ -154,7 +154,7 @@ bip90 = true
154154
block_poll_seconds = 1
155155
# The minimum fee per byte required for transaction acceptance, defaults to 1.
156156
minimum_byte_fee_satoshis = 1
157-
# Request that peers relay transactions, defaults to true.
158-
relay_transactions = true
157+
# Request that peers relay transactions, defaults to false.
158+
relay_transactions = false
159159
# Request transactions on each channel start, defaults to true.
160160
refresh_transactions = true

include/bitcoin/node/parser.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class BCN_API parser
3333
: public config::parser
3434
{
3535
public:
36-
parser(const config::settings& context);
36+
parser(config::settings context);
3737
parser(const configuration& defaults);
3838

3939
/// Parse all configuration into member settings.

src/parser.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ parser::parser(const configuration& defaults)
4646
}
4747

4848
// Initialize configuration using defaults of the given context.
49-
parser::parser(const config::settings& context)
49+
parser::parser(config::settings context)
5050
: configured(context)
5151
{
52-
// A node doesn't require history, and history is expensive.
52+
// A node doesn't use history, and history is expensive.
5353
configured.database.index_start_height = max_uint32;
5454

55-
// A node allows 8 inbound connections by default.
56-
configured.network.inbound_connections = 8;
55+
// Logs will slow things if not rotated.
56+
configured.network.rotation_size = 10000000;
57+
58+
// With block-first sync the count should be low until complete.
59+
configured.network.outbound_connections = 2;
5760

5861
// A node allows 1000 host names by default.
5962
configured.network.host_pool_capacity = 1000;
6063

61-
// A node requests transaction relay by default.
62-
configured.network.relay_transactions = true;
63-
6464
// A node exposes full node (1) network services by default.
6565
configured.network.services = message::version::service::node_network;
6666
}
@@ -149,7 +149,7 @@ options_metadata parser::load_settings()
149149
(
150150
"log.rotation_size",
151151
value<size_t>(&configured.network.rotation_size),
152-
"The size at which a log is archived, defaults to 0 (disabled)."
152+
"The size at which a log is archived, defaults to 10000000 (0 disables)."
153153
)
154154
(
155155
"log.minimum_free_space",
@@ -215,12 +215,12 @@ options_metadata parser::load_settings()
215215
(
216216
"network.inbound_connections",
217217
value<uint32_t>(&configured.network.inbound_connections),
218-
"The target number of incoming network connections, defaults to 8."
218+
"The target number of incoming network connections, defaults to 0."
219219
)
220220
(
221221
"network.outbound_connections",
222222
value<uint32_t>(&configured.network.outbound_connections),
223-
"The target number of outgoing network connections, defaults to 8."
223+
"The target number of outgoing network connections, defaults to 2."
224224
)
225225
(
226226
"network.manual_attempt_limit",
@@ -255,7 +255,7 @@ options_metadata parser::load_settings()
255255
(
256256
"network.channel_expiration_minutes",
257257
value<uint32_t>(&configured.network.channel_expiration_minutes),
258-
"The age limit for any connection, defaults to 1440."
258+
"The age limit for any connection, defaults to 60."
259259
)
260260
(
261261
"network.channel_germination_seconds",
@@ -322,7 +322,7 @@ options_metadata parser::load_settings()
322322
(
323323
"database.cache_capacity",
324324
value<uint32_t>(&configured.database.cache_capacity),
325-
"The maximum number of entries in the unspent outputs cache, defaults to 0."
325+
"The maximum number of entries in the unspent outputs cache, defaults to 10000."
326326
)
327327

328328
/* [blockchain] */
@@ -395,38 +395,38 @@ options_metadata parser::load_settings()
395395
)
396396

397397
/* [node] */
398-
(
399-
"node.sync_peers",
400-
value<uint32_t>(&configured.node.sync_peers),
401-
"The maximum number of initial block download peers, defaults to 0 (physical cores)."
402-
)
403-
(
404-
"node.sync_timeout_seconds",
405-
value<uint32_t>(&configured.node.sync_timeout_seconds),
406-
"The time limit for block response during initial block download, defaults to 5."
407-
)
398+
////(
399+
//// "node.sync_peers",
400+
//// value<uint32_t>(&configured.node.sync_peers),
401+
//// "The maximum number of initial block download peers, defaults to 0 (physical cores)."
402+
////)
403+
////(
404+
//// "node.sync_timeout_seconds",
405+
//// value<uint32_t>(&configured.node.sync_timeout_seconds),
406+
//// "The time limit for block response during initial block download, defaults to 5."
407+
////)
408408
(
409409
"node.block_poll_seconds",
410410
value<uint32_t>(&configured.node.block_poll_seconds),
411411
"The time period for block polling after initial block download, defaults to 1 (0 disables)."
412412
)
413413
(
414-
/* Internally this is blockchain, but it is conceptually a node setting.*/
414+
/* Internally this is blockchain, but it is conceptually a node setting. */
415415
"node.minimum_byte_fee_satoshis",
416416
value<float>(&configured.chain.minimum_byte_fee_satoshis),
417417
"The minimum fee per byte required for transaction acceptance, defaults to 1."
418418
)
419419
////(
420-
//// /* Internally this blockchain, but it is conceptually a node setting.*/
420+
//// /* Internally this blockchain, but it is conceptually a node setting. */
421421
//// "node.reject_conflicts",
422422
//// value<bool>(&configured.chain.reject_conflicts),
423423
//// "Retain only the first seen of conflicting transactions, defaults to true."
424424
////)
425425
(
426-
/* Internally this network, but it is conceptually a node setting.*/
426+
/* Internally this network, but it is conceptually a node setting. */
427427
"node.relay_transactions",
428428
value<bool>(&configured.network.relay_transactions),
429-
"Request that peers relay transactions, defaults to true."
429+
"Request that peers relay transactions, defaults to false."
430430
)
431431
(
432432
"node.refresh_transactions",

0 commit comments

Comments
 (0)