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
Copy file name to clipboardExpand all lines: README.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,8 +46,12 @@ For running the server, rename the file `sample-cl-rest-config.json` to `cl-rest
46
46
- LNRPCPATH (Default: ``)
47
47
- RPCCOMMANDS (Default: `["*"]`)
48
48
- DOMAIN (Default: `localhost`)
49
+
- BIND (Default: `::`)
49
50
50
51
#### Option 2: With the plugin configuration, if used as a plugin
52
+
53
+
NOTE: Node.js plugins might not work with lightningd.service setting `MemoryDenyWriteExecute=true` as it denies the creation of writable and executable memory mappings. Ref: https://github.com/Ride-The-Lightning/c-lightning-REST/issues/116
54
+
51
55
If running as a plugin, configure the below options in your c-lightning `config` file:
52
56
-`rest-port`
53
57
-`rest-docport`
@@ -56,6 +60,7 @@ If running as a plugin, configure the below options in your c-lightning `config`
56
60
-`rest-lnrpcpath`
57
61
-`rest-rpc`
58
62
-`rest-domain`
63
+
-`rest-bind`
59
64
60
65
Defaults are the same as in option # 1 with the exception that `rest-rpc` is a comma separated string.
61
66
@@ -72,15 +77,15 @@ Pass arguments when launching lightningd:
E.g. `$ lightningd --plugin=/Users/<user>/c-lightning-REST/plugin.js --rest-port=3003`
80
+
E.g. `$ lightningd --plugin=/Users/<user>/c-lightning-REST/clrest.js --rest-port=3003`
76
81
77
82
OR
78
83
79
84
Set `plugin`, `[rest-port]`, `[rest-docport]`, `[rest-protocol]`, and `[rest-execmode]` in lightningd [config](https://github.com/ElementsProject/lightning/blob/master/doc/lightningd-config.5.md)
80
85
81
86
E.g. add below to the `config` file in `.lightning` folder
82
87
```
83
-
plugin=/Users/<user>/c-lightning-REST/plugin.js
88
+
plugin=/Users/<user>/c-lightning-REST/clrest.js
84
89
rest-port=3002
85
90
rest-docport=4001
86
91
rest-protocol=https
@@ -128,13 +133,13 @@ Providing a `DOMAIN` to the c-lightning-REST configuration will add the domain a
128
133
If you are *upgrading* a server which is already configured, you should first backup and your entire `./certs` directory in case you need to restore it later.
129
134
Following this you should delete *only* the `.certs/certificate.pem` and `.certs/key.pem` files, so that new SSL certificates can be generated which take the `subjectAltName` into consideration.
130
135
131
-
**WARNING**: Do not delete `access.macaroon`. If you do then your connection to remote applications will be lost, and need to be re-configured.
136
+
**WARNING**: Do not delete `access.macaroon` or `rootKey.key`. If you do then your connection to remote applications will be lost, and need to be re-configured.
132
137
133
138
New certificates will be automatically generated as usual next time the program is started up.
134
139
135
140
### <aname="auth"></a>Authentication
136
141
Authentication has been implemented with macaroons. Macaroons are bearer tokens, which will be verified by the server.
137
-
A file`access.macaroon` will be generated in the `certs` folder in the application root.
142
+
Two files,`access.macaroon` and `rootKey.key`, will be generated in the `certs` folder in the application root.
138
143
The `access.macaroon` has to be read by the requesting application, converted to `base64` or `hex`, and passed in the header with key value `macaroon`.
139
144
140
145
Encoding Options for passing macaroon in the header:
@@ -179,7 +184,7 @@ C-Lightning commands covered by this API suite is [here](docs/CLTCommandCoverage
179
184
- disconnect (/v1/peer/disconnect) - `DEL`: Disconnect from a connected network peer
180
185
### Channel management
181
186
- fundchannel (/v1/channel/openChannel) - `POST`: Open channel with a connected peer node
182
-
- listchannels (/v1/channel/listChannels) - `GET`: Get the list of channels open on the node
187
+
- listchannels (/v1/channel/listChannels) - `GET`: Get the list of channels that are known to the node.
183
188
- setchannelfee (/v1/channel/setChannelFee) - `POST`: Update the fee policy for a channel
184
189
- close (/v1/channel/closeChannel) - `DEL`: Close channel
185
190
- listforwards (/v1/channel/listForwards) - `GET`: Get the list of forwarded htlcs by the node
Copy file name to clipboardExpand all lines: controllers/invoice.js
+19-20Lines changed: 19 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,16 @@ var wsServer = require('../utils/webSocketServer');
42
42
* name: private
43
43
* description: Include routing hints for private channels (true or 1)
44
44
* type: string
45
+
* - in: body
46
+
* name: fallbacks
47
+
* description: The fallbacks array is one or more fallback addresses to include in the invoice (in order from most-preferred to least).
48
+
* type: array
49
+
* items:
50
+
* type: string
51
+
* - in: body
52
+
* name: preimage
53
+
* description: 64-digit hex string to be used as payment preimage for the created invoice. IMPORTANT> if you specify the preimage, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed.
54
+
* type: string
45
55
* security:
46
56
* - MacaroonAuth: []
47
57
* responses:
@@ -65,26 +75,15 @@ var wsServer = require('../utils/webSocketServer');
0 commit comments