electrum
electrum copied to clipboard
Swaps over nostr
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
Notes
- both this pull request and #9261 are based on 828c71f
- the current
electrum_aionostrpackage useswebsockets, which does not support a proxy - no QML support for now
- In order to test this on regtest, you may run the
swapserver_successtest (it uses http), in order to setup the server configuration. After that, in order to use nostr, resetnostr_relaysto 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`"