-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.nix
210 lines (209 loc) · 7.79 KB
/
options.nix
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
{ lib, ... }:
let
mkOption = lib.mkOption;
types = lib.types;
in
{
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to enable the Babylon node service.";
};
config = mkOption {
default = { };
type = types.submodule {
options = {
network = mkOption {
default = { };
type = types.submodule {
options = {
id = mkOption {
type = types.int;
default = 1;
description = "The ID of the network to connect to (Mainnet=1, Stokenet=2)";
};
host_ip = mkOption {
type = types.str;
default = "";
description = "The IP address of the host machine";
};
p2p = mkOption {
default = { };
type = types.submodule {
options = {
listen_port = mkOption {
type = types.int;
default = 30000;
description = "The gossop port for listening";
};
broadcast_port = mkOption {
type = types.int;
default = 30000;
description = "The gossip port for broadcasting";
};
seed_nodes = mkOption {
type = types.listOf (types.str);
default = [
"radix://node_rdx1qf2x63qx4jdaxj83kkw2yytehvvmu6r2xll5gcp6c9rancmrfsgfw0vnc65@babylon-mainnet-eu-west-1-node0.radixdlt.com"
"radix://node_rdx1qgxn3eeldj33kd98ha6wkjgk4k77z6xm0dv7mwnrkefknjcqsvhuu4gc609@babylon-mainnet-ap-southeast-2-node0.radixdlt.com"
"radix://node_rdx1qwrrnhzfu99fg3yqgk3ut9vev2pdssv7hxhff80msjmmcj968487uugc0t2@babylon-mainnet-ap-south-1-node0.radixdlt.com"
"radix://node_rdx1q0gnmwv0fmcp7ecq0znff7yzrt7ggwrp47sa9pssgyvrnl75tvxmvj78u7t@babylon-mainnet-us-east-1-node0.radixdlt.com"
];
description = "A list of network seed nodes. The defaults specified are the mainnet seed nodes.";
};
};
};
};
};
};
};
node = mkOption {
default = { };
type = types.submodule {
options = {
key = mkOption {
default = { };
type = types.submodule {
options = {
path = mkOption {
type = types.path;
default = "";
description = "The path to the node key file";
};
create_if_missing = mkOption {
type = types.bool;
default = false;
description = "Create a new key if the key file is missing";
};
};
};
};
};
};
};
db = mkOption {
default = { };
type = types.submodule {
options = {
location = mkOption {
type = types.path;
default = "";
description = "The path to the database";
};
local_transaction_execution_index.enable = mkOption {
type = types.bool;
default = true;
description = "An additional ledger index for transaction data";
};
account_change_index.enable = mkOption {
type = types.bool;
default = true;
description = "An additional ledger index for transactions that change accounts";
};
};
};
};
api = mkOption {
default = { };
type = types.submodule {
options = {
core = mkOption {
default = { };
type = types.submodule {
options = {
bind_address = mkOption {
type = types.str;
default = "127.0.0.1";
description = "The address to bind the core API to";
};
port = mkOption {
type = types.int;
default = 3333;
description = "The port to bind the core API to";
};
flags.enable_unbounded_endpoints = mkOption {
type = types.bool;
default = true;
description = "Allows to disable a subset of Core API endpoints whose responses are potentially unbounded";
};
};
};
};
system = mkOption {
default = { };
type = types.submodule {
options = {
bind_address = mkOption {
type = types.str;
default = "127.0.0.1";
description = "The address to bind the system API to";
};
port = mkOption {
type = types.int;
default = 3334;
description = "The port to bind the system API to";
};
};
};
};
prometheus = mkOption {
default = { };
type = types.submodule {
options = {
bind_address = mkOption {
type = types.str;
default = "127.0.0.1";
description = "The address to bind the Prometheus API to";
};
port = mkOption {
type = types.int;
default = 3335;
description = "The port to bind the Prometheus API to";
};
};
};
};
};
};
};
run_with = mkOption {
default = { };
type = types.submodule {
options = {
user = mkOption {
type = types.str;
default = "babylon-node";
description = "The user to run the service as";
};
group = mkOption {
type = types.str;
default = "babylon-node";
description = "The group to run the service as";
};
java_option_overrides = mkOption {
type = types.str;
default = "";
description = "Java option overrides";
example = "-Xms12g -Xmx12g";
};
keystore_password_file = mkOption {
type = types.str;
default = "";
description = "A file that contains the keystore password in cleartext.";
};
# I'm not sure whether it is possible to override the directory where log files
# are written, so it is not currently an option you can set.
# For that reason, it is important to set the working directory to a directory where the service has write permissions,
# else the service will not be able to write log files and it will fail to start.
working_directory = mkOption {
type = types.str;
default = "/home/babylon-node";
description = "The working directory for the service. The service writes log files to this directory.";
};
};
};
};
};
};
};
}