Skip to content
This repository was archived by the owner on Apr 17, 2020. It is now read-only.

Commit 5953a50

Browse files
cdeckerrustyrussell
authored andcommitted
cli: Add command line option to specify the wallet location
Will be demuxed into starting the selected DB backend in one of the next commits. Defaults to the old database location. Signed-off-by: Christian Decker <[email protected]>
1 parent 96a22b4 commit 5953a50

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

doc/lightningd-config.5

+6
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ is a relative path, it is relative to the starting directory, not
149149
readable (we allow missing files in the default case)\. Using this inside
150150
a configuration file is meaningless\.
151151

152+
153+
\fBwallet\fR=\fIDSN\fR
154+
Identify the location of the wallet\. This is a fully qualified data source
155+
name, including a scheme such as \fBsqlite3\fR or \fBpostgres\fR followed by the
156+
connection parameters\.
157+
152158
.SH Lightning node customization options
153159

154160
\fBalias\fR=\fIRRGGBB\fR

doc/lightningd-config.5.md

+5
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ is a relative path, it is relative to the starting directory, not
128128
readable (we allow missing files in the default case). Using this inside
129129
a configuration file is meaningless.
130130

131+
**wallet**=*DSN*
132+
Identify the location of the wallet. This is a fully qualified data source
133+
name, including a scheme such as `sqlite3` or `postgres` followed by the
134+
connection parameters.
135+
131136
### Lightning node customization options
132137

133138
**alias**=*RRGGBB*

lightningd/lightningd.h

+2
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ struct lightningd {
228228
const char *original_directory;
229229

230230
struct plugins *plugins;
231+
232+
char *wallet_dsn;
231233
};
232234

233235
/* Turning this on allows a tal allocation to return NULL, rather than aborting.

lightningd/options.c

+5
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,11 @@ static void handle_minimal_config_opts(struct lightningd *ld,
808808
opt_ignore_talstr, opt_show_charp,
809809
&ld->config_dir,
810810
"Set working directory. All other files are relative to this");
811+
812+
ld->wallet_dsn = tal_fmt(ld, "sqlite3://%s/lightningd.sqlite3", ld->config_dir);
813+
opt_register_early_arg("--wallet", opt_set_talstr, NULL,
814+
&ld->wallet_dsn,
815+
"Location of the wallet database.");
811816
}
812817

813818
static void register_opts(struct lightningd *ld)

0 commit comments

Comments
 (0)