77 Commits

Author SHA1 Message Date
003419a84c An attempt to build linux binary with native vsock code 2024-08-16 01:52:25 +02:00
86c21cbab3 Fall back to Eclair test node details 2024-08-14 22:05:24 +02:00
a15db45e13 Vsock stuff for phoenixd 2024-08-14 21:44:24 +02:00
26bfc7d3f9 Onchain wallets information endpoints 2024-07-11 10:10:10 +02:00
d7333c87ad Swap-in wallet functionalities 2024-07-09 11:53:16 +02:00
pm47
2e22c0b80c
Back to SNAPSHOT 2024-07-03 16:05:33 +02:00
pm47
6eb0940637
Set version to 0.2.0 2024-07-03 15:56:45 +02:00
Pierre-Marie Padiou
c2bd9f287c
Add support for optional payer note (#63)
Usage:

```shell
./phoenix-cli payoffer --offer lnoxxxxxx --amountSat 2100 --message "Hello from phoenixd!"
```
2024-07-02 14:56:34 +02:00
Pierre-Marie Padiou
18ade318cd
Add BOLT12 support (#60)
BOLT12 introduces "offers", which are reusable payment requests (a.k.a. static invoices).

Add the following phoenix-cli/api methods:
- `getoffer`
- `payoffer`
- `decodeinvoice` (supersedes #56)
- `decodeoffer`

---------

Co-authored-by: Dominique Padiou <5765435+dpad85@users.noreply.github.com>
2024-07-02 14:19:24 +02:00
Pierre-Marie Padiou
4a7e2a4921
Use lightning-kmp 1.7.0-FEECREDIT-8 (#62)
It supports BOLT12 but proper integration will be done in a follow-up PR.
2024-07-02 14:05:59 +02:00
pm47
68d2512f7a
Back to SNAPSHOT 2024-05-16 18:42:09 +02:00
pm47
6845a31e61
Set version to 0.1.5 2024-05-16 18:19:10 +02:00
Dominique Padiou
38a236a338
Add list incoming and outgoing payments calls (#53)
- added `GET /payments/outgoing` endpoint: returns a list of 
outgoing payments. Only Lightning outgoing payments are listed. 
Other types of outgoing payments (splice, channel close, ...)
are ignored.

- updated `GET /payments/incoming` endpoint to accept new
parameters for paging and date filtering.
2024-05-16 18:18:12 +02:00
Pierre-Marie Padiou
a97e5776b1
Update lightning-kmp to 1.6.2-FEECREDIT-7 (#51) 2024-05-16 18:07:36 +02:00
Pierre-Marie Padiou
dec1c59c80
Add descriptionHash parameter to createinvoice (#50)
A new parameter `descriptionHash` has been added to `createinvoice`, which takes a 32-bytes hex string.

Either `description` or `descriptionHash` must be provided.

The `description` field is now limited to 128 characters.
2024-05-15 10:55:16 +02:00
Pierre-Marie Padiou
18035566f8
Add authentication to webhook calls (#34)
A new `X-Phoenix-Signature` header is added to webhook calls, which contains the HMAC-SHA256 signature of the whole json body, encoded in utf-8, using the `webhook-secret` configuration parameter, also encoded in utf-8. 

For example:
- webhook request body:
```
{
    "type": "payment_received",
    "timestamp": 1712785550079,
    "amountSat": 8,
    "paymentHash": "e628f8a516e9d3ee5e212a675f8d0c9dc5e7a5d500c5f4f91c62e9e921492653",
    "externalId": null
}
```
- `webhook-secret` in `phoenix.conf`:`ef72d3b96324106dfbf83f2a4efeff7dddb4ce923e9664cb56baf34cc52936b6`

Will produce the header `X-Phoenix-Signature: 77ffc40401024fb417e45fdd002de06bdbf3b48b90d09d05cccd06462920aed7`

A `timestamp` has been added to the events, to provide protection against replay attacks. Users should check that the timestamp is not too old. Stripe uses a [5 min default tolerance](https://docs.stripe.com/webhooks#replay-attacks).

Suggested by @danielcharrua in #33.
2024-04-23 16:57:03 +02:00
Pierre-Marie Padiou
2964e34213
Add official Dockerfile (#17)
The Dockerfile builds on windows x86, linux x86/arm and mac x86/arm.

It uses a JVM build, which is simpler and more portable than native builds.

---------

Co-authored-by: Seth For Privacy <40500387+sethforprivacy@users.noreply.github.com>
2024-04-10 17:43:05 +02:00
pm47
3f1a64a4e1
Back to SNAPSHOT 2024-04-10 17:37:50 +02:00
pm47
04bd430c48
Set version to 0.1.4 2024-04-10 16:48:15 +02:00
Pierre-Marie Padiou
5e1ab0d5d9
Replace --max-absolute-fee by --max-mining-fee (#32)
It makes much more sense to consider only the mining fee, for the absolute fee check, as it is volatile and amount-independent. The service fee is in % and predictable.

The default value is equivalent as before (1% of the default `auto-liquidity`, given that the previous value of 2% included the 1% liquidity service fee). Previous option is deprecated and explicitly rejected.
2024-04-10 16:47:15 +02:00
Fabrice Drouin
75247e4de2
Do not add linux target on aarch64 architectures (#25)
It would fail as there is no kotlin-native toolchain yet and prevent us from building JVM targets.
2024-03-28 14:23:05 +01:00
pm47
3389035dbf
Back to SNAPSHOT 2024-03-27 14:00:04 +01:00
pm47
d805f81c2b
Set version to 0.1.3 2024-03-27 13:37:31 +01:00
Pierre-Marie Padiou
eeafd9cc60
Update gradle to 8.5 (#19)
It supports JDK 21, which then enables us to use `eclipse-temurin:21-jdk-alpine` on docker, which then makes the docker image run on ARM.
2024-03-27 11:55:57 +01:00
Pierre-Marie Padiou
b9c8ffd00e
Use lightning-kmp 1.6.2-FEECREDIT-5 (#18)
There are no functional changes, this version is published on sonatype.
2024-03-27 11:43:21 +01:00
Pierre-Marie Padiou
ce86e82854
Factor initialization of datadir (#15)
Fixes #14.
2024-03-27 10:16:15 +01:00
Fabrice Drouin
3fc693e722
Add phoenix-cli script to the JVM distribution (#8)
* Add phoenix-cli script to the JVM distribution

* Close http client after use (otherwise it hangs on the JVM)
2024-03-26 16:37:25 +01:00
Pierre-Marie Padiou
0e9b0d6fe4
Update issue templates 2024-03-26 16:34:45 +01:00
Pierre-Marie Padiou
29e5fe1162
Update issue templates 2024-03-26 16:32:48 +01:00
Pierre-Marie Padiou
bfd521eba1
Update issue templates 2024-03-26 16:25:12 +01:00
pm47
c7be837117
Back to SNAPSHOT 2024-03-25 18:25:42 +01:00
pm47
414aa56bfa
Set version to 0.1.2 2024-03-25 18:14:21 +01:00
Fabrice Drouin
613610eb14
Build a jvm application (#7)
Application is build and  packaged with the `application plugin`, which will create a  .zip file that includes all runtime dependencies and a starter script.

---------

Co-authored-by: pm47 <pm.padiou@gmail.com>
2024-03-25 18:14:21 +01:00
pm47
f3251e78e5
explicit message in case of 4XX failures
```
$ curl -u :bad-password http://127.0.0.1:9740/getinfo
Invalid authentication (use basic auth with the http password set in
phoenix.conf)

$ curl -u :4034..8232 http://127.0.0.1:9740/getinfowithtypo
Unknown endpoint (check api doc)

$ curl -u :4034..8232 -X POST http://127.0.0.1:9740/getinfowithtypo
Invalid http method (use the correct GET/POST)

```
2024-03-25 18:14:20 +01:00
pm47
df91b9604f
get user consent from command line 2024-03-25 12:07:26 +01:00
pm47
f2b378484a
optionnally provide an external seed
usage: `PHOENIX_SEED="focus certain canvas rude exist sausage chuckle
forget bronze brown warm comic" ./phoenixd`
2024-03-25 12:03:41 +01:00
pm47
0432da38e5
optionnally set datadir with env var
ex: `PHOENIX_DATADIR=/my/phoenix/dir ./phoenixd`
2024-03-25 11:37:33 +01:00
pm47
029bd7c162
back to SNAPSHOT 2024-03-25 10:50:56 +01:00
pm47
4e42a462e6
set version to 0.1.1 2024-03-22 18:10:50 +01:00
pm47
c665814d73
fixup! use lightning-kmp 1.6.2-FEECREDIT-4 2024-03-22 18:10:14 +01:00
Dominique Padiou
cc0d042927
Improve error message when payment is rejected 2024-03-22 17:49:55 +01:00
pm47
d36ad92ed5
use lightning-kmp 1.6.2-FEECREDIT-4 2024-03-22 17:42:00 +01:00
pm47
0698418f09
rework liquidity options 2024-03-22 15:03:25 +01:00
pm47
a181fac6be
nit in --help 2024-03-22 11:04:12 +01:00
pm47
cb6aff83ac
set version to 0.1.0 2024-03-21 16:21:26 +01:00
pm47
eb16d745f4
use release executable for packaging 2024-03-21 16:21:26 +01:00
pm47
920943d49b
remove unused in-memory payments db 2024-03-21 16:21:26 +01:00
pm47
a012a7098b
use lightning-kmp 1.6.2-FEECREDIT-3 2024-03-21 16:21:24 +01:00
pm47
1dc4d16543
add basic README 2024-03-21 15:15:51 +01:00
pm47
91e1ea6055
make invoice amount optional 2024-03-21 14:24:05 +01:00