electrum icon indicating copy to clipboard operation
electrum copied to clipboard

Swaps over nostr

Open ecdsa opened this issue 1 year ago • 1 comments

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 avatar Oct 19 '24 13:10 ecdsa

Notes

  • both this pull request and #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 avatar Oct 19 '24 13:10 ecdsa