mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
add --conf parameter
This commit is contained in:
parent
cf12130627
commit
97118c558e
@ -2,12 +2,12 @@
|
|||||||
.\" Title: lightningd-config
|
.\" Title: lightningd-config
|
||||||
.\" Author: [see the "AUTHOR" section]
|
.\" Author: [see the "AUTHOR" section]
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||||
.\" Date: 06/23/2018
|
.\" Date: 07/12/2018
|
||||||
.\" Manual: \ \&
|
.\" Manual: \ \&
|
||||||
.\" Source: \ \&
|
.\" Source: \ \&
|
||||||
.\" Language: English
|
.\" Language: English
|
||||||
.\"
|
.\"
|
||||||
.TH "LIGHTNINGD\-CONFIG" "5" "06/23/2018" "\ \&" "\ \&"
|
.TH "LIGHTNINGD\-CONFIG" "5" "07/12/2018" "\ \&" "\ \&"
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
.\" * Define some portability stuff
|
.\" * Define some portability stuff
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
@ -168,6 +168,11 @@ Set JSON\-RPC socket (or /dev/tty), such as for lightning\-cli(1)\&.
|
|||||||
.RS 4
|
.RS 4
|
||||||
Run in the background, suppress stdout and stderr\&.
|
Run in the background, suppress stdout and stderr\&.
|
||||||
.RE
|
.RE
|
||||||
|
.PP
|
||||||
|
\fBconf\fR=\fIPATH\fR
|
||||||
|
.RS 4
|
||||||
|
Sets configuration file\&. Relative paths will be prefixed by lightning\-dir location\&. (default: config)
|
||||||
|
.RE
|
||||||
.sp
|
.sp
|
||||||
Lightning node customization options:
|
Lightning node customization options:
|
||||||
.PP
|
.PP
|
||||||
|
@ -91,7 +91,7 @@ Bitcoin control options:
|
|||||||
|
|
||||||
*rescan*='BLOCKS'::
|
*rescan*='BLOCKS'::
|
||||||
Number of blocks to rescan from the current head, or absolute blockheight
|
Number of blocks to rescan from the current head, or absolute blockheight
|
||||||
if negative. This is only needed if something goes badly wrong.
|
if negative. This is only needed if something goes badly wrong.
|
||||||
|
|
||||||
Lightning daemon options:
|
Lightning daemon options:
|
||||||
|
|
||||||
@ -117,6 +117,9 @@ Lightning daemon options:
|
|||||||
*daemon*::
|
*daemon*::
|
||||||
Run in the background, suppress stdout and stderr.
|
Run in the background, suppress stdout and stderr.
|
||||||
|
|
||||||
|
*conf*='PATH'::
|
||||||
|
Sets configuration file. Relative paths will be prefixed by lightning-dir location. (default: config)
|
||||||
|
|
||||||
Lightning node customization options:
|
Lightning node customization options:
|
||||||
|
|
||||||
*rgb*='RRGGBB'::
|
*rgb*='RRGGBB'::
|
||||||
|
@ -80,6 +80,7 @@ static struct lightningd *new_lightningd(const tal_t *ctx)
|
|||||||
timers_init(&ld->timers, time_mono());
|
timers_init(&ld->timers, time_mono());
|
||||||
ld->topology = new_topology(ld, ld->log);
|
ld->topology = new_topology(ld, ld->log);
|
||||||
ld->daemon = false;
|
ld->daemon = false;
|
||||||
|
ld->config_filename = NULL;
|
||||||
ld->pidfile = NULL;
|
ld->pidfile = NULL;
|
||||||
ld->ini_autocleaninvoice_cycle = 0;
|
ld->ini_autocleaninvoice_cycle = 0;
|
||||||
ld->ini_autocleaninvoice_expiredby = 86400;
|
ld->ini_autocleaninvoice_expiredby = 86400;
|
||||||
|
@ -80,6 +80,8 @@ struct lightningd {
|
|||||||
char *config_dir;
|
char *config_dir;
|
||||||
char *rpc_filename;
|
char *rpc_filename;
|
||||||
|
|
||||||
|
/* Configuration file name */
|
||||||
|
char *config_filename;
|
||||||
/* Configuration settings. */
|
/* Configuration settings. */
|
||||||
struct config config;
|
struct config config;
|
||||||
|
|
||||||
|
@ -339,6 +339,9 @@ static char *opt_set_locktime(const char *arg, u32 *u)
|
|||||||
|
|
||||||
static void config_register_opts(struct lightningd *ld)
|
static void config_register_opts(struct lightningd *ld)
|
||||||
{
|
{
|
||||||
|
opt_register_early_arg("--conf=<file>", opt_set_talstr, NULL,
|
||||||
|
&ld->config_filename,
|
||||||
|
"Specify configuration file. Relative paths will be prefixed by lightning-dir location. (default: config)");
|
||||||
opt_register_noarg("--daemon", opt_set_bool, &ld->daemon,
|
opt_register_noarg("--daemon", opt_set_bool, &ld->daemon,
|
||||||
"Run in the background, suppress stdout/stderr");
|
"Run in the background, suppress stdout/stderr");
|
||||||
opt_register_arg("--ignore-fee-limits", opt_set_bool_arg, opt_show_bool,
|
opt_register_arg("--ignore-fee-limits", opt_set_bool_arg, opt_show_bool,
|
||||||
@ -697,10 +700,14 @@ static void opt_parse_from_config(struct lightningd *ld)
|
|||||||
char *argv[3];
|
char *argv[3];
|
||||||
int i, argc;
|
int i, argc;
|
||||||
|
|
||||||
contents = grab_file(ld, "config");
|
if (ld->config_filename != NULL) {
|
||||||
/* Doesn't have to exist. */
|
contents = grab_file(ld, ld->config_filename);
|
||||||
|
} else
|
||||||
|
contents = grab_file(ld, "config");
|
||||||
|
/* The default config doesn't have to exist, but if the config was
|
||||||
|
* specified on the command line it has to exist. */
|
||||||
if (!contents) {
|
if (!contents) {
|
||||||
if (errno != ENOENT)
|
if ((errno != ENOENT) || (ld->config_filename != NULL))
|
||||||
fatal("Opening and reading config: %s",
|
fatal("Opening and reading config: %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
/* Now we can set up defaults, since no config file. */
|
/* Now we can set up defaults, since no config file. */
|
||||||
|
Loading…
Reference in New Issue
Block a user