You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This allows the node work directory to be either temporary or
persisting on the disk.
This can be configured using the `tmpdir` and `staticdir` `Conf` options
in different combinations. Usage information in the `Conf` doc.
/// Optionally specify the root of where the temporary directories will be created.
149
-
/// If none and the env var `TEMPDIR_ROOT` is set, the env var is used.
150
-
/// If none and the env var `TEMPDIR_ROOT` is not set, the default temp dir of the OS is used.
151
-
/// It may be useful for example to set to a ramdisk so that bitcoin nodes spawn very fast
152
-
/// because their datadirs are in RAM
170
+
/// Optionally specify a temporary or persistent working directory for the node.
171
+
/// The following two parameters can be configured to simulate desired working directory configuration.
172
+
///
173
+
/// tmpdir is Some() && staticdir is Some() : Error. Cannot be enabled at same time.
174
+
/// tmpdir is Some(temp_path) && staticdir is None : Create temporary directory at `tmpdir` path.
175
+
/// tmpdir is None && staticdir is Some(work_path) : Create persistent directory at `staticdir` path.
176
+
/// tmpdir is None && staticdir is None: Creates a temporary directory in OS default temporary directory (eg /tmp) or `TEMPDIR_ROOT` env variable path.
177
+
///
178
+
/// It may be useful for example to set to a ramdisk via `TEMPDIR_ROOT` env option so that
179
+
/// bitcoin nodes spawn very fast because their datadirs are in RAM. Should not be enabled with persistent
180
+
/// mode, as it cause memory overflows.
181
+
182
+
/// Temporary directory path
153
183
pubtmpdir:Option<PathBuf>,
154
184
185
+
/// Persistent directory path
186
+
pubstaticdir:Option<PathBuf>,
187
+
155
188
/// Try to spawn the process `attempt` time
156
189
///
157
190
/// The OS is giving available ports to use, however, they aren't booked, so it could rarely
@@ -168,6 +201,7 @@ impl Default for Conf<'_> {
168
201
p2p:P2P::No,
169
202
network:"regtest",
170
203
tmpdir:None,
204
+
staticdir:None,
171
205
attempts:3,
172
206
}
173
207
}
@@ -183,16 +217,19 @@ impl BitcoinD {
183
217
184
218
/// Launch the bitcoind process from the given `exe` executable with given [Conf] param
0 commit comments