forked from bosagora/agora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.example.yaml
427 lines (391 loc) · 18.4 KB
/
config.example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
################################################################################
## This is a sample, documented configuration file for Agora in YAML format
##
## It is not intended for usage on any network
##
## A node has two interfaces: one for network communication,
## and one for administration.
## The one communicating with the network is public,
## while the administrative is unsecured, disabled by default,
## and should not be exposed to the outside world.
## The administrative one is unsecured and should not be exposed to the outside
## world. It is disabled by default for security purpose.
################################################################################
################################################################################
## Network interface ##
################################################################################
node:
# Minimum number of non-validating nodes to connect to before discovery is
# considered complete
min_listeners: 2
# Maximum number of non-validating nodes to connect to
max_listeners: 10
# Time to wait between retrying requests
retry_delay:
seconds: 3
# Maximum number of retries to issue before a request is considered failed
max_retries: 50
# Timeout for each request
timeout:
msecs: 5000
# Path to the data directory (if the path doesn't exist it will be created)
data_dir: data
# The duration between requests for doing periodic network discovery
network_discovery_interval:
seconds: 5
# The duration between requests for retrieving the latest blocks
# from all other nodes
block_catchup_interval:
seconds: 20
# The maximum number of transactions relayed in every batch.
# Value 0 means no limit.
relay_tx_max_num: 100
# Transaction relay batch is triggered in every `relay_tx_interval`.
# Value 0 means, the transaction will be relayed immediately.
relay_tx_interval:
seconds: 30
# The minimum amount of fee a transaction has to have to be relayed.
# The fee is adjusted by the transaction size:
# adjusted fee = fee / transaction size in bytes.
relay_tx_min_fee: 0
# Transaction put into the relay queue will expire, and will be removed
# after `relay_tx_cache_exp`.
relay_tx_cache_exp:
seconds: 1200
# The percentage by which the double spend transaction's fee should be
# increased in order to be added to the transaction pool
double_spent_threshold_pct: 20
# The minimum percentage of average fee in the pool which the incoming
# transaction should include
min_fee_pct: 80
# Which 'realm' this node is connected to - By default, 'coinnet.bosagora.io'
# Do not change this unless you intend to maintain your own DNS servers,
# or want to join an alternative network.
realm: 'coinnet.bosagora.io'
# Address of the name registry
registry_address: http://127.0.0.1:3003
# Registering a node to public interface includes three configuration options,
# all interfaces are considered as public by default if not configured otherwise;
# 1- Default config
# All public interfaces are registered with their `address` values, if the
# address is 0.0.0.0 then public IP address of the host is used
# 2- Providing a hostname through `register`
# All public interfaces are registered with `register` hostname
# 3- Providing `public_addresses` config
# Interface configuration is ignored and all addresses provided here are
# registered
# (Optional) Hostname for the node to be registered
register: host.test
# (Optional) Addresses for interface to be registered, useful when Agora is
# configured behind a reverse proxy
public_addresses:
- https://proxy.host.test/agora
# Each entry in this array is an interface Agora will listen to, allowing to
# expose the same node on more than one network interface or with different
# API, such as having one interface using HTTP+JSON and the other TCP+binary.
interfaces:
- type: http
# Address to which we bind
address: 0.0.0.0 # Any node can bind - default value
# Port on which we bind
port: 2826 # 0xB0A, default value
# A validator node is required to register at least one of its interfaces
# to public registry, interfaces can be left out from public registry
public: false
- type: http
address: 0.0.0.0
port: 9110
stats: true # Enable stats server on this interface
- type: tcp
address: 0.0.0.0
port: 9220
# Enables proxy protocol v1 for the interface, only applicable for TCP
proxy_proto: true
- type: https
address: 0.0.0.0
port: 2834
# Proxy to be used for outgoing Agora connections
proxy:
url: http://127.0.0.1:8080
################################################################################
## Validator configuration ##
## The server can operate in two modes: full node and validator node. ##
## The full node does not participate in consensus, ##
## it only replicates the state of the blockchain. ##
################################################################################
validator:
# Whether or not we should act as a validator
# When validating, the `seed` of an eligible account is required
# An eligible account has at least 40k coins frozen in it
enabled: true
# This is a randomly generated keypair
# If this node is not a validator, this will be ignored
#
# DO NOT USE THOSE VALUES ANYWHERE
# Public address: boa1xpvald2ydpxzl9aat978kv78y5g24jxy46mcnl7munf4jyhd0zjrc5x62kn
seed: SAUHVPR7O7F2QGLDVXG3DQTVHXESE3ZAWHIIGKT35LCHIPLZBZTAFXJA
# Whether or not the Validator will enroll automatically at the startup or
# at the end of Validator cycle
recurring_enrollment: true
# How often we should check for pre-images to reveal
preimage_reveal_interval:
seconds: 10
# The maximum number (in numbers of block) of pre-image to reveal in advance
# Be default, a validator will reveal the pre-image for block N + 6 when block N
# is externalized, roughly an hour in advance, to prevent slashing
# in case of a short outage.
max_preimage_reveal: 6
# How often the validator should try to catchup for the preimages for the
# next block
preimage_catchup_interval:
seconds: 2
################################################################################
## Flash configuration ##
## Configuration options for the Flash functionality of the node. ##
## ##
################################################################################
flash:
# Whether or not the Flash protocol should be supported
enabled: true
# Timeout for each request
timeout:
msecs: 10000
# Flash name registry address (required)
registry_address: https://flash-registry.bosagora.io
# Network addresses that will be registered with the public key
# If left empty, all public network addresses of the node will be registered
addresses_to_register:
- https://88.88.88.88/flash
- agora://best.flash.node.io:2345/
# Address to the listener which will receive payment / update notifications
listener_address: http://127.0.0.1:4004
# Minimum funding allowed for a channel to be opened (in BOA)
min_funding: 0
# Maximum funding allowed for a channel to be opened (in BOA)
max_funding: 100000
# Minimum number of blocks before settling can begin after a trigger
# transaction has been published
min_settle_time: 6
# Maximum number of blocks afte which settling can begin after a trigger
# transaction has been published
max_settle_time: 144
# How long to re-try a failed payment / update request
# before the request is considered failed and is reported to the listener
# (wallet / etc)
max_retry_time:
msecs: 60000
# The seed to use for the keypair of this node
# This will only be used for paying on-chain fees in uncollaborative close attempts
#
# DO NOT USE THOSE VALUES ANYWHERE
# Public address: boa1xrfl00xmyf28jxnnh2g3xvwgqffx4wxh6sdkn5mvqauygtv3vmpwq93vv77
seed: SBGQOIPUN4FV4TVDHJ7VLZ2NE5AC3G5WRGVKRKM7JO4BH57KE6IQFRZI
################################################################################
## Ban manager configuration ##
################################################################################
banman:
# max failed requests until an address is banned
max_failed_requests: 100
# the default duration of a ban
ban_duration:
days: 1
################################################################################
## Administrative interface ##
################################################################################
admin:
enabled: true # `false` by default
tls: false # Use local tls context - `true` by default
address: 127.0.0.1 # Private
port: 2827 # 0xB0B
username: admin
pwd: someSecret
################################################################################
## Node discovery ##
## ##
## When the network first starts, we need to connect to some peers to learn ##
## the topology and find a safe intersection to listen to, and, if we are ##
## a validator, to insert ourselves. ##
################################################################################
network:
# Supported value: IPv4, IPv6
- http://192.168.1.42:2828
- http://192.168.0.44:2828
dns:
# Supported value: FQDN seed
- seed.bosagora.io
################################################################################
## Logging options ##
## ##
## Our logging system is hierarchical: Logger names are, e.g. `a.b.c.d`. ##
## Inside agora, every module that logs have a module-level logger matching ##
## it's module name, e.g. `agora.node.main`. ##
## ##
## In addition, some modules can have more nested loggers: one such use case ##
## is for a module which deals with client connections, which we'll refer to ##
## as `agora.network.Client` here. Such a module would produce a confusing ##
## output if it was logging all clients interactions at module level, because ##
## such interactions are intertwinned and requests/responses would be hard to ##
## follow. Hence, using a predictable identifier to extend the hierarchy, ##
## such as the public key (when dealing with validators), would lead to the ##
## following loggers: `agora.network.Client.GABC`, ##
## `agora.network.Client.GEFG`, `agora.network.Client.G1234`, etc... ##
## ##
## When configuring loggers, the configuration applies to the referenced ##
## hierarchy and any child. Using the previous example, configuring ##
## `agora.network` will lead to all clients having the same configuration, ##
## as well as the module `agora.network.Foobar`. ##
## ##
## The 'root' name allows to configure the parent of all other loggers. ##
################################################################################
logging:
root:
# Set the log level for the root logger.
# This is the default log level, and is overriden by more specialized configs
#
# Values: Trace, Info, Warn, Error, Fatal, None (default)
level: Info
# Whether to propagate that level to the children
# Default to `true` as this is the expected behavior for most users
propagate: true
# Whether or not to log output to the console
console: true
# Output file to write the logging output to
# Note that output of a more specialized logger that uses another file won't be
# written to this file.
# The path is relative to `data_dir` unless an absolute path is supplied.
# Intermediate directories will be created as needed.
# This setting is optional, as no file would be written to if empty / not supplied.
file: log/root.log
# Whether this logger should be additive or not
additive: true
# Nested logger configuration
# Order does not matter as long as there is no duplication
agora.network:
level: Trace
console: false
file: log/network.log
agora.node:
level: Trace
console: false
file: log/node.log
################################################################################
## Event Handlers ##
################################################################################
event_handlers:
# URLs to push a data when a block is externalized. (path is "/block_externalized")
BlockExternalized:
addresses:
- http://127.0.0.1:3836/block_externalized
# URLs to push a data when a block header is updated. (path is "/block_header_updated")
BlockHeaderUpdated:
addresses:
- http://127.0.0.1:3836/block_header_updated
# URLs to push a data when a pre-image is updated. (path is "/preimage_received")
PreimageReceived:
addresses:
- http://127.0.0.1:3836/preimage_received
# URLs to push a data when a transaction is updated. (path is "/transaction_received")
TransactionReceived:
addresses:
- http://127.0.0.1:3836/transaction_received
################################################################################
## Registry configuration ##
## ##
## The registry is a DNS server used to resolve the address of validators or ##
## Flash nodes. It is also a Full Node (or validator if enabled), as it needs ##
## to validate registration requests. ##
## ##
## The registry is optional, and disabled by default. Enabling it exposes an ##
## extra API for registration, and a DNS server (on port 53 by default). ##
################################################################################
registry:
# If this node should provide public registry interface
public: true
# The address to bind the DNS server to (default: 0.0.0.0)
# On Linux system with systemd, one might want to specify the local IP,
# as systemd-resolvd binds to 127.0.0.53:53, which conflicts with this.
address: 0.0.0.0
# Port to bind to (default: 53, standard DNS port)
# Note that ports < 1024 are privileged ports and might require root powers
port: 53
## The fields below define 3 SOA records, one for each zone required by the network.
##
## Those can typically be left empty, except for the primary server of the zone.
## If non-empty, both `primary` and `email` must be provided.
##
## Others fields are ignored if the server is not authoritative for the zone.
# The zone responsible for validators registration
validators:
# Whether we should consider ourselves authoritative
#
# Authoritative servers should have an NS entry in the parent zone,
# for example the authoritative server for bosagora.io should have:
# NS ns1.bosagora.io.
# NS ns2.bosagora.io.
# By convention, ns1 is the primary (source of truth) and ns2 is a secondary,
# that periodically fetches records from ns1.
# Secondary servers should have `authoritative` set to `true`. Primary servers
# should have `authoritative` unset or set to `true`, and `primary` and `email` set.
authoritative: true
# The *hostname* (not IP address) of authoritative name servers for this zone
# The first entry will be used as primary name server
# for the zone (MNAME field of the SOA record)
#
# If this is set, `email` must be set too. If this isn't set, `email` must be unset.
#
# The value here is typically the hostname of the server itself.
# For example, if the node that read this configuration will be reachable via
# `agora.example.com`, then this string can be used.
# However, the typical naming convention would be to use `ns1.example.com`.
nameservers:
- ns1.bosagora.io
# Whitelist for AXFR zone transfers
#
# Only IPs listed in this field will be allowed to initiate an AXFR zone
# transfer from this server. Server will not allow zone transfer to any
# requester if not configured.
allow_transfer:
- 127.0.0.1
# SOA record for the zone, only applicable for primary servers
soa:
# Email of the DNS server administrator
# This field is required for authoritative servers.
# `email` support DNS-style syntax, that is, using `.` instead of `@`
email: [email protected]
# The rate at which secondary servers will refresh their zones from this server
refresh:
minutes: 1
# Time interval between two retries when a secondary server fails to retrieve data
retry:
seconds: 30
# Initial interval after which the zone data should be purged from cache
expire:
minutes: 10
# The minimum TTL to apply to the zone
minimum:
minutes: 1
# Zone responsible for flash nodes registration
flash:
# Having one or more secondary servers increase redundancy and reduces load,
# hence this configuration, while unlikely in a small to medium network, is supported.
authoritative: true
# Redirect server for REST endpoints of the registry
redirect_register: http://nsHidden.bosagora.io
# List of servers to AXFR zone transfer from
#
# Servers are tried in the configuration order until zone transfer can be
# completed from a server.
query_servers:
- ns1.bosagora.io
# A secondary server can be an upstream of an another server, thus secondary
# servers can also limit AXFR zone transfers from them to a configured
# whitelist
allow_transfer:
- 127.0.0.1
# Zone responsible for realm
realm:
authoritative: false
# List of servers to update records cache from
# Default DNS resolvers are (i.e. 8.8.8.8 / 1.1.1.1) used when not configured
query_servers:
- ns1.bosagora.io