-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathxud-backup
executable file
·80 lines (74 loc) · 1.79 KB
/
xud-backup
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
#!/usr/bin/env node
const Backup = require('../dist/backup/Backup').default;
const { argv } = require('yargs')
.options({
backupdir: {
describe: 'Data directory for backups',
type: 'string',
alias: 'b',
},
xudir: {
describe: 'Data directory for xud',
type: 'string',
alias: 'x',
},
dbpath: {
describe: 'Path to the XUD database',
type: 'string',
alias: 'd',
},
loglevel: {
describe: 'Verbosity of the logger',
type: 'string',
alias: 'l',
},
logpath: {
describe: 'Path to the log file',
type: 'string',
},
logdateformat: {
describe: 'Format of the logger date',
type: 'string',
},
'lnd.[currency].certpath': {
describe: 'Path to the SSL certificate for lnd',
type: 'string',
},
'lnd.[currency].cltvdelta': {
describe: 'CLTV delta for the final timelock',
type: 'number',
},
'lnd.[currency].disable': {
describe: 'Disable lnd integration',
type: 'boolean',
default: undefined,
},
'lnd.[currency].host': {
describe: 'Host of the lnd gRPC interface',
type: 'string',
},
'lnd.[currency].macaroonpath': {
describe: 'Path of the admin macaroon for lnd',
type: 'string',
},
'lnd.[currency].nomacaroons': {
describe: 'Whether to disable macaroons for lnd',
type: 'boolean',
default: undefined,
},
'lnd.[currency].port': {
describe: 'Port for the lnd gRPC interface',
type: 'number',
},
});
// delete non-config keys from argv
delete argv._;
delete argv.version;
delete argv.help;
delete argv.$0;
const backup = new Backup();
backup.start(argv);
process.on('SIGTERM', () => {
backup.stop();
console.info('SIGTERM signal received.');
});