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

Swaps over nostr #9260

Merged
merged 2 commits into from
Nov 12, 2024
Merged

Swaps over nostr #9260

merged 2 commits into from
Nov 12, 2024

Conversation

ecdsa
Copy link
Member

@ecdsa ecdsa commented Oct 19, 2024

Swaps over Nostr:

  • Separation between SwapManager and its transport: Legacy transpport uses http, Nostr uses websockets
  • The transport uses a context to open/close connections. This context is not async, because it needs to be called from the GUI
  • Initialize swapserver fees values to None instead of 0 (so that they cannot be used before swap manager is initialized)
  • Remove swapserver fees disk caching (swap_pairs file)
  • Regtests set config 'nostr_relays' to an empty string, so that the swap manager falls back to using the http transport

@ecdsa
Copy link
Member Author

ecdsa commented Oct 19, 2024

Notes

  • both this pull request and Psbt nostr #9261 are based on 828c71f
  • the current electrum_aionostr package uses websockets, which does not support a proxy
  • no QML support for now
  • In order to test this on regtest, you may run the swapserver_success test (it uses http), in order to setup the server configuration. After that, in order to use nostr, reset nostr_relays to its default value:
python3 -m unittest tests.regtest.TestLightningSwapserver.test_swapserver_success
$alice -o setconfig nostr_relays None
$bob -o setconfig nostr_relays None

Note2: I have the following exports in my .bashrc

export alice="./run_electrum --regtest -D /tmp/alice"
export bob="./run_electrum --regtest -D /tmp/bob"
export carol="./run_electrum --regtest -D /tmp/carol"
export newblock="$bitcoin_cli generatetoaddress 1 `$bitcoin_cli getnewaddress`"

@ecdsa ecdsa force-pushed the swaps_over_nostr branch 2 times, most recently from 6f166be to 49b5b43 Compare October 22, 2024 08:18
@ecdsa ecdsa force-pushed the swaps_over_nostr branch 2 times, most recently from 9bc0964 to e063858 Compare October 24, 2024 09:31
 - Separation between SwapManager and its transport:
   Legacy transpport uses http, Nostr uses websockets
 - The transport uses a context to open/close connections.
   This context is not async, because it needs to be called
   from the GUI
 - Swapserver fees values are initialized to None instead
   of 0, so that any attempt to use them before the swap
   manager is initialized will raise an exception.
 - Remove swapserver fees disk caching (swap_pairs file)
 - Regtests use http transport
 - Android uses http transport (until QML is ready)
@ecdsa ecdsa merged commit 589dc87 into master Nov 12, 2024
13 of 16 checks passed
@ecdsa ecdsa deleted the swaps_over_nostr branch November 12, 2024 10:09
@ecdsa ecdsa added this to the 4.6.0 milestone Nov 12, 2024
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.

2 participants