Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enh#248 v4v Untested implementation of CR 7629169 #249

Merged
merged 3 commits into from
May 20, 2021

Conversation

dellagustin
Copy link
Contributor

@dellagustin dellagustin commented May 18, 2021

This PR implements #248.
It delivers an implementation of the the podcast payment metadata
defined at https://github.com/satoshisstream/satoshis.stream/blob/main/TLV_registry.md#field-7629169 which uses custom record 7629169.

Due to the way that value is handled internally in podStation, this is a limited implementation:

  • Only the url field is supported, to identify the podcast that was listened generating the payment, this is required for podcasts that get their value through https://satoshis.stream/
  • The funds are internally cumulated by node id and custom record key/value, which means that if you start playing a podcast that has value configuration node id and custom record key/value of already unsettled funds from another podcast, the new value will be cumulated into the unsettled funds of the wrong podcast (it should only happen for a few seconds in most cases).

TODO:

  • Test payment with LNPay.co - 00b7d0c
  • Test payment with LND

This commit is not yet tested.
It delivers an implementation of the the podcast payment metadata
defined at
https://github.com/satoshisstream/satoshis.stream/blob/main/TLV_registry.md#field-7629169
which uses custom record 7629169
@satoshisstream
Copy link

Nice!! URL is good enough for now, at least we'll know whom to give the money to ;).
Let me know a (preferably UTC) timestamp and the URL of a podcast you tested and I can verify we receive ;)

@dellagustin
Copy link
Contributor Author

Hi @satoshisstream I have tested today with the feed https://feeds.buzzsprout.com/1780689.rss, you should have received 16 sats in your node from the LNPay node (033868c219bdb51a33560d854d500fe7d3898a1ad9e05dd89d0007e11313588500 ) on 10:18:07 PM CEST May 19, 2021 (08:18:07 UTC). Can you check?

@dellagustin
Copy link
Contributor Author

LND is also tested, I'll wait for the confirmation from @satoshisstream to merge and release.

@satoshisstream
Copy link

+------------+----------------------------------------------+------------+---------------------+---------------------+-----------+-----------------------------------------------------+---------------+---------------+--------+-------------+-----------------+---------------------+--------------------+
| invoice_id | r_hash_base64                                | value_msat | creation_date       | settle_date         | add_index | custom_record_7629169                               | podcast_title | episode_title | action | action_time | podcastindex_id | action_time_seconds | podcastindex_ep_id |
+------------+----------------------------------------------+------------+---------------------+---------------------+-----------+-----------------------------------------------------+---------------+---------------+--------+-------------+-----------------+---------------------+--------------------+
|      21449 | Ppl52jeRZZ8wLHYgWt878uqO2UC8OVSCbxHtvd+kyqU= |      16000 | 2021-05-19 20:18:07 | 2021-05-19 20:18:07 |     18468 | {"url": "https://feeds.buzzsprout.com/1780689.rss"} | NULL          | NULL          | NULL   | NULL        |            NULL |                NULL |               NULL |
|      21452 | M2676kEP367lKGcO25TtJ39nwhJamNtPfplsdgrNhfQ= |       5000 | 2021-05-19 20:19:07 | 2021-05-19 20:19:07 |     18471 | {"url": "https://feeds.buzzsprout.com/1780689.rss"} | NULL          | NULL          | NULL   | NULL        |            NULL |                NULL |               NULL |
+------------+----------------------------------------------+------------+---------------------+---------------------+-----------+-----------------------------------------------------+---------------+---------------+--------+-------------+-----------------+---------------------+--------------------+
2 rows in set (0.007 sec)

LGTM; I have to fix the matching of URL to podcastindex_id but it'll be OK ;)

@dellagustin
Copy link
Contributor Author

@satoshisstream cool, I'll release soon.

@dellagustin dellagustin marked this pull request as ready for review May 20, 2021 18:52
@satoshisstream
Copy link

Time has finally come for me to import podcastindex DB daily because of this ;)

Cheers

@dellagustin
Copy link
Contributor Author

Time has finally come for me to import podcastindex DB daily because of this ;)

Have you considered consuming the index API on demand and caching the result locally instead of importing the whole db?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants